Examples of GIOPVersion


Examples of com.sun.corba.se.spi.ior.iiop.GIOPVersion

    }

    private void init( InputStream istr )
    {
        // First, read all of the IIOP IOR data
        GIOPVersion version = new GIOPVersion() ;
        version.read( istr ) ;
        IIOPAddress primary = new IIOPAddressImpl( istr ) ;
        byte[] key = EncapsulationUtility.readOctets( istr ) ;

        ObjectKey okey = orb.getObjectKeyFactory().create( key ) ;
        oktemp = okey.getTemplate() ;
        oid = okey.getId() ;

        proftemp = IIOPFactories.makeIIOPProfileTemplate( orb,
            version, primary ) ;

        // Handle any tagged components (if applicable)
        if (version.getMinor() > 0)
            EncapsulationUtility.readIdentifiableSequence( proftemp,
                orb.getTaggedComponentFactoryFinder(), istr ) ;

        // If there is no codebase in this IOR and there IS a
        // java.rmi.server.codebase property set, we need to
        // update the IOR with the local codebase.  Note that
        // there is only one instance of the local codebase, but it
        // can be safely shared in multiple IORs since it is immutable.
        if (uncachedGetCodeBase() == null) {
            JavaCodebaseComponent jcc = LocalCodeBaseSingletonHolder.comp ;

            if (jcc != null) {
                if (version.getMinor() > 0)
                    proftemp.add( jcc ) ;

                codebase = jcc.getURLs() ;
            }
View Full Code Here

Examples of com.sun.corba.se.spi.ior.iiop.GIOPVersion

            }

            ServiceContexts ctxts = request.getRequestServiceContexts();
            ServiceContext sc ;

            GIOPVersion giopVersion = request.getGIOPVersion();

            // we cannot depend on this since for our local case, we do not send
            // in this service context.  Can we rely on just the CodeSetServiceContext?
            // boolean rtSC = false; // Runtime ServiceContext

            boolean hasCodeSetContext = processCodeSetContext(request, ctxts);

            if (orb.subcontractDebugFlag) {
                dprint(".consumeServiceContexts: " + opAndId(request)
                       + ": GIOP version: " + giopVersion);
                dprint(".consumeServiceContexts: " + opAndId(request)
                       + ": as code set context? " + hasCodeSetContext);
            }

            sc = ctxts.get(
                SendingContextServiceContext.SERVICE_CONTEXT_ID ) ;

            if (sc != null) {
                SendingContextServiceContext scsc =
                    (SendingContextServiceContext)sc ;
                IOR ior = scsc.getIOR() ;

                try {
                    ((CorbaConnection)request.getConnection())
                        .setCodeBaseIOR(ior);
                } catch (ThreadDeath td) {
                    throw td ;
                } catch (Throwable t) {
                    throw wrapper.badStringifiedIor( t ) ;
                }
            }

            // the RTSC is sent only once during session establishment.  We
            // need to find out if the CodeBaseRef is already set.  If yes,
            // then also the rtSC flag needs to be set to true
            // this is not possible for the LocalCase since there is no
            // IIOPConnection for the LocalCase

            // used for a case where we have JDK 1.3 supporting 1.0 protocol,
            // but sending 2 service contexts, that is not normal as per
            // GIOP rules, based on above information, we figure out that we
            // are talking to the legacy ORB and set the ORB Version Accordingly.

            // this special case tell us that it is legacy SUN orb
            // and not a foreign one
            // rtSC is not available for localcase due to which this generic
            // path would fail if relying on rtSC
            //if (giopVersion.equals(GIOPVersion.V1_0) && hasCodeSetContext && rtSC)
            boolean isForeignORB = false;

            if (giopVersion.equals(GIOPVersion.V1_0) && hasCodeSetContext) {
                if (orb.subcontractDebugFlag) {
                    dprint(".consumeServiceCOntexts: " + opAndId(request)
                           + ": Determined to be an old Sun ORB");
                }
View Full Code Here

Examples of com.sun.corba.se.spi.ior.iiop.GIOPVersion

                "numberToReclaim", new Integer( 5 ),
                new Integer( 231 ), "231" ),
            ParserDataFactory.make( ORBConstants.GIOP_VERSION,
                makeGVOperation(),
                "giopVersion", GIOPVersion.DEFAULT_VERSION,
                new GIOPVersion( 2, 3 ), "2.3" ),
            ParserDataFactory.make( ORBConstants.GIOP_FRAGMENT_SIZE,
                makeFSOperation(), "giopFragmentSize",
                new Integer( ORBConstants.GIOP_DEFAULT_FRAGMENT_SIZE ),
                new Integer( 65536 ), "65536" ),
            ParserDataFactory.make( ORBConstants.GIOP_BUFFER_SIZE,
View Full Code Here

Examples of com.sun.corba.se.spi.ior.iiop.GIOPVersion

            {
                Object[] nums = (Object[])value ;
                int major = ((Integer)(nums[0])).intValue() ;
                int minor = ((Integer)(nums[1])).intValue() ;

                return new GIOPVersion( major, minor ) ;
            }
        } ;

        Operation result = OperationFactory.compose( gvHelper, gvMain );
        return result ;
View Full Code Here

Examples of com.sun.corba.se.spi.ior.iiop.GIOPVersion

    protected void addServiceContexts(CorbaMessageMediator messageMediator)
    {
        ORB orb = (ORB)messageMediator.getBroker();
        CorbaConnection c = (CorbaConnection) messageMediator.getConnection();
        GIOPVersion giopVersion = messageMediator.getGIOPVersion();

        ServiceContexts contexts = messageMediator.getRequestServiceContexts();

        addCodeSetServiceContext(c, contexts, giopVersion);
View Full Code Here

Examples of com.sun.corba.se.spi.ior.iiop.GIOPVersion

        CorbaConnection conn =
            (CorbaConnection) messageMediator.getConnection();
        IOR ior =
            ((CorbaContactInfo)messageMediator.getContactInfo())
            .getEffectiveTargetIOR();
        GIOPVersion giopVersion = messageMediator.getGIOPVersion();

        // XXX This seems to be a broken double checked locking idiom: FIX IT!

        // conn.getCodeSetContext() is null when no other requests have
        // been made on this connection to trigger code set negotation.
        if (conn != null &&
            conn.getCodeSetContext() == null &&
            !giopVersion.equals(GIOPVersion.V1_0)) {

            synchronized(conn) {
                // Double checking.  Don't let any other
                // threads use this connection until the
                // code sets are straight.
View Full Code Here

Examples of com.sun.corba.se.spi.ior.iiop.GIOPVersion

            requestEncodingVersion = buf.get(5);
            buf.put(4, (byte) 0x01);
            buf.put(5, (byte) 0x02);
        }

        GIOPVersion orbVersion = orb.getORBData().getGIOPVersion();

        if (orb.giopDebugFlag) {
            dprint(".readGIOPHeader: Message GIOP version: "
                              + buf.get(4) + '.' + buf.get(5));
            dprint(".readGIOPHeader: ORB Max GIOP Version: "
                              + orbVersion);
        }

        if ( (buf.get(4) > orbVersion.getMajor()) ||
             ( (buf.get(4) == orbVersion.getMajor()) && (buf.get(5) > orbVersion.getMinor()) )
            ) {
            // For requests, sending ORB should use the version info
            // published in the IOR or may choose to use a <= version
            // for requests. If the version is greater than published version,
            // it is an error.

            // For replies, the ORB should always receive a version it supports
            // or less, but never greater (except for MessageError)

            // ACTION : Send back a MessageError() with the the highest version
            // the server ORB supports, and close the connection.
            if ( buf.get(7) != GIOPMessageError ) {
                throw wrapper.giopVersionError( CompletionStatus.COMPLETED_MAYBE);
            }
        }

        AreFragmentsAllowed(buf.get(4), buf.get(5), buf.get(6), buf.get(7));

        // create appropriate messages types

        switch (buf.get(7)) {

        case GIOPRequest:
            if (orb.giopDebugFlag) {
                dprint(".readGIOPHeader: creating RequestMessage");
            }
            //msg = new RequestMessage(orb.giopDebugFlag);
            if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x00) ) { // 1.0
                msg = new RequestMessage_1_0(orb);
            } else if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x01) ) { // 1.1
                msg = new RequestMessage_1_1(orb);
            } else if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x02) ) { // 1.2
                msg = new RequestMessage_1_2(orb);
            } else {
                throw wrapper.giopVersionError(
                    CompletionStatus.COMPLETED_MAYBE);
            }
            break;

        case GIOPLocateRequest:
            if (orb.giopDebugFlag) {
                dprint(".readGIOPHeader: creating LocateRequestMessage");
            }
            //msg = new LocateRequestMessage(orb.giopDebugFlag);
            if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x00) ) { // 1.0
                msg = new LocateRequestMessage_1_0(orb);
            } else if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x01) ) { // 1.1
                msg = new LocateRequestMessage_1_1(orb);
            } else if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x02) ) { // 1.2
                msg = new LocateRequestMessage_1_2(orb);
            } else {
                throw wrapper.giopVersionError(
                    CompletionStatus.COMPLETED_MAYBE);
            }
            break;

        case GIOPCancelRequest:
            if (orb.giopDebugFlag) {
                dprint(".readGIOPHeader: creating CancelRequestMessage");
            }
            //msg = new CancelRequestMessage(orb.giopDebugFlag);
            if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x00) ) { // 1.0
                msg = new CancelRequestMessage_1_0();
            } else if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x01) ) { // 1.1
                msg = new CancelRequestMessage_1_1();
            } else if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x02) ) { // 1.2
                msg = new CancelRequestMessage_1_2();
            } else {
                throw wrapper.giopVersionError(
                    CompletionStatus.COMPLETED_MAYBE);
            }
            break;

        case GIOPReply:
            if (orb.giopDebugFlag) {
                dprint(".readGIOPHeader: creating ReplyMessage");
            }
            //msg = new ReplyMessage(orb.giopDebugFlag);
            if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x00) ) { // 1.0
                msg = new ReplyMessage_1_0(orb);
            } else if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x01) ) { // 1.1
                msg = new ReplyMessage_1_1(orb);
            } else if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x02) ) { // 1.2
                msg = new ReplyMessage_1_2(orb);
            } else {
                throw wrapper.giopVersionError(
                    CompletionStatus.COMPLETED_MAYBE);
            }
            break;

        case GIOPLocateReply:
            if (orb.giopDebugFlag) {
                dprint(".readGIOPHeader: creating LocateReplyMessage");
            }
            //msg = new LocateReplyMessage(orb.giopDebugFlag);
            if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x00) ) { // 1.0
                msg = new LocateReplyMessage_1_0(orb);
            } else if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x01) ) { // 1.1
                msg = new LocateReplyMessage_1_1(orb);
            } else if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x02) ) { // 1.2
                msg = new LocateReplyMessage_1_2(orb);
            } else {
                throw wrapper.giopVersionError(
                    CompletionStatus.COMPLETED_MAYBE);
            }
            break;

        case GIOPCloseConnection:
        case GIOPMessageError:
            if (orb.giopDebugFlag) {
                dprint(".readGIOPHeader: creating Message for CloseConnection or MessageError");
            }
            // REVISIT a MessageError  may contain the highest version server
            // can support. In such a case, a new request may be made with the
            // correct version or the connection be simply closed. Note the
            // connection may have been closed by the server.
            //msg = new Message(orb.giopDebugFlag);
            if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x00) ) { // 1.0
                msg = new Message_1_0();
            } else if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x01) ) { // 1.1
                msg = new Message_1_1();
            } else if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x02) ) { // 1.2
                msg = new Message_1_1();
            } else {
                throw wrapper.giopVersionError(
                    CompletionStatus.COMPLETED_MAYBE);
            }
            break;

        case GIOPFragment:
            if (orb.giopDebugFlag) {
                dprint(".readGIOPHeader: creating FragmentMessage");
            }
            //msg = new FragmentMessage(orb.giopDebugFlag);
            if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x00) ) { // 1.0
                // not possible (error checking done already)
            } else if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x01) ) { // 1.1
                msg = new FragmentMessage_1_1();
            } else if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x02) ) { // 1.2
                msg = new FragmentMessage_1_2();
            } else {
                throw wrapper.giopVersionError(
                    CompletionStatus.COMPLETED_MAYBE);
            }
            break;

        default:
            if (orb.giopDebugFlag)
                dprint(".readGIOPHeader: UNKNOWN MESSAGE TYPE: "
                       + buf.get(7));
            // unknown message type ?
            // ACTION : send MessageError and close the connection
            throw wrapper.giopVersionError(
                CompletionStatus.COMPLETED_MAYBE);
        }

        //
        // Initialize the generic GIOP header instance variables.
        //

        if ( (buf.get(4) == 0x01) && (buf.get(5) == 0x00) ) { // 1.0
            Message_1_0 msg10 = (Message_1_0) msg;
            msg10.magic = magic;
            msg10.GIOP_version = new GIOPVersion(buf.get(4), buf.get(5));
            msg10.byte_order = (buf.get(6) == LITTLE_ENDIAN_BIT);
            // 'request partitioning' not supported on GIOP version 1.0
            // so just use the default thread pool, 0.
            msg.threadPoolToUse = 0;
            msg10.message_type = buf.get(7);
            msg10.message_size = readSize(buf.get(8), buf.get(9), buf.get(10), buf.get(11),
                                          msg10.isLittleEndian()) +
                                 GIOPMessageHeaderLength;
        } else { // 1.1 & 1.2
            Message_1_1 msg11 = (Message_1_1) msg;
            msg11.magic = magic;
            msg11.GIOP_version = new GIOPVersion(buf.get(4), buf.get(5));
            msg11.flags = (byte)(buf.get(6) & TRAILING_TWO_BIT_BYTE_MASK);
            // IMPORTANT: For 'request partitioning', the thread pool to use
            //            information is stored in the leading 6 bits of byte 6.
            //
            // IMPORTANT: Request partitioning is a PROPRIETARY EXTENSION !!!
View Full Code Here

Examples of com.sun.corba.se.spi.ior.iiop.GIOPVersion

    public void write(org.omg.CORBA.portable.OutputStream ostream) {
        if (this.encodingVersion == Message.CDR_ENC_VERSION) {
            super.write(ostream);
            return;
        }
        GIOPVersion gv = this.GIOP_version; // save
        this.GIOP_version = GIOPVersion.getInstance((byte)13,
                                                    this.encodingVersion);
        super.write(ostream);
        this.GIOP_version = gv; // restore
    }
View Full Code Here

Examples of com.sun.corba.se.spi.ior.iiop.GIOPVersion

                TaggedProfileTemplate taggedProfileTemplate =
                    (TaggedProfileTemplate) iterator.next();
                taggedProfileTemplate.add(iiopAddressComponent);
            }
        } else {
            GIOPVersion version = orb.getORBData().getGIOPVersion();
            int templatePort;
            if (policies.forceZeroPort()) {
                templatePort = 0;
            } else if (policies.isTransient()) {
                templatePort = port;
            } else {
                templatePort = orb.getLegacyServerSocketManager()
                   .legacyGetPersistentServerPort(SocketInfo.IIOP_CLEAR_TEXT);
            }
            IIOPAddress addr =
                IIOPFactories.makeIIOPAddress(orb, hostname, templatePort);
            IIOPProfileTemplate iiopProfile =
                IIOPFactories.makeIIOPProfileTemplate(orb, version, addr);
            if (version.supportsIORIIOPProfileComponents()) {
                iiopProfile.add(IIOPFactories.makeCodeSetsComponent(orb));
                iiopProfile.add(IIOPFactories.makeMaxStreamFormatVersionComponent());
                RequestPartitioningPolicy rpPolicy = (RequestPartitioningPolicy)
                    policies.get_effective_policy(
                                      ORBConstants.REQUEST_PARTITIONING_POLICY);
View Full Code Here

Examples of com.sun.corba.se.spi.ior.iiop.GIOPVersion

        while( iterator.hasNext( ) ) {
            IIOPEndpointInfo element =
                (IIOPEndpointInfo) iterator.next( );
            IIOPAddress addr = IIOPFactories.makeIIOPAddress( orb, element.getHost(),
                element.getPort() );
            GIOPVersion giopVersion = GIOPVersion.getInstance( (byte)element.getMajor(),
                                             (byte)element.getMinor());
            IIOPProfileTemplate profileTemplate = null;
            if (giopVersion.equals(GIOPVersion.V1_0)) {
                profileTemplate = IIOPFactories.makeIIOPProfileTemplate(
                    orb, giopVersion, addr);
                profileList1_0.add(profileTemplate);
            } else {
                if (profileMap.get(giopVersion) == null) {
                    profileTemplate = IIOPFactories.makeIIOPProfileTemplate(
                        orb, giopVersion, addr);
                    profileMap.put(giopVersion, profileTemplate);
                } else {
                    profileTemplate = (IIOPProfileTemplate)profileMap.get(giopVersion);
                    AlternateIIOPAddressComponent iiopAddressComponent =
                                IIOPFactories.makeAlternateIIOPAddressComponent(addr);
                    profileTemplate.add(iiopAddressComponent);
                }
            }
        }

        GIOPVersion giopVersion = orb.getORBData().getGIOPVersion();
        IIOPProfileTemplate pTemplate = (IIOPProfileTemplate)profileMap.get(giopVersion);
        if (pTemplate != null) {
            iortemp.add(pTemplate); // Add profile for GIOP version used by this ORB
            profileMap.remove(giopVersion); // Now remove this value from the map
        }

        // Create a comparator that can sort in decending order (1.2, 1.1, ...)
        Comparator comp = new Comparator() {
            public int compare(Object o1, Object o2) {
                GIOPVersion gv1 = (GIOPVersion)o1;
                GIOPVersion gv2 = (GIOPVersion)o2;
                return (gv1.lessThan(gv2) ? 1 : (gv1.equals(gv2) ? 0 : -1));
            };
        };

        // Now sort using the above comparator
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.