Java Code Examples for com.sun.corba.se.impl.util.Utility#loadTie()

The following examples show how to use com.sun.corba.se.impl.util.Utility#loadTie() . 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: PortableRemoteObject.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Deregisters a server object from the runtime, allowing the object to become
 * available for garbage collection.
 * @param obj the object to unexport.
 * @exception NoSuchObjectException if the remote object is not
 * currently exported.
 */
public void unexportObject(Remote obj)
    throws NoSuchObjectException {

    if (obj == null) {
        throw new NullPointerException("invalid argument");
    }

    if (StubAdapter.isStub(obj) ||
        obj instanceof java.rmi.server.RemoteStub) {
        throw new NoSuchObjectException(
            "Can only unexport a server object.");
    }

    Tie theTie = Util.getTie(obj);
    if (theTie != null) {
        Util.unexportObject(obj);
    } else {
        if (Utility.loadTie(obj) == null) {
            UnicastRemoteObject.unexportObject(obj,true);
        } else {
            throw new NoSuchObjectException("Object not exported.");
        }
    }
}
 
Example 2
Source File: PortableRemoteObject.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Deregisters a server object from the runtime, allowing the object to become
 * available for garbage collection.
 * @param obj the object to unexport.
 * @exception NoSuchObjectException if the remote object is not
 * currently exported.
 */
public void unexportObject(Remote obj)
    throws NoSuchObjectException {

    if (obj == null) {
        throw new NullPointerException("invalid argument");
    }

    if (StubAdapter.isStub(obj) ||
        obj instanceof java.rmi.server.RemoteStub) {
        throw new NoSuchObjectException(
            "Can only unexport a server object.");
    }

    Tie theTie = Util.getTie(obj);
    if (theTie != null) {
        Util.unexportObject(obj);
    } else {
        if (Utility.loadTie(obj) == null) {
            UnicastRemoteObject.unexportObject(obj,true);
        } else {
            throw new NoSuchObjectException("Object not exported.");
        }
    }
}
 
Example 3
Source File: PortableRemoteObject.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Deregisters a server object from the runtime, allowing the object to become
 * available for garbage collection.
 * @param obj the object to unexport.
 * @exception NoSuchObjectException if the remote object is not
 * currently exported.
 */
public void unexportObject(Remote obj)
    throws NoSuchObjectException {

    if (obj == null) {
        throw new NullPointerException("invalid argument");
    }

    if (StubAdapter.isStub(obj) ||
        obj instanceof java.rmi.server.RemoteStub) {
        throw new NoSuchObjectException(
            "Can only unexport a server object.");
    }

    Tie theTie = Util.getTie(obj);
    if (theTie != null) {
        Util.unexportObject(obj);
    } else {
        if (Utility.loadTie(obj) == null) {
            UnicastRemoteObject.unexportObject(obj,true);
        } else {
            throw new NoSuchObjectException("Object not exported.");
        }
    }
}
 
Example 4
Source File: PortableRemoteObject.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Deregisters a server object from the runtime, allowing the object to become
 * available for garbage collection.
 * @param obj the object to unexport.
 * @exception NoSuchObjectException if the remote object is not
 * currently exported.
 */
public void unexportObject(Remote obj)
    throws NoSuchObjectException {

    if (obj == null) {
        throw new NullPointerException("invalid argument");
    }

    if (StubAdapter.isStub(obj) ||
        obj instanceof java.rmi.server.RemoteStub) {
        throw new NoSuchObjectException(
            "Can only unexport a server object.");
    }

    Tie theTie = Util.getTie(obj);
    if (theTie != null) {
        Util.unexportObject(obj);
    } else {
        if (Utility.loadTie(obj) == null) {
            UnicastRemoteObject.unexportObject(obj,true);
        } else {
            throw new NoSuchObjectException("Object not exported.");
        }
    }
}
 
Example 5
Source File: PortableRemoteObject.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Deregisters a server object from the runtime, allowing the object to become
 * available for garbage collection.
 * @param obj the object to unexport.
 * @exception NoSuchObjectException if the remote object is not
 * currently exported.
 */
public void unexportObject(Remote obj)
    throws NoSuchObjectException {

    if (obj == null) {
        throw new NullPointerException("invalid argument");
    }

    if (StubAdapter.isStub(obj) ||
        obj instanceof java.rmi.server.RemoteStub) {
        throw new NoSuchObjectException(
            "Can only unexport a server object.");
    }

    Tie theTie = Util.getTie(obj);
    if (theTie != null) {
        Util.unexportObject(obj);
    } else {
        if (Utility.loadTie(obj) == null) {
            UnicastRemoteObject.unexportObject(obj,true);
        } else {
            throw new NoSuchObjectException("Object not exported.");
        }
    }
}
 
Example 6
Source File: PortableRemoteObject.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Deregisters a server object from the runtime, allowing the object to become
 * available for garbage collection.
 * @param obj the object to unexport.
 * @exception NoSuchObjectException if the remote object is not
 * currently exported.
 */
public void unexportObject(Remote obj)
    throws NoSuchObjectException {

    if (obj == null) {
        throw new NullPointerException("invalid argument");
    }

    if (StubAdapter.isStub(obj) ||
        obj instanceof java.rmi.server.RemoteStub) {
        throw new NoSuchObjectException(
            "Can only unexport a server object.");
    }

    Tie theTie = Util.getTie(obj);
    if (theTie != null) {
        Util.unexportObject(obj);
    } else {
        if (Utility.loadTie(obj) == null) {
            UnicastRemoteObject.unexportObject(obj,true);
        } else {
            throw new NoSuchObjectException("Object not exported.");
        }
    }
}
 
Example 7
Source File: PortableRemoteObject.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Deregisters a server object from the runtime, allowing the object to become
 * available for garbage collection.
 * @param obj the object to unexport.
 * @exception NoSuchObjectException if the remote object is not
 * currently exported.
 */
public void unexportObject(Remote obj)
    throws NoSuchObjectException {

    if (obj == null) {
        throw new NullPointerException("invalid argument");
    }

    if (StubAdapter.isStub(obj) ||
        obj instanceof java.rmi.server.RemoteStub) {
        throw new NoSuchObjectException(
            "Can only unexport a server object.");
    }

    Tie theTie = Util.getTie(obj);
    if (theTie != null) {
        Util.unexportObject(obj);
    } else {
        if (Utility.loadTie(obj) == null) {
            UnicastRemoteObject.unexportObject(obj,true);
        } else {
            throw new NoSuchObjectException("Object not exported.");
        }
    }
}
 
Example 8
Source File: PortableRemoteObject.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Deregisters a server object from the runtime, allowing the object to become
 * available for garbage collection.
 * @param obj the object to unexport.
 * @exception NoSuchObjectException if the remote object is not
 * currently exported.
 */
public void unexportObject(Remote obj)
    throws NoSuchObjectException {

    if (obj == null) {
        throw new NullPointerException("invalid argument");
    }

    if (StubAdapter.isStub(obj) ||
        obj instanceof java.rmi.server.RemoteStub) {
        throw new NoSuchObjectException(
            "Can only unexport a server object.");
    }

    Tie theTie = Util.getTie(obj);
    if (theTie != null) {
        Util.unexportObject(obj);
    } else {
        if (Utility.loadTie(obj) == null) {
            UnicastRemoteObject.unexportObject(obj,true);
        } else {
            throw new NoSuchObjectException("Object not exported.");
        }
    }
}
 
Example 9
Source File: PortableRemoteObject.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Returns a stub for the given server object.
 * @param obj the server object for which a stub is required. Must either be a subclass
 * of PortableRemoteObject or have been previously the target of a call to
 * {@link #exportObject}.
 * @return the most derived stub for the object.
 * @exception NoSuchObjectException if a stub cannot be located for the given server object.
 */
public Remote toStub (Remote obj)
    throws NoSuchObjectException
{
    Remote result = null;
    if (obj == null) {
        throw new NullPointerException("invalid argument");
    }

    // If the class is already an IIOP stub then return it.
    if (StubAdapter.isStub( obj )) {
        return obj;
    }

    // If the class is already a JRMP stub then return it.
    if (obj instanceof java.rmi.server.RemoteStub) {
        return obj;
    }

    // Has it been exported to IIOP?
    Tie theTie = Util.getTie(obj);

    if (theTie != null) {
        result = Utility.loadStub(theTie,null,null,true);
    } else {
        if (Utility.loadTie(obj) == null) {
            result = java.rmi.server.RemoteObject.toStub(obj);
        }
    }

    if (result == null) {
        throw new NoSuchObjectException("object not exported");
    }

    return result;
}
 
Example 10
Source File: PortableRemoteObject.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns a stub for the given server object.
 * @param obj the server object for which a stub is required. Must either be a subclass
 * of PortableRemoteObject or have been previously the target of a call to
 * {@link #exportObject}.
 * @return the most derived stub for the object.
 * @exception NoSuchObjectException if a stub cannot be located for the given server object.
 */
public Remote toStub (Remote obj)
    throws NoSuchObjectException
{
    Remote result = null;
    if (obj == null) {
        throw new NullPointerException("invalid argument");
    }

    // If the class is already an IIOP stub then return it.
    if (StubAdapter.isStub( obj )) {
        return obj;
    }

    // If the class is already a JRMP stub then return it.
    if (obj instanceof java.rmi.server.RemoteStub) {
        return obj;
    }

    // Has it been exported to IIOP?
    Tie theTie = Util.getTie(obj);

    if (theTie != null) {
        result = Utility.loadStub(theTie,null,null,true);
    } else {
        if (Utility.loadTie(obj) == null) {
            result = java.rmi.server.RemoteObject.toStub(obj);
        }
    }

    if (result == null) {
        throw new NoSuchObjectException("object not exported");
    }

    return result;
}
 
Example 11
Source File: PortableRemoteObject.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns a stub for the given server object.
 * @param obj the server object for which a stub is required. Must either be a subclass
 * of PortableRemoteObject or have been previously the target of a call to
 * {@link #exportObject}.
 * @return the most derived stub for the object.
 * @exception NoSuchObjectException if a stub cannot be located for the given server object.
 */
public Remote toStub (Remote obj)
    throws NoSuchObjectException
{
    Remote result = null;
    if (obj == null) {
        throw new NullPointerException("invalid argument");
    }

    // If the class is already an IIOP stub then return it.
    if (StubAdapter.isStub( obj )) {
        return obj;
    }

    // If the class is already a JRMP stub then return it.
    if (obj instanceof java.rmi.server.RemoteStub) {
        return obj;
    }

    // Has it been exported to IIOP?
    Tie theTie = Util.getTie(obj);

    if (theTie != null) {
        result = Utility.loadStub(theTie,null,null,true);
    } else {
        if (Utility.loadTie(obj) == null) {
            result = java.rmi.server.RemoteObject.toStub(obj);
        }
    }

    if (result == null) {
        throw new NoSuchObjectException("object not exported");
    }

    return result;
}
 
Example 12
Source File: PortableRemoteObject.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns a stub for the given server object.
 * @param obj the server object for which a stub is required. Must either be a subclass
 * of PortableRemoteObject or have been previously the target of a call to
 * {@link #exportObject}.
 * @return the most derived stub for the object.
 * @exception NoSuchObjectException if a stub cannot be located for the given server object.
 */
public Remote toStub (Remote obj)
    throws NoSuchObjectException
{
    Remote result = null;
    if (obj == null) {
        throw new NullPointerException("invalid argument");
    }

    // If the class is already an IIOP stub then return it.
    if (StubAdapter.isStub( obj )) {
        return obj;
    }

    // If the class is already a JRMP stub then return it.
    if (obj instanceof java.rmi.server.RemoteStub) {
        return obj;
    }

    // Has it been exported to IIOP?
    Tie theTie = Util.getTie(obj);

    if (theTie != null) {
        result = Utility.loadStub(theTie,null,null,true);
    } else {
        if (Utility.loadTie(obj) == null) {
            result = java.rmi.server.RemoteObject.toStub(obj);
        }
    }

    if (result == null) {
        throw new NoSuchObjectException("object not exported");
    }

    return result;
}
 
Example 13
Source File: PortableRemoteObject.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns a stub for the given server object.
 * @param obj the server object for which a stub is required. Must either be a subclass
 * of PortableRemoteObject or have been previously the target of a call to
 * {@link #exportObject}.
 * @return the most derived stub for the object.
 * @exception NoSuchObjectException if a stub cannot be located for the given server object.
 */
public Remote toStub (Remote obj)
    throws NoSuchObjectException
{
    Remote result = null;
    if (obj == null) {
        throw new NullPointerException("invalid argument");
    }

    // If the class is already an IIOP stub then return it.
    if (StubAdapter.isStub( obj )) {
        return obj;
    }

    // If the class is already a JRMP stub then return it.
    if (obj instanceof java.rmi.server.RemoteStub) {
        return obj;
    }

    // Has it been exported to IIOP?
    Tie theTie = Util.getTie(obj);

    if (theTie != null) {
        result = Utility.loadStub(theTie,null,null,true);
    } else {
        if (Utility.loadTie(obj) == null) {
            result = java.rmi.server.RemoteObject.toStub(obj);
        }
    }

    if (result == null) {
        throw new NoSuchObjectException("object not exported");
    }

    return result;
}
 
Example 14
Source File: PortableRemoteObject.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Returns a stub for the given server object.
 * @param obj the server object for which a stub is required. Must either be a subclass
 * of PortableRemoteObject or have been previously the target of a call to
 * {@link #exportObject}.
 * @return the most derived stub for the object.
 * @exception NoSuchObjectException if a stub cannot be located for the given server object.
 */
public Remote toStub (Remote obj)
    throws NoSuchObjectException
{
    Remote result = null;
    if (obj == null) {
        throw new NullPointerException("invalid argument");
    }

    // If the class is already an IIOP stub then return it.
    if (StubAdapter.isStub( obj )) {
        return obj;
    }

    // If the class is already a JRMP stub then return it.
    if (obj instanceof java.rmi.server.RemoteStub) {
        return obj;
    }

    // Has it been exported to IIOP?
    Tie theTie = Util.getTie(obj);

    if (theTie != null) {
        result = Utility.loadStub(theTie,null,null,true);
    } else {
        if (Utility.loadTie(obj) == null) {
            result = java.rmi.server.RemoteObject.toStub(obj);
        }
    }

    if (result == null) {
        throw new NoSuchObjectException("object not exported");
    }

    return result;
}
 
Example 15
Source File: PortableRemoteObject.java    From jdk1.8-source-analysis with Apache License 2.0 3 votes vote down vote up
/**
 * Makes a server object ready to receive remote calls. Note
 * that subclasses of PortableRemoteObject do not need to call this
 * method, as it is called by the constructor.
 * @param obj the server object to export.
 * @exception RemoteException if export fails.
 */
public void exportObject(Remote obj)
    throws RemoteException {

    if (obj == null) {
        throw new NullPointerException("invalid argument");
    }

    // Has this object already been exported to IIOP?

    if (Util.getTie(obj) != null) {

        // Yes, so this is an error...

        throw new ExportException (obj.getClass().getName() + " already exported");
    }

    // Can we load a Tie?

    Tie theTie = Utility.loadTie(obj);

    if (theTie != null) {

        // Yes, so export it to IIOP...

        Util.registerTarget(theTie,obj);

    } else {

        // No, so export to JRMP. If this is called twice for the
        // same object, it will throw an ExportException...

        UnicastRemoteObject.exportObject(obj);
    }
}
 
Example 16
Source File: PortableRemoteObject.java    From openjdk-jdk8u with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Makes a server object ready to receive remote calls. Note
 * that subclasses of PortableRemoteObject do not need to call this
 * method, as it is called by the constructor.
 * @param obj the server object to export.
 * @exception RemoteException if export fails.
 */
public void exportObject(Remote obj)
    throws RemoteException {

    if (obj == null) {
        throw new NullPointerException("invalid argument");
    }

    // Has this object already been exported to IIOP?

    if (Util.getTie(obj) != null) {

        // Yes, so this is an error...

        throw new ExportException (obj.getClass().getName() + " already exported");
    }

    // Can we load a Tie?

    Tie theTie = Utility.loadTie(obj);

    if (theTie != null) {

        // Yes, so export it to IIOP...

        Util.registerTarget(theTie,obj);

    } else {

        // No, so export to JRMP. If this is called twice for the
        // same object, it will throw an ExportException...

        UnicastRemoteObject.exportObject(obj);
    }
}
 
Example 17
Source File: PortableRemoteObject.java    From openjdk-8-source with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Makes a server object ready to receive remote calls. Note
 * that subclasses of PortableRemoteObject do not need to call this
 * method, as it is called by the constructor.
 * @param obj the server object to export.
 * @exception RemoteException if export fails.
 */
public void exportObject(Remote obj)
    throws RemoteException {

    if (obj == null) {
        throw new NullPointerException("invalid argument");
    }

    // Has this object already been exported to IIOP?

    if (Util.getTie(obj) != null) {

        // Yes, so this is an error...

        throw new ExportException (obj.getClass().getName() + " already exported");
    }

    // Can we load a Tie?

    Tie theTie = Utility.loadTie(obj);

    if (theTie != null) {

        // Yes, so export it to IIOP...

        Util.registerTarget(theTie,obj);

    } else {

        // No, so export to JRMP. If this is called twice for the
        // same object, it will throw an ExportException...

        UnicastRemoteObject.exportObject(obj);
    }
}
 
Example 18
Source File: PortableRemoteObject.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Makes a server object ready to receive remote calls. Note
 * that subclasses of PortableRemoteObject do not need to call this
 * method, as it is called by the constructor.
 * @param obj the server object to export.
 * @exception RemoteException if export fails.
 */
public void exportObject(Remote obj)
    throws RemoteException {

    if (obj == null) {
        throw new NullPointerException("invalid argument");
    }

    // Has this object already been exported to IIOP?

    if (Util.getTie(obj) != null) {

        // Yes, so this is an error...

        throw new ExportException (obj.getClass().getName() + " already exported");
    }

    // Can we load a Tie?

    Tie theTie = Utility.loadTie(obj);

    if (theTie != null) {

        // Yes, so export it to IIOP...

        Util.registerTarget(theTie,obj);

    } else {

        // No, so export to JRMP. If this is called twice for the
        // same object, it will throw an ExportException...

        UnicastRemoteObject.exportObject(obj);
    }
}
 
Example 19
Source File: PortableRemoteObject.java    From hottub with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Makes a server object ready to receive remote calls. Note
 * that subclasses of PortableRemoteObject do not need to call this
 * method, as it is called by the constructor.
 * @param obj the server object to export.
 * @exception RemoteException if export fails.
 */
public void exportObject(Remote obj)
    throws RemoteException {

    if (obj == null) {
        throw new NullPointerException("invalid argument");
    }

    // Has this object already been exported to IIOP?

    if (Util.getTie(obj) != null) {

        // Yes, so this is an error...

        throw new ExportException (obj.getClass().getName() + " already exported");
    }

    // Can we load a Tie?

    Tie theTie = Utility.loadTie(obj);

    if (theTie != null) {

        // Yes, so export it to IIOP...

        Util.registerTarget(theTie,obj);

    } else {

        // No, so export to JRMP. If this is called twice for the
        // same object, it will throw an ExportException...

        UnicastRemoteObject.exportObject(obj);
    }
}
 
Example 20
Source File: PortableRemoteObject.java    From TencentKona-8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Makes a server object ready to receive remote calls. Note
 * that subclasses of PortableRemoteObject do not need to call this
 * method, as it is called by the constructor.
 * @param obj the server object to export.
 * @exception RemoteException if export fails.
 */
public void exportObject(Remote obj)
    throws RemoteException {

    if (obj == null) {
        throw new NullPointerException("invalid argument");
    }

    // Has this object already been exported to IIOP?

    if (Util.getTie(obj) != null) {

        // Yes, so this is an error...

        throw new ExportException (obj.getClass().getName() + " already exported");
    }

    // Can we load a Tie?

    Tie theTie = Utility.loadTie(obj);

    if (theTie != null) {

        // Yes, so export it to IIOP...

        Util.registerTarget(theTie,obj);

    } else {

        // No, so export to JRMP. If this is called twice for the
        // same object, it will throw an ExportException...

        UnicastRemoteObject.exportObject(obj);
    }
}