import com.opencloud.rhino.facilities.message.MessageFacility;
import javax.slee.resource.ConfigProperties;
public class MyResourceAdapter implements ResourceAdaptor {
public void raConfigure(ConfigProperties configProperties) {
...
MessageFacility messageFacility = null;
ConfigProperties.Property property = configProperties.getProperty(MessageFacility.CONFIG_PROPERTY_NAME);
if (property != null) {
messageFacility = (MessageFacility) property.getValue();
}
...
}
...
}
Interface MessageFacility
-
public interface MessageFacility
Rhino extension facility which allows a resource adaptor entity to pass messages between cluster nodes.
The
MessageFacility
is made available to a resource adaptor entity via its configuration properties, under theCONFIG_PROPERTY_NAME
key.An example of how to access the message facility from a resource adaptor is given below:
-
-
Field Summary
Fields Modifier and Type Field Description static String
CONFIG_PROPERTY_NAME
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addMessageListener(MessageListener listener)
Adds the given message listener.int
getLocalNodeID()
Returns the node ID of the current Rhino node.MessageSender
getMessageSender()
Returns a MessageSender for sending messages to other cluster nodes within the context of the same RA entity.void
removeMessageListener(MessageListener listener)
Removes the given message listener.void
setRequestListener(RequestListener listener)
Sets the listener to respond to incoming requests.
-
-
-
Field Detail
-
CONFIG_PROPERTY_NAME
static final String CONFIG_PROPERTY_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getLocalNodeID
int getLocalNodeID()
Returns the node ID of the current Rhino node.
-
getMessageSender
MessageSender getMessageSender()
Returns a MessageSender for sending messages to other cluster nodes within the context of the same RA entity.
Typically this method would be called in
raConfigure(ConfigProperties)
orraActive()
-
addMessageListener
void addMessageListener(MessageListener listener)
Adds the given message listener. If the listener was already added, this method has no effect.
Typically this method would be called in
raConfigure(ConfigProperties)
orraActive()
- Parameters:
listener
- The message listener to add
-
removeMessageListener
void removeMessageListener(MessageListener listener)
Removes the given message listener. If the listener was not currently registered, this method has no effect.
This method would typically be called in
raUnconfigure()
,raStopping()
, orraInactive()
- Parameters:
listener
- The message listener to remove
-
setRequestListener
void setRequestListener(RequestListener listener)
Sets the listener to respond to incoming requests.
Typically this method would be called in
raConfigure(ConfigProperties)
- Parameters:
listener
- the listener.- Since:
- Rhino 2.3.0
-
-