Package org.omg.PortableInterceptor

Examples of org.omg.PortableInterceptor.Current


/*    */
/* 77 */       Codec codec = info.codec_factory().create_codec(encoding);
/*    */
/* 80 */       Object obj = info.resolve_initial_references("PICurrent");
/*    */
/* 82 */       Current piCurrent = CurrentHelper.narrow(obj);
/*    */
/* 87 */       TxServerInterceptor.init(info.allocate_slot_id(), codec, piCurrent);
/*    */
/* 90 */       TxServerInterceptor interceptor = new TxServerInterceptor();
/* 91 */       info.add_server_request_interceptor(interceptor);
View Full Code Here


        }

        try {
            // register JTS interceptors
            // first get hold of PICurrent to allocate a slot for JTS service.
            Current pic = (Current)info.resolve_initial_references("PICurrent");

            // allocate a PICurrent slotId for the transaction service.
            int[] slotIds = new int[2];
            slotIds[0] = info.allocate_slot_id();
            slotIds[1] = info.allocate_slot_id();
View Full Code Here

    public void foo()
    {
        try
        {
            Current current = (Current) orb.resolve_initial_references( "PICurrent" );

            Any any = current.get_slot( ServerInitializer.slot_id );

            ((org.jacorb.orb.ORB)orb).getConfiguration ().getLogger("org.jacorb.test").debug ("Server extracted from PICurrent: >>" + any.extract_string() + "<<");
        }
        catch( Exception e )
        {
View Full Code Here

    }

    @Test
    public void testCTXPassingTest() throws Exception
    {
        Current current = (Current) setup.getClientOrb().resolve_initial_references( "PICurrent" );

        Any any = setup.getClientOrb().create_any();
        any.insert_string( "This is a test!" );

        current.set_slot( ClientInitializer.slot_id, any );

        server.foo();
    }
View Full Code Here

            {
                ServiceContext requestServiceContext = new ServiceContext(
                        CredentialContextId.value, new byte[0]);
                ri.add_request_service_context(requestServiceContext, false);

                Current current = getPICurrent(orb);
                current.set_slot(this.slot, orb.create_any());
            }
        }
        catch (InvalidSlot e)
        {
            throw new RuntimeException("Falha inesperada ao obter acessar slot: " + e);
View Full Code Here

        TestUtils.getLogger().debug("receive exception: " + ri.operation());
        try
        {
            if (ri.received_exception_id().equals(NO_PERMISSIONHelper.id()))
            {
                Current current = getPICurrent(orb);
                Any flag = orb.create_any();
                flag.insert_boolean(true);
                current.set_slot(this.slot, flag);
                TestUtils.getLogger().debug("doing ForwardRequest: " + ri.operation());
                throw new ForwardRequest(ri.target());
            }
        }
        catch (InvalidSlot e)
View Full Code Here

    @Test
    public void testCurrent() throws Exception
    {
        ORBMediator med1 =
            (ORBMediator) orb.resolve_initial_references(ORBMediator.INITIAL_REFERENCE_ID);
        Current curr1 = CurrentHelper.narrow(orb.resolve_initial_references("PICurrent"));

        ORB orb2 = getAnotherORB(this.orbProps);
        ORBMediator med2 =
            (ORBMediator) orb2.resolve_initial_references(ORBMediator.INITIAL_REFERENCE_ID);
        Current curr2 = CurrentHelper.narrow(orb2.resolve_initial_references("PICurrent"));

        assertFalse ("ORBs should be different", orb.equals(orb2));

        assertFalse ("Mediators object should be different!", med1.equals(med2));

        assertFalse ("Currents should be different!", curr1.equals(curr2));


        int slot1 = med1.getSlot();
        Any any1 = orb.create_any();
        String info1 = "information from Current 1";
        any1.insert_string(info1);
        curr1.set_slot(slot1, any1);

        int slot2 = med2.getSlot();
        Any anyFrom2 = curr2.get_slot(slot2);

        if (anyFrom2.type().kind().value() != TCKind._tk_null)
        {
            String extractedFrom2 = anyFrom2.extract_string();
System.out.println ("### "+extractedFrom2 +" and " + info1);
View Full Code Here

    public void foo() throws InterceptorOrderingException
    {
        try
        {
            Current current = (Current) orb.resolve_initial_references( "PICurrent" );

            Any any = current.get_slot( MyInitializer.slot_id );

            String s = any.extract_string();

            logger.debug ("TestObjectImpl.foo, extracted from PICurrent: >>" + s + "<<");
View Full Code Here

    {
        try
        {
            logger.debug("TestObjectImpl.bar called");

            Current current = (Current) orb.resolve_initial_references( "PICurrent" );

            Any any = current.get_slot( MyInitializer.slot_id );

            String s = any.extract_string();

            logger.debug ("TestObjectImpl.bar, extracted from PICurrent: >>" + s + "<<");
View Full Code Here

    @Test
    public void testCTXPassingTest() throws Exception
    {
        TestObject testObject = TestObjectHelper.narrow( server );
        Current current = (Current) setup.getClientOrb().resolve_initial_references( "PICurrent" );

        Any any = setup.getClientOrb().create_any();
        any.insert_string( "JacOrbRocks" );

        current.set_slot( MyInitializer.slot_id, any );

        testObject.foo();
    }
View Full Code Here

TOP

Related Classes of org.omg.PortableInterceptor.Current

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.