|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.messaging.core.distributed.util.RpcServer
An RpcServer is installed as "server object" with a RpcDispatcher instance.
The RpcServer allows dynamic registration of other server objects, under different "categories". For each category, the RpcServer allows registration of one or more equivalent server delegate objects, on which methods will be serially invoked when a remote method call is received from the group.
Field Summary | |
protected java.lang.String |
name
|
protected java.util.Map |
servers
|
Constructor Summary | |
RpcServer()
|
|
RpcServer(java.lang.String name)
|
Method Summary | |
java.util.Set |
get(java.io.Serializable category)
|
java.util.Collection |
invoke(java.io.Serializable category,
java.lang.String methodName,
java.lang.Object[] args,
java.lang.String[] signature)
Generic detyped interface to be accessed remotely. |
boolean |
register(java.io.Serializable category,
ServerFacade subordinate)
Registers a server delegate object with the RpcServer, under the specified category. |
boolean |
registerUnique(java.io.Serializable category,
ServerFacade subordinate)
Registers a unique server delegate object with the RpcServer, under the specified category. |
static java.lang.String |
subordinateToString(java.io.Serializable category,
java.io.Serializable subordinateID,
Address address)
Helper method that returns a human readable label for a server delegate, to be used in logs. |
java.lang.String |
toString()
|
boolean |
unregister(java.io.Serializable category)
Unregister the whole category. |
boolean |
unregister(java.io.Serializable category,
ServerFacade subordinate)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.util.Map servers
protected java.lang.String name
Constructor Detail |
public RpcServer()
public RpcServer(java.lang.String name)
Method Detail |
public java.util.Collection invoke(java.io.Serializable category, java.lang.String methodName, java.lang.Object[] args, java.lang.String[] signature) throws java.lang.Exception
category
- - the category of equivalent server delegates to invoke the method on.methodName
- - the name of the method to be invoked by reflection on the registered
serverObjects.args
- - the method's arguments.signature
- - the method's signature. The array contains fully qualified class names.
java.lang.ClassNotFoundException
- if a fully qualified name specified in the method's
signature cannot be used to load a valid class.
java.lang.NoSuchMethodException
- if no method with the specified name or with the specified
signature can be identified by reflection on the server object.
java.lang.IllegalAccessException
java.lang.IllegalArgumentException
java.lang.reflect.InvocationTargetException
- if the underlying method throws an exception.
java.lang.Exception
public boolean register(java.io.Serializable category, ServerFacade subordinate)
Note that more than one "equivalent" server objects can be registered under the same category. However, no equal (as per the "equal()" method semantics) are allowed to be registered under the same category. If an unique server delegate was already registered under the category, the call fails (returns false).
category
- - the server category.subordinate
- - the server delegate object to be registered.
java.lang.NullPointerException
- if trying to register a null instance.public boolean registerUnique(java.io.Serializable category, ServerFacade subordinate)
If a server delegate is already registered under this category, the call should fail (return false).
category
- - the server category.subordinate
- - the server delegate object to be registered.
java.lang.NullPointerException
- if trying to register a null instance.public boolean unregister(java.io.Serializable category, ServerFacade subordinate)
public boolean unregister(java.io.Serializable category)
public java.util.Set get(java.io.Serializable category)
category
- - the server category.
public java.lang.String toString()
public static java.lang.String subordinateToString(java.io.Serializable category, java.io.Serializable subordinateID, Address address)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |