net.jini.security.proxytrust.ProxyTrustExporter.export()
Exports the specified main remote object and returns a dynamic proxy for the object. The main remote object must be an instance of {@link ServerProxyTrust}. The main remote object is exported using the main exporter (specified at the construction of this exporter), returning a proxy called the main proxy. The main proxy must be an instance of both {@link RemoteMethodControl} and{@link TrustEquivalence}, and if the main proxy's class is not public
, the direct superinterfaces of that class and all of its superclasses must be public
. A bootstrap remote object that is an instance of {@link ProxyTrust} is created andexported using the bootstrap exporter (also specified at the construction of this exporter), returning a proxy called the bootstrap proxy. The bootstrap proxy must be an instance of ProxyTrust
, RemoteMethodControl
, and TrustEquivalence
. The bootstrap remote object will remain reachable as long as the main remote object is reachable and the {@link #unexport unexport} method of this exporter has not returnedtrue
. A {@link Proxy} class is generated that implementsthe direct superinterfaces of the main proxy's class and all of its superclasses, in the following order: the direct superinterfaces of a class immediately follow the direct superinterfaces of its direct superclass; the direct superinterfaces of a class are in declaration order (the order in which they are declared in the class's implements
clause); and if an interface appears more than once, only the first instance is retained. If a non-null
class loader was specified at the construction of this exporter, the generated class is defined by that class loader, otherwise it is defined by the class loader of the main proxy's class. The dynamic proxy returned by this method is an instance of that generated class, containing a {@link ProxyTrustInvocationHandler} instance created withthe main proxy and the bootstrap proxy.
@throws ExportException if the export of either remote object throwsExportException
, or if the export the bootstrap remote object throws IllegalArgumentException
, or if the main proxy is not an instance of both RemoteMethodControl
and TrustEquivalence
, or if the main proxy's class is not public
and it or a superclass has a non-public
direct superinterface, or if the bootstrap proxy is not an instance of ProxyTrust
, RemoteMethodControl
, and TrustEquivalence
, or if any of the superinterfaces of the main proxy's class are not visible through the class loader specified at the construction of this exporter
@throws IllegalArgumentException if the specified remote object is notan instance of ServerProxyTrust
, or if the export of the main remote object throws IllegalArgumentException
@throws IllegalStateException if the export of either remote objectthrows IllegalStateException
@throws SecurityException if a non-null
class loader wasnot specified at the construction of this exporter and the calling context does not have {@link RuntimePermission}("getClassLoader")
permission