Java Code Examples for sun.rmi.transport.Target

The following examples show how to use sun.rmi.transport.Target. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
/**
 * 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;
}
 
Example 2
/**
 * 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;
}
 
Example 3
Source Project: jdk8u60   Source File: UnicastServerRef.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 4
/**
 * 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;
}
 
Example 5
/**
 * 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;
}
 
Example 6
/**
 * 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;
}
 
Example 7
Source Project: jdk8u-jdk   Source File: UnicastServerRef.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 8
Source Project: hottub   Source File: UnicastServerRef.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 9
/**
 * 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;
}
 
Example 10
Source Project: openjdk-8   Source File: UnicastServerRef.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 11
Source Project: jdk8u_jdk   Source File: UnicastServerRef.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 12
Source Project: jdk8u-jdk   Source File: UnicastServerRef.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 13
/**
 * 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;
}
 
Example 14
Source Project: dragonwell8_jdk   Source File: TCPTransport.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Export the object so that it can accept incoming calls.
 */
public void exportObject(Target target) throws RemoteException {
    /*
     * Ensure that a server socket is listening, and count this
     * export while synchronized to prevent the server socket from
     * being closed due to concurrent unexports.
     */
    synchronized (this) {
        listen();
        exportCount++;
    }

    /*
     * Try to add the Target to the exported object table; keep
     * counting this export (to keep server socket open) only if
     * that succeeds.
     */
    boolean ok = false;
    try {
        super.exportObject(target);
        ok = true;
    } finally {
        if (!ok) {
            synchronized (this) {
                decrementExportCount();
            }
        }
    }
}
 
Example 15
/**
 * Checks for objects that are instances of java.rmi.Remote
 * that need to be serialized as proxy objects.
 */
protected final Object replaceObject(Object obj) throws IOException {
    if ((obj instanceof Remote) && !(obj instanceof RemoteStub)) {
        Target target = ObjectTable.getTarget((Remote) obj);
        if (target != null) {
            return target.getStub();
        }
    }
    return obj;
}
 
Example 16
Source Project: TencentKona-8   Source File: TCPTransport.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Export the object so that it can accept incoming calls.
 */
public void exportObject(Target target) throws RemoteException {
    /*
     * Ensure that a server socket is listening, and count this
     * export while synchronized to prevent the server socket from
     * being closed due to concurrent unexports.
     */
    synchronized (this) {
        listen();
        exportCount++;
    }

    /*
     * Try to add the Target to the exported object table; keep
     * counting this export (to keep server socket open) only if
     * that succeeds.
     */
    boolean ok = false;
    try {
        super.exportObject(target);
        ok = true;
    } finally {
        if (!ok) {
            synchronized (this) {
                decrementExportCount();
            }
        }
    }
}
 
Example 17
/**
 * Checks for objects that are instances of java.rmi.Remote
 * that need to be serialized as proxy objects.
 */
protected final Object replaceObject(Object obj) throws IOException {
    if ((obj instanceof Remote) && !(obj instanceof RemoteStub)) {
        Target target = ObjectTable.getTarget((Remote) obj);
        if (target != null) {
            return target.getStub();
        }
    }
    return obj;
}
 
Example 18
Source Project: jdk8u60   Source File: TCPTransport.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Export the object so that it can accept incoming calls.
 */
public void exportObject(Target target) throws RemoteException {
    /*
     * Ensure that a server socket is listening, and count this
     * export while synchronized to prevent the server socket from
     * being closed due to concurrent unexports.
     */
    synchronized (this) {
        listen();
        exportCount++;
    }

    /*
     * Try to add the Target to the exported object table; keep
     * counting this export (to keep server socket open) only if
     * that succeeds.
     */
    boolean ok = false;
    try {
        super.exportObject(target);
        ok = true;
    } finally {
        if (!ok) {
            synchronized (this) {
                decrementExportCount();
            }
        }
    }
}
 
Example 19
Source Project: jdk8u60   Source File: MarshalOutputStream.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Checks for objects that are instances of java.rmi.Remote
 * that need to be serialized as proxy objects.
 */
protected final Object replaceObject(Object obj) throws IOException {
    if ((obj instanceof Remote) && !(obj instanceof RemoteStub)) {
        Target target = ObjectTable.getTarget((Remote) obj);
        if (target != null) {
            return target.getStub();
        }
    }
    return obj;
}
 
Example 20
Source Project: openjdk-jdk8u   Source File: TCPTransport.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Export the object so that it can accept incoming calls.
 */
public void exportObject(Target target) throws RemoteException {
    /*
     * Ensure that a server socket is listening, and count this
     * export while synchronized to prevent the server socket from
     * being closed due to concurrent unexports.
     */
    synchronized (this) {
        listen();
        exportCount++;
    }

    /*
     * Try to add the Target to the exported object table; keep
     * counting this export (to keep server socket open) only if
     * that succeeds.
     */
    boolean ok = false;
    try {
        super.exportObject(target);
        ok = true;
    } finally {
        if (!ok) {
            synchronized (this) {
                decrementExportCount();
            }
        }
    }
}
 
Example 21
/**
 * Checks for objects that are instances of java.rmi.Remote
 * that need to be serialized as proxy objects.
 */
protected final Object replaceObject(Object obj) throws IOException {
    if ((obj instanceof Remote) && !(obj instanceof RemoteStub)) {
        Target target = ObjectTable.getTarget((Remote) obj);
        if (target != null) {
            return target.getStub();
        }
    }
    return obj;
}
 
Example 22
/**
 * Export the object so that it can accept incoming calls.
 */
public void exportObject(Target target) throws RemoteException {
    /*
     * Ensure that a server socket is listening, and count this
     * export while synchronized to prevent the server socket from
     * being closed due to concurrent unexports.
     */
    synchronized (this) {
        listen();
        exportCount++;
    }

    /*
     * Try to add the Target to the exported object table; keep
     * counting this export (to keep server socket open) only if
     * that succeeds.
     */
    boolean ok = false;
    try {
        super.exportObject(target);
        ok = true;
    } finally {
        if (!ok) {
            synchronized (this) {
                decrementExportCount();
            }
        }
    }
}
 
Example 23
/**
 * Checks for objects that are instances of java.rmi.Remote
 * that need to be serialized as proxy objects.
 */
protected final Object replaceObject(Object obj) throws IOException {
    if ((obj instanceof Remote) && !(obj instanceof RemoteStub)) {
        Target target = ObjectTable.getTarget((Remote) obj);
        if (target != null) {
            return target.getStub();
        }
    }
    return obj;
}
 
Example 24
Source Project: openjdk-jdk9   Source File: TCPTransport.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Export the object so that it can accept incoming calls.
 */
public void exportObject(Target target) throws RemoteException {
    /*
     * Ensure that a server socket is listening, and count this
     * export while synchronized to prevent the server socket from
     * being closed due to concurrent unexports.
     */
    synchronized (this) {
        listen();
        exportCount++;
    }

    /*
     * Try to add the Target to the exported object table; keep
     * counting this export (to keep server socket open) only if
     * that succeeds.
     */
    boolean ok = false;
    try {
        super.exportObject(target);
        ok = true;
    } finally {
        if (!ok) {
            synchronized (this) {
                decrementExportCount();
            }
        }
    }
}
 
Example 25
/**
 * Checks for objects that are instances of java.rmi.Remote
 * that need to be serialized as proxy objects.
 */
@SuppressWarnings("deprecation")
protected final Object replaceObject(Object obj) throws IOException {
    if ((obj instanceof Remote) && !(obj instanceof RemoteStub)) {
        Target target = ObjectTable.getTarget((Remote) obj);
        if (target != null) {
            return target.getStub();
        }
    }
    return obj;
}
 
Example 26
Source Project: jdk8u-jdk   Source File: TCPTransport.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Export the object so that it can accept incoming calls.
 */
public void exportObject(Target target) throws RemoteException {
    /*
     * Ensure that a server socket is listening, and count this
     * export while synchronized to prevent the server socket from
     * being closed due to concurrent unexports.
     */
    synchronized (this) {
        listen();
        exportCount++;
    }

    /*
     * Try to add the Target to the exported object table; keep
     * counting this export (to keep server socket open) only if
     * that succeeds.
     */
    boolean ok = false;
    try {
        super.exportObject(target);
        ok = true;
    } finally {
        if (!ok) {
            synchronized (this) {
                decrementExportCount();
            }
        }
    }
}
 
Example 27
/**
 * Checks for objects that are instances of java.rmi.Remote
 * that need to be serialized as proxy objects.
 */
protected final Object replaceObject(Object obj) throws IOException {
    if ((obj instanceof Remote) && !(obj instanceof RemoteStub)) {
        Target target = ObjectTable.getTarget((Remote) obj);
        if (target != null) {
            return target.getStub();
        }
    }
    return obj;
}
 
Example 28
Source Project: hottub   Source File: TCPTransport.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Export the object so that it can accept incoming calls.
 */
public void exportObject(Target target) throws RemoteException {
    /*
     * Ensure that a server socket is listening, and count this
     * export while synchronized to prevent the server socket from
     * being closed due to concurrent unexports.
     */
    synchronized (this) {
        listen();
        exportCount++;
    }

    /*
     * Try to add the Target to the exported object table; keep
     * counting this export (to keep server socket open) only if
     * that succeeds.
     */
    boolean ok = false;
    try {
        super.exportObject(target);
        ok = true;
    } finally {
        if (!ok) {
            synchronized (this) {
                decrementExportCount();
            }
        }
    }
}
 
Example 29
Source Project: hottub   Source File: MarshalOutputStream.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Checks for objects that are instances of java.rmi.Remote
 * that need to be serialized as proxy objects.
 */
protected final Object replaceObject(Object obj) throws IOException {
    if ((obj instanceof Remote) && !(obj instanceof RemoteStub)) {
        Target target = ObjectTable.getTarget((Remote) obj);
        if (target != null) {
            return target.getStub();
        }
    }
    return obj;
}
 
Example 30
/**
 * Export the object so that it can accept incoming calls.
 */
public void exportObject(Target target) throws RemoteException {
    /*
     * Ensure that a server socket is listening, and count this
     * export while synchronized to prevent the server socket from
     * being closed due to concurrent unexports.
     */
    synchronized (this) {
        listen();
        exportCount++;
    }

    /*
     * Try to add the Target to the exported object table; keep
     * counting this export (to keep server socket open) only if
     * that succeeds.
     */
    boolean ok = false;
    try {
        super.exportObject(target);
        ok = true;
    } finally {
        if (!ok) {
            synchronized (this) {
                decrementExportCount();
            }
        }
    }
}