|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ws4d.java.dispatch.DefaultMessageSelector
public class DefaultMessageSelector
This class allows matching messages according to their
message type
or the address
of the endpoint
they are addressed to.
Selection criteria can be specified in a generic way by means of the
setSelectionProperty(int, List)
method. This method allows
declaration of expected values for each property in question. A message will
match those criteria only if it has matching values for all the given
properties.
Field Summary | |
---|---|
static int |
ENDPOINT_REFERENCE
Property denoting a selection based on the target endpoint reference of the message (i.e. its
WS-Addressing [destination] property). |
static int |
MESSAGE_TYPE
Property denoting a selection based on the message type. |
Constructor Summary | |
---|---|
DefaultMessageSelector()
Create a new default message selector. |
Method Summary | |
---|---|
boolean |
matches(Message msg)
Decides whether the given message meets the selection criteria of this message selector instance. |
void |
setSelectionProperty(int property,
List values)
Adds a "selection rule" by specifying a message property and declaring a list of allowed values
for this property. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MESSAGE_TYPE
public static final int ENDPOINT_REFERENCE
endpoint reference
of the message (i.e. its
WS-Addressing [destination] property). The [destination] property is
actually an IRI consisting of the [address] property of the target's
endpoint reference. Nevertheless, when specifying a selection rule by
means of setSelectionProperty(int, List)
method, the provided
List
values
is expected to contain
EndpointReference
instances rather than URI
s.
Constructor Detail |
---|
public DefaultMessageSelector()
Method Detail |
---|
public boolean matches(Message msg)
MessageSelector
matches
in interface MessageSelector
msg
- the message to decide upon
true
, if the configured selection rules accept the
message, false
otherwisepublic void setSelectionProperty(int property, List values)
property
and declaring a list of allowed values
for this property. Each message, which has a value for this property that
is contained within values
, will be considered for a match.
In case the provided list of values
is null
or
empty, a message will always match regardless of its actual value for the
property.
Calling this method more than once with the same property
but different values
overwrites (i.e. replaces) previously
specified values
for that property.
property
- the property to set expected values for; allowed values
are MESSAGE_TYPE
and ENDPOINT_REFERENCE
values
- a list of values the property
may take in
order to get matched by this selector; if empty, then any
value of the property would match
java.lang.IllegalArgumentException
- if propertyType
is neither
MESSAGE_TYPE
nor ENDPOINT_REFERENCE
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |