Java Code Examples for java.rmi.Remote#getClass()

The following examples show how to use java.rmi.Remote#getClass() . 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
Source File: UnicastServerRef.java    From openjdk-jdk8u-backup with 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 2
Source File: UnicastServerRef.java    From openjdk-8 with 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 3
Source File: UnicastServerRef.java    From openjdk-8-source with 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
Source File: UnicastServerRef.java    From hottub with 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 5
Source File: UnicastServerRef.java    From jdk8u-jdk with 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 6
Source File: UnicastServerRef.java    From openjdk-jdk9 with 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 7
Source File: UnicastServerRef.java    From openjdk-jdk8u with 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 File: UnicastServerRef.java    From jdk8u_jdk with 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
Source File: UnicastServerRef.java    From jdk8u60 with 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 10
Source File: UnicastServerRef.java    From TencentKona-8 with 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 File: UnicastServerRef.java    From dragonwell8_jdk with 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 File: ReflectiveTie.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void setTarget(Remote target)
{
    this.target = target;

    if (target == null) {
        classData = null ;
    } else {
        Class targetClass = target.getClass() ;
        classData = pm.getClassData( targetClass ) ;
    }
}
 
Example 13
Source File: ReflectiveTie.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void setTarget(Remote target)
{
    this.target = target;

    if (target == null) {
        classData = null ;
    } else {
        Class targetClass = target.getClass() ;
        classData = pm.getClassData( targetClass ) ;
    }
}
 
Example 14
Source File: ReflectiveTie.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public void setTarget(Remote target)
{
    this.target = target;

    if (target == null) {
        classData = null ;
    } else {
        Class targetClass = target.getClass() ;
        classData = pm.getClassData( targetClass ) ;
    }
}
 
Example 15
Source File: ReflectiveTie.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void setTarget(Remote target)
{
    this.target = target;

    if (target == null) {
        classData = null ;
    } else {
        Class targetClass = target.getClass() ;
        classData = pm.getClassData( targetClass ) ;
    }
}
 
Example 16
Source File: ReflectiveTie.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void setTarget(Remote target)
{
    this.target = target;

    if (target == null) {
        classData = null ;
    } else {
        Class targetClass = target.getClass() ;
        classData = pm.getClassData( targetClass ) ;
    }
}
 
Example 17
Source File: ReflectiveTie.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void setTarget(Remote target)
{
    this.target = target;

    if (target == null) {
        classData = null ;
    } else {
        Class targetClass = target.getClass() ;
        classData = pm.getClassData( targetClass ) ;
    }
}
 
Example 18
Source File: ReflectiveTie.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void setTarget(Remote target)
{
    this.target = target;

    if (target == null) {
        classData = null ;
    } else {
        Class targetClass = target.getClass() ;
        classData = pm.getClassData( targetClass ) ;
    }
}
 
Example 19
Source File: ReflectiveTie.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void setTarget(Remote target)
{
    this.target = target;

    if (target == null) {
        classData = null ;
    } else {
        Class targetClass = target.getClass() ;
        classData = pm.getClassData( targetClass ) ;
    }
}
 
Example 20
Source File: ReflectiveTie.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void setTarget(Remote target)
{
    this.target = target;

    if (target == null) {
        classData = null ;
    } else {
        Class targetClass = target.getClass() ;
        classData = pm.getClassData( targetClass ) ;
    }
}