public final class ActivationExporter extends Object implements Exporter
Exporter
implementation for exporting an activatable
remote object using its underlying exporter. The proxy returned by
the export
method activates the remote object on
demand. Each instance of ActivationExporter
can export only
a single remote object.
Note when using AtomicILFactory and other Atomic Invocation Layer Factories
with ActivationExporter, the service must implement DynamicProxyCodebaseAccessor
to allow the exported proxy to be serialized.Constructor and Description |
---|
ActivationExporter(ActivationID id,
Exporter underlyingExporter)
Creates an exporter for an activatable remote object with the
specified activation identifier, underlying exporter, and a
null class loader. |
ActivationExporter(ActivationID id,
Exporter underlyingExporter,
Class proxyOrServiceImplClass) |
ActivationExporter(ActivationID id,
Exporter underlyingExporter,
ClassLoader loader)
Creates an exporter for an activatable remote object with the
specified activation identifier, underlying exporter, and
class loader.
|
Modifier and Type | Method and Description |
---|---|
Remote |
export(Remote impl)
Exports an activatable remote object.
|
boolean |
unexport(boolean force)
Unexports the activatable remote object that was previously exported
via the
export method of the underlying exporter
supplied during construction of this exporter. |
public ActivationExporter(ActivationID id, Exporter underlyingExporter)
null
class loader.id
- an activation identifierunderlyingExporter
- an exporterNullPointerException
- if id
or
underlyingExporter
is null
public ActivationExporter(ActivationID id, Exporter underlyingExporter, ClassLoader loader)
id
- an activation identifierunderlyingExporter
- an exporterloader
- the class loader to define the proxy class in, or
null
NullPointerException
- if id
or
underlyingExporter
is null
public ActivationExporter(ActivationID id, Exporter underlyingExporter, Class proxyOrServiceImplClass)
public Remote export(Remote impl) throws ExportException
impl
by calling the export
method on the
underlying exporter (supplied during construction of this exporter)
to obtain an underlying proxy. It then constructs and returns a
Proxy
instance where:
null
, the proxy's class is defined by the specified
loader. Otherwise, if a security manager exists, its checkPermission
method is invoked
with the permission RuntimePermission
{"getClassLoader")
; this invocation may
throw a SecurityException
. If the above security check
succeeds, the proxy's class is defined by the class loader of the
underlying proxy's class.
RemoteMethodControl
, the interface ProxyTrust
is not among
the interfaces implemented by the proxy):
for each superclass of the underlying proxy's class, starting
with java.lang.Object
and following with each direct
subclass to the direct superclass of the underlying proxy's class,
all of the direct superinterfaces of the given superclass that do
not appear previously in the list, in declaration order (the order
in which they are declared in the class's implements
clause), followed by
all of the direct superinterfaces of the underlying proxy's class that do not appear previously in the list, in declaration order.
ActivatableInvocationHandler
instance constructed with the ActivationID
and underlying proxy supplied during construction of
this exporter.
export
in interface Exporter
NullPointerException
IllegalStateException
ExportException
- if a problem occurs exporting
impl
or if the underlying proxy's class
is non-public
and implements
non-public
interfacespublic boolean unexport(boolean force)
export
method of the underlying exporter
supplied during construction of this exporter. Returns the result
of unexporting the remote object by calling the
unexport
method on the underlying exporter passing
force
as the argument.unexport
in interface Exporter
IllegalStateException
Copyright © 2016–2018. All rights reserved.