Thread.State, Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
DGC_PING, METHOD_CALL, METHOD_ERROR, METHOD_RESULT, SYSTEM_ERROR
Constructor and Description |
---|
Server()
Constructs a Server instance that will bind to any available
port and does not have any
Interceptor s. |
Server(ClientInterceptor clint,
Interceptor srvint)
Constructs a Server instance that will bind to any available
port and use the given client and server
Interceptor s. |
Server(int port,
ClientInterceptor clint,
Interceptor srvint)
Construcst a Server instance with the specified port, client,
and server
Interceptor s. |
Modifier and Type | Method and Description |
---|---|
void |
export(Remote object)
Exports the given
Remote object. |
ClassLoader |
getLoader(ObjID oid)
Return the
ClassLoader used for deserializing arguments
to methods of the exported object mapped to the given oid or
null if there is none. |
Remote |
getObject(ObjID oid)
Return the exported object for the given oid or null if there
is none.
|
ObjID |
getOID(Remote obj)
Return the ObjID for the given
Remote object or null if
there is none. |
static Collection |
getServers()
Returns all the Server instances for this JVM.
|
Skeleton |
getSkel(Remote obj)
|
RemoteStub |
getStub(Remote obj)
Converts the given
Remote object to a RemoteStub instance. |
void |
run()
Accepts connections and launches Handler threads.
|
boolean |
unexport(ObjID oid)
|
boolean |
unexport(Remote obj)
Unexports the given
Remote object if it is being
exported by this Server. |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public Server(int port, ClientInterceptor clint, Interceptor srvint)
Interceptor
s. If port is zero then any
available port will be chosen.port
- the port for the server to bind toclint
- the client Interceptor
or nullsrvint
- the server Interceptor
or nullpublic Server(ClientInterceptor clint, Interceptor srvint)
Interceptor
s.clint
- the client Interceptor
srvint
- the server Interceptor
public Server()
Interceptor
s.public static Collection getServers()
public void run()
public Remote getObject(ObjID oid)
oid
- the oid of an exported objectpublic ObjID getOID(Remote obj)
Remote
object or null if
there is none.obj
- an exported objectpublic ClassLoader getLoader(ObjID oid)
ClassLoader
used for deserializing arguments
to methods of the exported object mapped to the given oid or
null if there is none.oid
- the oid of an exported objectpublic RemoteStub getStub(Remote obj)
Remote
object to a RemoteStub
instance. This may involve nothing if the object is
already a stub, or it may involve search for an appropriate
stub class and constructing an instance of it.obj
- the Remote
objectRemoteStub
for objpublic void export(Remote object) throws ExportException
Remote
object.object
- the object to exportExportException
- when there is an errorpublic boolean unexport(Remote obj)
Remote
object if it is being
exported by this Server.obj
- the object to unexport