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 MessageFacilityRhino extension facility which allows a resource adaptor entity to pass messages between cluster nodes.
The
MessageFacilityis made available to a resource adaptor entity via its configuration properties, under theCONFIG_PROPERTY_NAMEkey.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 StringCONFIG_PROPERTY_NAME
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddMessageListener(MessageListener listener)Adds the given message listener.intgetLocalNodeID()Returns the node ID of the current Rhino node.MessageSendergetMessageSender()Returns a MessageSender for sending messages to other cluster nodes within the context of the same RA entity.voidremoveMessageListener(MessageListener listener)Removes the given message listener.voidsetRequestListener(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
-
-