|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectwt.method.RemoteMethodServer
public class RemoteMethodServer
Class that provides access to a remote method server. Instances of this class are local (non-remote) objects that encapsulate the communication with a remote method server object. This encapsulation includes object location, and automatic recovery from communication errors.
The local object represents the "concept" of a remote method server, not a particular instance of the remote server object. This allows the local object to manage connecting to a server object, and reconnecting to new server objects during error recovery.
Error recovery consists of automatically retrying calls that fail due to communication
failures. Argument classes that are consumed by serialization should throw a
NotSerializableException to abort retries if re-serialization is not valid.
If the calling thread is an instance of wt.util.WTThread, interrupting the
thread while it is invoking a remote method will cause the corresponding remote thread
in the method server to be interrupted. This allows the client to abort long running
server operations by interrupting the calling thread.
Supported API: true
Extendable: false
| Method Summary | |
|---|---|
MethodAuthenticator |
getAuthenticator()
Get the MethodAuthenticator to use for the current thread. |
static RemoteMethodServer |
getDefault()
Get default instance of RemoteMethodServer. |
static boolean |
getDefaultPrivateAffinity()
Get default value of whether or not calls from different contexts will use private server affinity or share server affinity with other contexts accessing the same server. |
static boolean |
getDefaultPrivateAuthentication()
Return default value of whether or not calls from will use a private method authenticator or share authentication with other contexts accessing the same server. |
static RemoteMethodServer |
getInstance(URL server_codebase)
Get instance of RemoteMethodServer corresponding to the given
server codebase URL. |
static RemoteMethodServer |
getInstance(URL server_codebase,
String service_name)
Get instance of RemoteMethodServer corresponding to the given
server codebase URL. |
String |
getPassword()
Get the password set for this instance by the setPassword method. |
static boolean |
getPrivateAffinity()
Return whether or not calls from the current context will use private server affinity or share server affinity with other contexts accessing the same server. |
static boolean |
getPrivateAuthentication()
Return whether or not calls from the current context will use a private method authenticator or share authentication with other contexts accessing the same server. |
String |
getUserName()
Get the user name set for this instance by the setUserName method. |
Object |
invoke(String target_method,
String target_class,
Object target_object,
Class[] arg_types,
Object[] args)
Invoke the specified target method with the remote method server. |
static void |
main(String[] args)
Simple tester Displays info from the default server. |
static void |
ping()
Simple ping tester. |
void |
setAuthenticator(MethodAuthenticator authenticator)
Set the MethodAuthenticator to use for the current thread. |
static void |
setDefaultPrivateAffinity(boolean private_affinity)
Set default value of whether or not calls from different contexts will use private server affinity or share server affinity with other contexts accessing the same server. |
static void |
setDefaultPrivateAuthentication(boolean private_auth)
Set default value of whether or not calls will use a private method authenticator or share authentication with other contexts accessing the same server. |
void |
setPassword(String password)
Set the password that will be made available to a method authenticator capable of password based authentication. |
static void |
setPrivateAffinity(boolean private_affinity)
Set whether or not calls from the current context will maintain server affinity separately from other contexts or share server affinity with other contexts accessing the same remote method server. |
static void |
setPrivateAuthentication(boolean private_auth)
Set whether or not calls from the current context will use a private method authenticator or share authentication with other contexts accessing the same server. |
void |
setUserName(String user_name)
Set the user name that will be made available to a method authenticator capable of user name based authentication. |
boolean |
streamingSupported()
Determine if streaming calls are supported. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static RemoteMethodServer getInstance(URL server_codebase)
RemoteMethodServer corresponding to the given
server codebase URL.
server_codebase - the server codebase URL
public static RemoteMethodServer getInstance(URL server_codebase,
String service_name)
RemoteMethodServer corresponding to the given
server codebase URL.
server_codebase - the server codebase URLservice_name - the service name registered by the serverpublic static RemoteMethodServer getDefault()
RemoteMethodServer.
The default instance is the one corresponding to the server codebase of the
current thread as returned by the WTProperties class.
WTPropertiespublic static boolean getPrivateAuthentication()
public static void setPrivateAuthentication(boolean private_auth)
The setting affects calls originating in threads that share the current thread's
WTContext. The default for a WTContext is to use shared
authentication.
Supported API: true
private_auth - true indicates private, false indicates sharedpublic static boolean getDefaultPrivateAuthentication()
public static void setDefaultPrivateAuthentication(boolean private_auth)
private_auth - true indicates private, false indicates sharedpublic static boolean getPrivateAffinity()
public static void setPrivateAffinity(boolean private_affinity)
The setting affects calls originating in threads that share the current thread's
WTContext. The default for a WTContext is to use shared
server affinity.
Supported API: true
private_affinity - true indicates private, false indicates sharedpublic static boolean getDefaultPrivateAffinity()
public static void setDefaultPrivateAffinity(boolean private_affinity)
private_affinity - true indicates private, false indicates sharedpublic void setUserName(String user_name)
WTContext, this user name will not be shared
with other contexts.
user_name - User name, or null to remove setting.public String getUserName()
setUserName method.
public void setPassword(String password)
WTContext, this password will not be shared
with other contexts. The password is encoded in memory so it does not remain in clear text.
password - Password, or null to remove setting.public String getPassword()
setPassword method.
public Object invoke(String target_method,
String target_class,
Object target_object,
Class[] arg_types,
Object[] args)
throws RemoteException,
InvocationTargetException
InvocationTargetException.
target_method - the target method nametarget_class - the target class (for static methods only)target_object - the target object (for instance methods only)arg_types - an array of argument types used when looking up the methodargs - an array of argument objects for the method
RemoteException - any exception trying to call the target method
InvocationTargetException - any exception thrown by the target methodMethod.invoke(java.lang.Object, java.lang.Object...)public MethodAuthenticator getAuthenticator()
MethodAuthenticator to use for the current thread.
If the current context uses a private authenticator, that one will be
returned, otherwise the shared authenticator will be returned.
public void setAuthenticator(MethodAuthenticator authenticator)
MethodAuthenticator to use for the current thread.
If the current context does not use a private authenticator, this will
set the shared authenticator. Setting to null removes the current
authenticator.
public boolean streamingSupported()
throws RemoteException
RemoteException
public static void ping()
throws RemoteException
RemoteException
public static void main(String[] args)
throws RemoteException
RemoteException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||