|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.mx.util.JBossNotificationBroadcasterSupport org.jboss.system.ServiceMBeanSupport org.jboss.cache.TreeCache org.jboss.cache.rpc.RpcTreeCache
public class RpcTreeCache
TreeCache
extension that adds a general purpose RPC functionality
to allow clients to make/receive RPC calls over the same JGroups Channel
used by the cache.
Services wishing to receive remote calls should register a unique service name and an object on which the remote calls for that service can be invoked.
Clients wishing to make RPC calls need to know the unique service name, which
they can pass to one of the flavors of callRemoteMethods
.
Field Summary | |
---|---|
static java.lang.reflect.Method |
dispatchRpcCallMethod
Deprecated. The _dispatchRpcCall(String, MethodCall) method |
protected java.util.Map |
rpcHandlers
Deprecated. Map of registered RPC handlers |
Fields inherited from class org.jboss.system.ServiceMBeanSupport |
---|
server, SERVICE_CONTROLLER_SIG, serviceName |
Fields inherited from interface org.jboss.system.ServiceMBean |
---|
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED |
Constructor Summary | |
---|---|
RpcTreeCache()
Deprecated. Default constructor. |
|
RpcTreeCache(org.jgroups.JChannel channel)
Deprecated. Expects an already connected channel. |
|
RpcTreeCache(java.lang.String cluster_name,
java.lang.String props,
long state_fetch_timeout)
Deprecated. Creates a channel with the given properties. |
Method Summary | |
---|---|
java.lang.Object |
_dispatchRpcCall(java.lang.String serviceName,
org.jgroups.blocks.MethodCall call)
Deprecated. Looks up the RPC handler for serviceName and invokes
the method call on it. |
java.util.List |
callRemoteMethods(java.lang.String serviceName,
java.util.Vector mbrs,
org.jgroups.blocks.MethodCall method_call,
boolean synchronous,
boolean exclude_self,
long timeout)
Deprecated. Calls a remote method on nodes in the cluster, targeted at objects registered under a given serviceName . |
java.util.List |
callRemoteMethods(java.lang.String serviceName,
java.util.Vector members,
java.lang.reflect.Method method,
java.lang.Object[] args,
boolean synchronous,
boolean exclude_self,
long timeout)
Deprecated. Calls a remote method on nodes in the cluster, targeted at objects registered under a given serviceName . |
java.util.List |
callRemoteMethods(java.lang.String serviceName,
java.util.Vector members,
java.lang.String method_name,
java.lang.Class[] types,
java.lang.Object[] args,
boolean synchronous,
boolean exclude_self,
long timeout)
Deprecated. Calls a remote method on nodes in the cluster, targeted at objects registered under a given serviceName . |
void |
registerRPCHandler(java.lang.String serviceName,
java.lang.Object handler)
Deprecated. Registers the given object as the on which any MethodCall associated with the given service should be invoked. |
void |
unregisterRPCHandler(java.lang.String serviceName,
java.lang.Object handler)
Deprecated. Removes the given object as a handler for RPC calls for the given service. |
Methods inherited from class org.jboss.system.ServiceMBeanSupport |
---|
create, destroy, getDeploymentInfo, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop |
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport |
---|
addNotificationListener, getNotificationInfo, handleNotification, nextNotificationSequenceNumber, removeNotificationListener, removeNotificationListener, sendNotification |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.jboss.system.ServiceMBean |
---|
getName, getState, getStateString, jbossInternalLifecycle |
Methods inherited from interface org.jboss.system.Service |
---|
create, destroy, start, stop |
Field Detail |
---|
public static final java.lang.reflect.Method dispatchRpcCallMethod
_dispatchRpcCall(String, MethodCall)
method
protected java.util.Map rpcHandlers
Map
of registered RPC handlers
Constructor Detail |
---|
public RpcTreeCache(java.lang.String cluster_name, java.lang.String props, long state_fetch_timeout) throws java.lang.Exception
java.lang.Exception
public RpcTreeCache() throws java.lang.Exception
java.lang.Exception
public RpcTreeCache(org.jgroups.JChannel channel) throws java.lang.Exception
java.lang.Exception
Method Detail |
---|
public java.util.List callRemoteMethods(java.lang.String serviceName, java.util.Vector members, java.lang.reflect.Method method, java.lang.Object[] args, boolean synchronous, boolean exclude_self, long timeout) throws java.lang.Exception
serviceName
.
callRemoteMethods
in interface RpcTreeCacheMBean
serviceName
- name of a callback handler that will have been
registered on the remote end via
registerRPCHandler(String, Object)
.members
- Vector, each of whose members is the Address of one
the nodes in the cache's
member list
.
If null
, the method will be invoked on
all members.method
- method to executeargs
- method argumentssynchronous
- true
if the call should block until
all members respond (or timeout); false
if the call should return immediately without
waiting for responsesexclude_self
- should the call be invoked on the callee?timeout
- how long to wait for synchronous responses
null
if the call is asynchronous.
Elements of the list will either be a returned value
or an exception if one was returned. Any
NoHandlerForRPCException returned will be removed.
java.lang.Exception
public java.util.List callRemoteMethods(java.lang.String serviceName, java.util.Vector mbrs, org.jgroups.blocks.MethodCall method_call, boolean synchronous, boolean exclude_self, long timeout) throws java.lang.Exception
serviceName
.
If the cache's cache mode
is TreeCache.LOCAL
and parameter exclude_self
is false
this request will be made directly to #_dispatchRpcCall()
.
callRemoteMethods
in interface RpcTreeCacheMBean
serviceName
- name of a callback handler that will have been
registered on the remote end via
registerRPCHandler(String, Object)
.members
- Vector, each of whose members is the Address of one
the nodes in the cache's
member list
.
If null
, the method will be invoked on
all members.method_call
- method call to executesynchronous
- true
if the call should block until
all members respond (or timeout); false
if the call should return immediately without
waiting for responsesexclude_self
- should the call be invoked on the callee?timeout
- how long to wait for synchronous responses
null
if the call is asynchronous.
Elements of the list will either be a returned value
or an exception if one was returned. Any
NoHandlerForRPCException returned will be removed.
java.lang.Exception
public java.util.List callRemoteMethods(java.lang.String serviceName, java.util.Vector members, java.lang.String method_name, java.lang.Class[] types, java.lang.Object[] args, boolean synchronous, boolean exclude_self, long timeout) throws java.lang.Exception
serviceName
.
callRemoteMethods
in interface RpcTreeCacheMBean
serviceName
- name of a callback handler that will have been
registered on the remote end via
registerRPCHandler(String, Object)
.members
- Vector, each of whose members is the Address of one
the nodes in the cache's
member list
.
If null
, the method will be invoked on
all members.method_name
- name of the method to executeargs
- method argumentssynchronous
- true
if the call should block until
all members respond (or timeout); false
if the call should return immediately without
waiting for responsesexclude_self
- should the call be invoked on the callee?timeout
- how long to wait for synchronous responses
null
if the call is asynchronous.
Elements of the list will either be a returned value
or an exception if one was returned. Any
NoHandlerForRPCException returned will be removed.
NoHandlerForRPCException
- if no handler is registered on this node
under serviceName
.
java.lang.Exception
public void registerRPCHandler(java.lang.String serviceName, java.lang.Object handler)
registerRPCHandler
in interface RpcTreeCacheMBean
serviceName
- name of a service that will be receiving RPC callshandler
- object on which RPC calls for
serviceName
can be invoked._dispatchRpcCall(java.lang.String, org.jgroups.blocks.MethodCall)
public void unregisterRPCHandler(java.lang.String serviceName, java.lang.Object handler)
unregisterRPCHandler
in interface RpcTreeCacheMBean
serviceName
- name of a service that will be receiving RPC callshandler
- object that was previously passed to
registerRPCHandler(String, Object)
for
serviceName
.handler
- public java.lang.Object _dispatchRpcCall(java.lang.String serviceName, org.jgroups.blocks.MethodCall call)
serviceName
and invokes
the method call on it.
serviceName
- the servicecall
- the call to invoke
NoHandlerForRPCException
if no handler was registered for
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |