public final class IiopExporter extends Object implements Exporter
IiopExporter
can be used to export a single remote object to
the RMI-IIOP
runtime. It acts as an adapter between the Exporter
interface and
existing RMI-IIOP (un)export/utility APIs provided by the javax.rmi
and javax.rmi.CORBA
packages.
Note: although this exporter internally makes use of PortableRemoteObject
, it cannot be used to export remote objects
over JRMP (as PortableRemoteObject
can). For JRMP exports,
JrmpExporter
should be used instead.
Constructor and Description |
---|
IiopExporter()
Creates a new exporter which can be used to export a remote object over
IIOP.
|
IiopExporter(ORB orb)
Creates a new exporter which can be used to export a remote object over
IIOP.
|
Modifier and Type | Method and Description |
---|---|
Remote |
export(Remote impl)
Exports a remote object,
impl , to the RMI-IIOP runtime and
returns a proxy (stub) for the remote object. |
String |
toString()
Returns the string representation for this exporter.
|
boolean |
unexport(boolean force)
Unexports the remote object exported via this exporter's
export(java.rmi.Remote) method such that the object can no longer
accept incoming remote calls that were possible as a result of
exporting via this exporter. |
public IiopExporter()
ORB
.public IiopExporter(ORB orb)
ORB
is non-null
, then the stub
resulting from an export of a remote object with this exporter will be
connected to it; otherwise, the stub will be left unconnected.orb
- if non-null
, ORB to which to connect stub of
exported objectpublic Remote export(Remote impl) throws ExportException
impl
, to the RMI-IIOP runtime and
returns a proxy (stub) for the remote object. If an ORB
was
specified during construction of this exporter, then the returned
RMI-IIOP stub will be connected to it. This method cannot be called
more than once to export a remote object or an
IllegalStateException
will be thrown.export
in interface Exporter
impl
- a remote object to exportNullPointerException
- if impl
is null
IllegalStateException
- if an object has already been exported
with this Exporter
instanceExportException
- if a problem occurs exporting the objectStartable
public boolean unexport(boolean force)
export(java.rmi.Remote)
method such that the object can no longer
accept incoming remote calls that were possible as a result of
exporting via this exporter.
This method unexports the remote object via a call to
PortableRemoteObject.unexportObject(java.rmi.Remote)
, which only supports the
equivalent of a "forced" unexport (i.e., one in which the object is
unexported regardless of the presence of pending or in-progress calls).
Hence, this method will not consult the value of force
,
and will always attempt a "forced" unexport of the remote object,
returning true
upon normal completion.
unexport
in interface Exporter
force
- ignored value (normally indicates whether or not to
unexport the object in the presence of pending or in-progress
calls, but this exporter does not support "unforced" unexports)true
IllegalStateException
- if an object has not been exported
with this Exporter
instanceCopyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.