|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectplanet.generic.commonapi.behaviours.BehavioursPatternImpl
This class stores a pattern for incoming messages on a node. This pattern is used to dispatch a behaviour classOf whenever the pattern matches the type and mode of the incoming message. To allow behaviours to execute randomly on time, every pattern has a probability.
Field Summary | |
static java.lang.String |
COMPLEMENTARY_WILDCARD
Complementary wildcard: given a set of patterns P, this wildcard is used to attach a behaviour to the patterns on the whole pattern space S not included in P set. |
static java.lang.String |
ROLE_BAD
Overlay property: Bad refers to a behvaiour which must run when node misbehaves, including routing and overlay invariant's maintenance. |
static java.lang.String |
ROLE_GOOD
Overlay property: Good refers to a behaviour which must run when node behaves as underlying kbr protocol stipulates. |
static java.lang.String |
ROLE_NEUTRAL
Overlay property: Neutral refers to a behvaiour which must run always despite node's role is bad or good. |
static java.lang.String |
RUN_ALWAYS
Overlay property: Always refers to a behvaiour which must run always despite RouteMessage's destination. |
static java.lang.String |
RUN_LOCAL
Overlay property: Local refers to a behaviour which must run only when RouteMessage's pattern is for him. |
static java.lang.String |
RUN_REMOTE
Overlay property: Remote refers to a behaviour which must run only when RouteMessage's pattern is for another peer rather than him. |
static java.lang.String |
UNIVERSAL_WILDCARD
Universal wildcard: given a set of patterns P, this wildcard is used to attach a behaviour to all the patterns on the whole pattern space S included P set, i.e. |
Constructor Summary | |
BehavioursPatternImpl()
Builds a non initialized BehavioursPattern. |
Method Summary | |
int |
compareTo(BehavioursPatternImpl pattern)
Compares two patterns based on specific criteria. |
java.lang.Class |
getClassOf()
|
int |
getMap()
|
java.lang.String |
getModeOf()
|
double |
getPdf()
|
java.lang.String |
getRoleOf()
|
java.lang.String |
getTypeOf()
|
java.lang.String |
getWhenTo()
|
int |
map(java.lang.String property)
Maps a property to specific quantifier. |
BehavioursPattern |
setValues(java.lang.Class classOf,
java.lang.String typeOf,
java.lang.String modeOf,
double pdf,
java.lang.String whenTo,
java.lang.String roleOf)
Sets the initial values for this pattern. |
java.lang.String |
toString()
Shows the string representation of this pattern. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String COMPLEMENTARY_WILDCARD
public static final java.lang.String UNIVERSAL_WILDCARD
public static final java.lang.String RUN_LOCAL
public static final java.lang.String RUN_REMOTE
public static final java.lang.String RUN_ALWAYS
public static final java.lang.String ROLE_GOOD
public static final java.lang.String ROLE_BAD
public static final java.lang.String ROLE_NEUTRAL
Constructor Detail |
public BehavioursPatternImpl()
Method Detail |
public BehavioursPattern setValues(java.lang.Class classOf, java.lang.String typeOf, java.lang.String modeOf, double pdf, java.lang.String whenTo, java.lang.String roleOf)
classOf
- Behaviours class to be invoked when this pattern is matched.typeOf
- RouteMessage type.modeOf
- RouteMessage mode.pdf
- The probability for a successfully invokation of the related
behaviour.whenTo
- Determines the locality of the behaviour (local, remote or
both situations).roleOf
- Determines the active role to invoke the related behaviour (good, bad or both)
public java.lang.Class getClassOf()
public java.lang.String getModeOf()
public double getPdf()
public java.lang.String getTypeOf()
public java.lang.String getWhenTo()
public java.lang.String getRoleOf()
public int getMap()
public int map(java.lang.String property)
property
- The property to quantify.
public int compareTo(BehavioursPatternImpl pattern)
Specific criteria: Type Mode 1) Tag, Tag 2) Tag, ? 3) Tag, * 4) ? , Tag 5) * , Tag 6) ? , * 7) * , ? 8) * , *
pattern
- The pattern to compare.
public java.lang.String toString()
Object.toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |