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

The following examples show how to use javax.rmi.CORBA.Util#registerTarget() . 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
/**
 * 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
/**
 * 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
/**
 * 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 Project: JDKSourceCode1.8   File: PortableRemoteObject.java    License: 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
/**
 * 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
/**
 * 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
/**
 * 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
/**
 * 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
/**
 * 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
/**
 * 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);
    }
}