public class PortableRemoteObject extends Object implements PortableRemoteObjectDelegate
Constructor and Description |
---|
PortableRemoteObject() |
Modifier and Type | Method and Description |
---|---|
void |
connect(Remote target,
Remote source)
Makes a Remote object ready for remote communication.
|
void |
exportObject(Remote obj)
Makes a server object ready to receive remote calls.
|
Object |
narrow(Object narrowFrom,
Class narrowTo)
Checks to ensure that an object of a remote or abstract interface type
can be cast to a desired type.
|
Remote |
toStub(Remote obj)
Returns a stub for the given server object.
|
void |
unexportObject(Remote obj)
Deregisters a server object from the runtime, allowing the object to become
available for garbage collection.
|
public void exportObject(Remote obj) throws RemoteException
exportObject
in interface PortableRemoteObjectDelegate
obj
- the server object to export.RemoteException
- if export fails.public Remote toStub(Remote obj) throws NoSuchObjectException
toStub
in interface PortableRemoteObjectDelegate
obj
- the server object for which a stub is required. Must either be a subclass
of PortableRemoteObject or have been previously the target of a call to
exportObject(java.rmi.Remote)
.NoSuchObjectException
- if a stub cannot be located for the given server object.public void unexportObject(Remote obj) throws NoSuchObjectException
unexportObject
in interface PortableRemoteObjectDelegate
obj
- the object to unexport.NoSuchObjectException
- if the remote object is not
currently exported.public Object narrow(Object narrowFrom, Class narrowTo) throws ClassCastException
narrow
in interface PortableRemoteObjectDelegate
narrowFrom
- the object to check.narrowTo
- the desired type.ClassCastException
- if narrowFrom cannot be cast to narrowTo.public void connect(Remote target, Remote source) throws RemoteException
Stub#connect
method for more information.connect
in interface PortableRemoteObjectDelegate
target
- the object to connect.source
- a previously connected object.RemoteException
- if source
is not connected
or if target
is already connected to a different ORB than
source
.Copyright © 2016 JBoss by Red Hat. All rights reserved.