Java Code Examples for javax.rmi.CORBA.Util#registerTarget()

The following examples show how to use javax.rmi.CORBA.Util#registerTarget() . 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 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 2
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);
    }
}
 
Example 3
Source File: PortableRemoteObject.java    From jdk8u60 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 4
Source File: PortableRemoteObject.java    From JDKSourceCode1.8 with MIT License 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 5
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 6
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 7
Source File: PortableRemoteObject.java    From openjdk-jdk9 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 8
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 9
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 10
Source File: PortableRemoteObject.java    From openjdk-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);
    }
}