Package org.jacorb.orb.giop

Examples of org.jacorb.orb.giop.ClientConnection


                logger.warn("Could not parse SAS reply: " + e);e.printStackTrace();
            throw new org.omg.CORBA.NO_PERMISSION("SAS Could not parse SAS reply: " + e,
                                                  MinorCodes.SAS_CSS_FAILURE,
                                                  CompletionStatus.COMPLETED_MAYBE);
        }
        ClientConnection connection = ((ClientRequestInfoImpl) ri).connection;

        // process CompleteEstablishContext message
        if (contextBody.discriminator() == MTCompleteEstablishContext.value)
        {
            CompleteEstablishContext reply = contextBody.complete_msg();

            // if not stateful, remove from connection
            if (reply.client_context_id > 0 && !reply.context_stateful)
                connection.purgeSASContext(reply.client_context_id);
        }

        // process ContextError message
        if (contextBody.discriminator() == MTContextError.value)
        {
            ContextError reply = contextBody.error_msg();

            // if stateful, remove from connection
            if (reply.client_context_id > 0)
                connection.purgeSASContext(reply.client_context_id);
        }
    }
View Full Code Here


                logger.warn("Could not parse SAS reply: " + e);
            throw new org.omg.CORBA.NO_PERMISSION("SAS Could not parse SAS reply: " + e,
                                                  MinorCodes.SAS_CSS_FAILURE,
                                                  CompletionStatus.COMPLETED_MAYBE);
        }
        ClientConnection connection = ((ClientRequestInfoImpl) ri).connection;

        // process CompleteEstablishContext message
        if (contextBody.discriminator() == MTCompleteEstablishContext.value)
        {
            CompleteEstablishContext reply = contextBody.complete_msg();
            logger.debug("receive_exception MTCompleteEstablishContext: " + reply.client_context_id);

            // if not stateful, remove from connection
            if (reply.client_context_id > 0 && !reply.context_stateful)
                connection.purgeSASContext(reply.client_context_id);
        }

        // process ContextError message
        if (contextBody.discriminator() == MTContextError.value)
        {
            ContextError reply = contextBody.error_msg();
            logger.debug("receive_exception MTContextError: " + reply.client_context_id);

            // if stateful, remove from connection
            if (reply.client_context_id > 0)
                connection.purgeSASContext(reply.client_context_id);
           
            // if context not found, resend with empty context cache
            if (reply.major_status == 2) throw new org.omg.PortableInterceptor.ForwardRequest(ri.target());
        }
    }
View Full Code Here

    private boolean checkServerActive(String host, int port, byte []object_key, boolean enp_reused)
    {
        ClientConnectionManager   cm           = null;
        IIOPAddress               address      = null;
        ClientConnection          connection   = null;
        LocateRequestOutputStream lros         = null;
        LocateReplyReceiver       receiver     = null;
        LocateReplyInputStream    lris         = null;
        boolean                   result       = false;

        cm = ((org.jacorb.orb.ORB)orb).getClientConnectionManager ();
        try
        {
            address = new IIOPAddress (host, port);
            address.configure(configuration);

            IIOPProfile iiopProfile = new IIOPProfile(address, object_key);
            iiopProfile.configure(configuration);

            connection = cm.getConnection(iiopProfile);
        }
        catch(ConfigurationException e)
        {
            logger.error("Failed to configure", e);
        }

        if (this.logger.isDebugEnabled())
        {
            this.logger.debug("Pinging " + host + " / " + port);
        }

        try
        {
            lros = new LocateRequestOutputStream (object_key, connection.getId(), 2);
            receiver = new LocateReplyReceiver((org.jacorb.orb.ORB)orb);

            connection.sendRequest(
                lros,
                receiver,
                lros.getRequestId (),
                true ); // response expected
View Full Code Here

            synchronized (pending_replies)
            {
                pending_replies.add(receiver);
            }

            ClientConnection cltconn = null;
            synchronized (bind_sync)
            {
                if (ros.getConnection() != connection)
                {
                    logger.debug("invoke: RemarshalException");

                    // RequestOutputStream has been created for
                    // another connection, so try again
                    throw new RemarshalException();
                }
                cltconn = connection;
            }
            // Use the local copy of the client connection to avoid trouble
            // with something else affecting the real connection.
            cltconn.sendRequest(ros, receiver, ros.requestId(), true);
        }
        catch ( org.omg.CORBA.SystemException cfe )
        {
            logger.debug("invoke: SystemException");
View Full Code Here

     * support negotiation.
     */
    public void testDefaultCodeSets() throws Exception
    {
        ParsedIOR ior = new ParsedIOR( (ORB) orb, new IOR( "", new TaggedProfile[0] ) );
        ClientConnection connection = createClientConnection( 1, 0, ior );

        assertEquals( "Default codeSet", CodeSet.getTCSDefault().getId(), connection.getTCS().getId() );
        assertEquals( "Default wide codeset", UTF16_ID, connection.getTCSW().getId() );
    }
View Full Code Here

     */
    public void testNoCodeSetSpecified() throws Exception
    {
        ParsedIOR ior = new ParsedIOR( (ORB) orb, new IOR( "", new TaggedProfile[0] ) );

        ClientConnection connection = createClientConnection( 1, 1, ior );

        assertEquals( "Default codeSet", CodeSet.getTCSDefault().getId(), connection.getTCS().getId() );
        assertEquals( "Default wide codeset", UTF16_ID, connection.getTCSW().getId() );
    }
View Full Code Here

     * Verifies that the connection can select the supported codesets in GIOP 1.1.
     */
    public void testSelectingStandardCodeSetsFor1_1() throws Exception
    {
        ParsedIOR ior = createParsedIOR( ISO8859_1_ID, UTF16_ID );
        ClientConnection connection = createClientConnection( 1, 1, ior );

        assertEquals( "Selected codeSet", ISO8859_1_ID, connection.getTCS().getId() );
        assertEquals( "Selected wide codeset", UTF16_ID, connection.getTCSW().getId() );
    }
View Full Code Here

     * Verifies that the connection can select UTF8 for wchar in GIOP 1.2.
     */
    public void testSelectingUTF8For1_2() throws Exception
    {
        ParsedIOR ior = createParsedIOR( ISO8859_1_ID, UTF8_ID );
        ClientConnection connection = createClientConnection( 1, 2, ior );

        assertEquals( "Selected codeSet",      ISO8859_1_ID, connection.getTCS().getId() );
        assertEquals( "Selected wide codeset", UTF8_ID,      connection.getTCSW().getId() );
    }
View Full Code Here

     * Verifies that the connection can select matching conversion codesets.
     */
    public void testSelectingConversionCodeSets() throws Exception
    {
        ParsedIOR ior = createParsedIOR( 0x11111, new int[]{ISO8859_1_ID}, 0x12345, new int[]{UTF16_ID} );
        ClientConnection connection = createClientConnection( 1, 2, ior );

        assertEquals( "Selected codeSet", ISO8859_1_ID, connection.getTCS().getId() );
        assertEquals( "Selected wide codeset", UTF16_ID, connection.getTCSW().getId() );
    }
View Full Code Here

    private ClientConnection createClientConnection( int majorVersion, int minorVersion, ParsedIOR ior )
    {
        Profile profile = createMockProfile( majorVersion, minorVersion );
        ClientGIOPConnection giopConnection = new ClientGIOPConnection( null, null, null, null, null );
        ClientConnection connection = new ClientConnection( giopConnection, orb, null, profile, false );

        ior.setProfileSelector( createMockProfileSelector( profile ) );
        connection.setCodeSet( ior );
        return connection;
    }
View Full Code Here

TOP

Related Classes of org.jacorb.orb.giop.ClientConnection

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.