Examples of Delegate


Examples of org.omg.CORBA.portable.Delegate

      return (remotePoaControl) obj;
    else if (!obj._is_a(id()))
      throw new BAD_PARAM();
    else
      {
        Delegate delegate = ((ObjectImpl) obj)._get_delegate();
        poa_remotePoaControlStub stub = new poa_remotePoaControlStub();
        stub._set_delegate(delegate);
        return stub;
      }
  }
View Full Code Here

Examples of org.omg.CORBA.portable.Delegate

      return (Greetings) obj;
    else if (!obj._is_a(id()))
      throw new BAD_PARAM();
    else
      {
        Delegate delegate = ((ObjectImpl) obj)._get_delegate();
        return new _GreetingsStub(delegate);
      }
  }
View Full Code Here

Examples of org.omg.CORBA.portable.Delegate

        // If ref is a local object, it is not a Stub!
        if (!StubAdapter.isStub(ref))
            return false ;

        Delegate del = StubAdapter.getDelegate(ref) ;
        if (del == null)
            return false ;

        // Optimize the x.is_equivalent( x ) case
        if (del == this)
View Full Code Here

Examples of org.omg.CORBA.portable.Delegate

        if (!StubAdapter.isStub(other)) {
            return false;
        }

        Delegate delegate = StubAdapter.getDelegate( other ) ;
        if (delegate == null)
            return false ;

        if (delegate instanceof CorbaClientDelegateImpl) {
            CorbaClientDelegateImpl otherDel = (CorbaClientDelegateImpl)
View Full Code Here

Examples of org.omg.CORBA.portable.Delegate

    * @param orb The ORB to which we connect the stub.
    */
    public static StubIORImpl connect( StubIORImpl ior, org.omg.CORBA.Object proxy,
        org.omg.CORBA.portable.ObjectImpl stub, ORB orb ) throws RemoteException
    {
        Delegate del = null ;

        try {
            try {
                del = StubAdapter.getDelegate( stub );

                if (del.orb(stub) != orb)
                    throw wrapper.connectWrongOrb() ;
            } catch (org.omg.CORBA.BAD_OPERATION err) {
                if (ior == null) {
                    // No IOR, can we get a Tie for this stub?
                    Tie tie = (javax.rmi.CORBA.Tie) Utility.getAndForgetTie(proxy);
View Full Code Here

Examples of org.omg.CORBA.portable.Delegate

    }

    private boolean isLocal()
    {
        boolean result = false ;
        Delegate delegate = StubAdapter.getDelegate( stub ) ;

        if (delegate instanceof CorbaClientDelegate) {
            CorbaClientDelegate cdel = (CorbaClientDelegate)delegate ;
            ContactInfoList cil = cdel.getContactInfoList() ;
            if (cil instanceof CorbaContactInfoList) {
View Full Code Here

Examples of org.omg.CORBA.portable.Delegate

        String giopMethodName = classData.getIDLNameTranslator().
            getIDLName( method ;
        DynamicMethodMarshaller dmm =
            pm.getDynamicMethodMarshaller( method ) ;

        Delegate delegate = null ;
        try {
            delegate = StubAdapter.getDelegate( stub ) ;
        } catch (SystemException ex) {
            throw Util.mapSystemException(ex) ;
        }

        if (!isLocal()) {
            try {
                org.omg.CORBA_2_3.portable.InputStream in = null ;
                try {
                    // create request
                    org.omg.CORBA_2_3.portable.OutputStream out =
                        (org.omg.CORBA_2_3.portable.OutputStream)
                        delegate.request( stub, giopMethodName, true);

                    // marshal arguments
                    dmm.writeArguments( out, args ) ;

                    // finish invocation
                    in = (org.omg.CORBA_2_3.portable.InputStream)
                        delegate.invoke( stub, out);

                    // unmarshal result
                    return dmm.readResult( in ) ;
                } catch (ApplicationException ex) {
                    throw dmm.readException( ex ) ;
                } catch (RemarshalException ex) {
                    return invoke( proxy, method, args ) ;
                } finally {
                    delegate.releaseReply( stub, in );
                }
            } catch (SystemException ex) {
                throw Util.mapSystemException(ex) ;
            }
        } else {
            // local branch
            ORB orb = (ORB)delegate.orb( stub ) ;
            ServantObject so = delegate.servant_preinvoke( stub, giopMethodName,
                method.getDeclaringClass() );
            if (so == null) {
                return invoke( stub, method, args ) ;
            }
            try {
                Object[] copies = dmm.copyArguments( args, orb ) ;

                if (!method.isAccessible()) {
                    // Make sure that we can invoke a method from a normally
                    // inaccessible package, as this reflective class must always
                    // be able to invoke a non-public method.
                    AccessController.doPrivileged(new PrivilegedAction() {
                        public Object run() {
                            method.setAccessible( true ) ;
                            return null ;
                        }
                    } ) ;
                }

                Object result = method.invoke( so.servant, copies ) ;

                return dmm.copyResult( result, orb ) ;
            } catch (InvocationTargetException ex) {
                Throwable mex = ex.getCause() ;
                // mex should never be null, as null cannot be thrown
                Throwable exCopy = (Throwable)Util.copyObject(mex,orb);
                if (dmm.isDeclaredException( exCopy ))
                    throw exCopy ;
                else
                    throw Util.wrapException(exCopy);
            } catch (Throwable thr) {
                if (thr instanceof ThreadDeath)
                    throw (ThreadDeath)thr ;

                // This is not a user thrown exception from the
                // method call, so don't copy it.  This is either
                // an error or a reflective invoke exception.
                throw Util.wrapException( thr ) ;
            } finally {
                delegate.servant_postinvoke( stub, so);
            }
        }
    }
View Full Code Here

Examples of org.omg.CORBA.portable.Delegate

                                    remoteCodebase,onlyMostDerived);
                        }
                    } else {
                        // Use the cached stub. Is the delegate set?
                        try {
                            Delegate stubDel = StubAdapter.getDelegate(
                                entry.stub ) ;
                        } catch (Exception e2) {
                            // No, so set it if we can...
                            try {
                                Delegate del = StubAdapter.getDelegate(
                                    tie ) ;
                                StubAdapter.setDelegate( entry.stub,
                                    del ) ;
                            } catch (Exception e) {}
                        }
View Full Code Here

Examples of org.omg.CORBA.portable.Delegate

            // Stub == null, so cache the miss...
            tieToStubCache.put(tie,CACHE_MISS);
        } else {
            if (tieIsStub) {
                try {
                    Delegate del = StubAdapter.getDelegate( tie ) ;
                    StubAdapter.setDelegate( stub, del ) ;
                } catch( Exception e1 ) {
                    // The tie does not have a delegate set, so stash
                    // this tie away using the stub as a key so that
                    // later, when the stub is connected, we can find
                    // and connect the tie as well...

                    synchronized (stubToTieCache) {
                        stubToTieCache.put(stub,tie);
                    }
                }
            } else {
                // Tie extends Servant
                try {
                    Delegate delegate = StubAdapter.getDelegate( tie ) ;
                    StubAdapter.setDelegate( stub, delegate ) ;
                } catch( org.omg.CORBA.BAD_INV_ORDER bad) {
                    synchronized (stubToTieCache) {
                        stubToTieCache.put(stub,tie);
                    }
View Full Code Here

Examples of org.omg.CORBA.portable.Delegate

            String codebase = null;
            try {
                // We can't assume that narrowFrom is a CORBA_2_3 stub, yet
                // it may have a 2_3 Delegate that provides a codebase.  Swallow
                // the ClassCastException otherwise.
                Delegate delegate = StubAdapter.getDelegate( narrowFrom ) ;
                codebase = ((org.omg.CORBA_2_3.portable.Delegate)delegate).
                    get_codebase(narrowFrom);

            } catch (ClassCastException e) {
                wrapper.classCastExceptionInLoadStub( e ) ;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.