Package javax.rmi.CORBA

Examples of javax.rmi.CORBA.Tie


        rootPOA.the_POAManager().activate();

        RMI_testImpl impl = new RMI_testImpl();
        impl.ego = "Server side object";
        Tie tie = Util.getTie(impl);

        org.omg.CORBA.Object object = rootPOA.servant_to_reference((Servant) tie);

        String ior = server_orb.object_to_string(object);
View Full Code Here


                    } else {
                        throw new IOException("Unkown primitive type: " + type);
                    }
                } else {
                    if (obj instanceof PortableRemoteObject && obj instanceof Remote) {
                        Tie tie = javax.rmi.CORBA.Util.getTie((Remote) obj);
                        if (tie == null) {
                            throw new IOException("Unable to serialize PortableRemoteObject; object has not been exported: " + obj);
                        }
                        ORB orb = getORB();
                        tie.orb(orb);
                        obj = PortableRemoteObject.toStub((Remote) obj);
                    }
                    out.write(L);
                    out.writeObject(type);
                    out.writeObject(obj);
View Full Code Here

    poa.the_POAManager().activate();
   
    // Create a SampleImpl and bind it to the POA
    Sample sample = new SampleImpl();
   
    Tie tie = javax.rmi.CORBA.Util.getTie(sample);
   
    byte[] id = poa.activate_object((Servant) tie);
    org.omg.CORBA.Object obj = poa.create_reference_with_id(id, ((Servant)tie)._all_interfaces(poa, id)[0]);
   
    // Write a IOR to a file so the client can obtain a reference to the Sample
View Full Code Here

        if (stub instanceof DynamicStub)
            return ((DynamicStub)stub).getDelegate() ;
        else if (stub instanceof ObjectImpl)
            return ((ObjectImpl)stub)._get_delegate() ;
        else if (stub instanceof Tie) {
            Tie tie = (Tie)stub ;
            org.omg.CORBA.Object ref = activateTie( tie ) ;
            return getDelegate( ref ) ;
        } else
            throw wrapper.getDelegateRequiresStub() ;
    }
View Full Code Here

            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...
View Full Code Here

        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) {
View Full Code Here

            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);
View Full Code Here

        try {
            if (StubAdapter.isStub( source )) {
                orb = StubAdapter.getORB( source ) ;
            } else {
                // Is this a servant that was exported to iiop?
                Tie tie = Util.getTie(source);
                if (tie == null) {
                    /* loadTie always succeeds for dynamic RMI-IIOP
                    // No, can we get a tie for it?  If not,
                    // assume that source is a JRMP object...
                    if (Utility.loadTie(source) != null) {
                        // Yes, so it is an iiop object which
                        // has not been exported...
                        throw new RemoteException(
                            "'source' object not exported");
                    }
                    */
                } else {
                    orb = tie.orb();
                }
            }
        } catch (SystemException e) {
            throw new RemoteException("'source' object not connected", e );
        }

        boolean targetIsIIOP = false ;
        Tie targetTie = null;
        if (StubAdapter.isStub(target)) {
            targetIsIIOP = true;
        } else {
            targetTie = Util.getTie(target);
            if (targetTie != null) {
                targetIsIIOP = true;
            } else {
                /* loadTie always succeeds for dynamic RMI-IIOP
                if (Utility.loadTie(target) != null) {
                    throw new RemoteException("'target' servant not exported");
                }
                */
            }
        }

        if (!targetIsIIOP) {
            // Yes. Do we have an ORB from the source object?
            // If not, we're done - there is nothing to do to
            // connect a JRMP object. If so, it is an error because
            // the caller mixed JRMP and IIOP...
            if (orb != null) {
                throw new RemoteException(
                    "'source' object exported to IIOP, 'target' is JRMP");
            }
        } else {
            // The target object is IIOP. Make sure we have a
            // valid ORB from the source object...
            if (orb == null) {
                throw new RemoteException(
                    "'source' object is JRMP, 'target' is IIOP");
            }

            // And, finally, connect it up...
            try {
                if (targetTie != null) {
                    // Is the tie already connected?
                    try {
                        ORB existingOrb = targetTie.orb();

                        // Yes. Is it the same orb?
                        if (existingOrb == orb) {

                            // Yes, so nothing to do...
                            return;
                        } else {
                            // No, so this is an error...
                            throw new RemoteException(
                                "'target' object was already connected");
                        }
                    } catch (SystemException e) {}

                    // No, so do it...
                    targetTie.orb(orb);
                } else {
                    StubAdapter.connect( target, orb ) ;
                }
            } catch (SystemException e) {

View Full Code Here

     */
    public void unexportObject(java.rmi.Remote target)
        throws java.rmi.NoSuchObjectException
    {
        synchronized (exportedServants) {
            Tie cachedTie = lookupTie(target);
            if (cachedTie != null) {
                exportedServants.remove(target);
                Utility.purgeStubForTie(cachedTie);
                Utility.purgeTieAndServant(cachedTie);
                try {
View Full Code Here

    /**
     * An unsynchronized version of getTie() for internal use.
     */
    private static Tie lookupTie (Remote target)
    {
        Tie result = (Tie)exportedServants.get(target);
        if (result == null && target instanceof Tie) {
            if (exportedServants.contains(target)) {
                result = (Tie)target;
            }
        }
View Full Code Here

TOP

Related Classes of javax.rmi.CORBA.Tie

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.