Search in sources :

Example 1 with Target

use of sun.rmi.transport.Target in project jdk8u_jdk by JetBrains.

the class UnicastServerRef method exportObject.

/**
     * Export this object, create the skeleton and stubs for this
     * dispatcher.  Create a stub based on the type of the impl,
     * initialize it with the appropriate remote reference. Create the
     * target defined by the impl, dispatcher (this) and stub.
     * Export that target via the Ref.
     */
public Remote exportObject(Remote impl, Object data, boolean permanent) throws RemoteException {
    Class<?> implClass = impl.getClass();
    Remote stub;
    try {
        stub = Util.createProxy(implClass, getClientRef(), forceStubUse);
    } catch (IllegalArgumentException e) {
        throw new ExportException("remote object implements illegal remote interface", e);
    }
    if (stub instanceof RemoteStub) {
        setSkeleton(impl);
    }
    Target target = new Target(impl, this, stub, ref.getObjID(), permanent);
    ref.exportObject(target);
    hashToMethod_Map = hashToMethod_Maps.get(implClass);
    return stub;
}
Also used : Target(sun.rmi.transport.Target) RemoteStub(java.rmi.server.RemoteStub) Remote(java.rmi.Remote) ExportException(java.rmi.server.ExportException)

Aggregations

Remote (java.rmi.Remote)1 ExportException (java.rmi.server.ExportException)1 RemoteStub (java.rmi.server.RemoteStub)1 Target (sun.rmi.transport.Target)1