Examples of POA


Examples of org.omg.PortableServer.POA

    //
    // Create ORB
    //
    orb = ORB.init(new String[ 0 ], props);

    POA root = TestUtil.GetRootPOA(orb);

    //
    // Activate the RootPOA manager
    //
    POAManager rootMgr = root.the_POAManager();
    TEST(rootMgr != null);

    try
      {
        rootMgr.activate();
View Full Code Here

Examples of org.omg.PortableServer.POA

      root.create_implicit_activation_policy(org.omg.PortableServer.ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION);

    //
    // Create child POA
    //
    POA poa = null;
    try
      {
        poa = root.create_POA("poa1", rootMgr, policies);
      }
    catch (InvalidPolicy ex)
      {
        fail(ex);
        throw new RuntimeException(ex);
      }
    catch (AdapterAlreadyExists ex)
      {
        fail(ex);
        throw new RuntimeException(ex);
      }

    Test_impl2 impl = new Test_impl2(poa);

    Test t = impl._this(orb);

    Thread thr = new LongCaller(t);

    thr.start();
    impl.blockUntilCalled();

    //
    // Test: Destroy the POA while a method call is active
    //
    poa.destroy(true, true);

    //
    // The destroy call shouldn't return until the aMethod call is
    // complete
    //
View Full Code Here

Examples of org.omg.PortableServer.POA

  void uTestDestroyBlocking(ORB orb, POA root)
  {
    org.omg.CORBA.Object obj;
    Policy[] policies = new Policy[ 0 ];
    POA poa;
    POA parent;
    POA poa2;
    POA poa3;
    POAManager mgr;
    String str;

    POAManager rootMgr = root.the_POAManager();
    TEST(rootMgr != null);
View Full Code Here

Examples of org.omg.PortableServer.POA

    //
    // Create ORB
    //
    orb = ORB.init(new String[ 0 ], props);

    POA root = TestUtil.GetRootPOA(orb);

    POAManager rootMgr = root.the_POAManager();
    TEST(rootMgr != null);

    try
      {
        rootMgr.activate();
View Full Code Here

Examples of org.omg.PortableServer.POA

{
  void run(ORB orb, POA root)
  {
    org.omg.CORBA.Object obj;
    Policy[] policies = new Policy[ 0 ];
    POA poa;
    POA parent;
    POA poa2;
    POA poa3;
    POAManager mgr;
    String str;

    POAManager rootMgr = root.the_POAManager();
    TEST(rootMgr != null);

    //
    // Test: POAManager should be in HOLDING state
    //
    TEST(rootMgr.get_state() == State.HOLDING);

    //
    // Create child POA
    //
    try
      {
        poa = root.create_POA("poa1", null, policies);
      }
    catch (InvalidPolicy ex)
      {
        fail(ex);
        throw new RuntimeException(ex);
      }
    catch (AdapterAlreadyExists ex)
      {
        fail(ex);
        throw new RuntimeException(ex);
      }

    //
    // Test: POAManager should NOT be the same as the root's manager
    //
    mgr = poa.the_POAManager();
    TEST(!mgr._is_equivalent(rootMgr));

    //
    // Test: POAManager should be in HOLDING state
    //
    TEST(mgr.get_state() == State.HOLDING);

    //
    // Test: Confirm name
    //
    str = poa.the_name();
    TEST(str.equals("poa1"));

    //
    // Test: Confirm parent
    //
    parent = poa.the_parent();
    TEST(parent._is_equivalent(root));

    //
    // Test: AdapterAlreadyExists exception
    //
    try
      {
        poa2 = root.create_POA("poa1", null, policies);
        TEST(false); // create_POA should not have succeeded
      }
    catch (AdapterAlreadyExists ex)
      {
        // expected
      }
    catch (InvalidPolicy ex)
      {
        fail(ex);
        throw new RuntimeException(ex);
      }

    //
    // Test: InvalidPolicy exception
    //
    Policy[] invalidpolicies = new Policy[ 1 ];
    invalidpolicies [ 0 ] =
      root.create_servant_retention_policy(org.omg.PortableServer.ServantRetentionPolicyValue.NON_RETAIN);

    //
    // Create another child of root POA
    //
    try
      {
        poa2 = root.create_POA("poa2", rootMgr, policies);
      }
    catch (InvalidPolicy ex)
      {
        fail(ex);
        throw new RuntimeException(ex);
      }
    catch (AdapterAlreadyExists ex)
      {
        fail(ex);
        throw new RuntimeException(ex);
      }

    //
    // Test: POAManager should be the same as the root's manager
    //
    mgr = poa2.the_POAManager();
    TEST(mgr._is_equivalent(rootMgr));

    //
    // Create child of child POA
    //
    try
      {
        poa3 = poa2.create_POA("child", rootMgr, policies);
      }
    catch (InvalidPolicy ex)
      {
        fail(ex);
        throw new RuntimeException(ex);
      }
    catch (AdapterAlreadyExists ex)
      {
        fail(ex);
        throw new RuntimeException(ex);
      }

    //
    // Test: Confirm parent
    //
    parent = poa3.the_parent();
    TEST(parent._is_equivalent(poa2));

    poa.destroy(true, true);
    poa2.destroy(true, true);
  }
View Full Code Here

Examples of org.omg.PortableServer.POA

    //
    // Create ORB
    //
    orb = ORB.init(new String[ 0 ], props);

    POA root = TestUtil.GetRootPOA(orb);

    //
    // Run the test
    //
    run(orb, root);
View Full Code Here

Examples of org.omg.PortableServer.POA

    @Override
    public void start(StartContext context) throws StartException {
        log.debugf("Starting Service " + context.getController().getName().getCanonicalName());

        ORB orb = orbInjector.getValue();
        POA rootPOA = rootPOAInjector.getValue();
        POA namingPOA = namingPOAInjector.getValue();

        try {
            // initialize the static naming service variables.
            JBossNamingContext.init(orb, rootPOA);

            // create and initialize the root context instance according to the configuration.
            JBossNamingContext ns = new JBossNamingContext();
            Configuration configuration = ((org.jacorb.orb.ORB) orb).getConfiguration();
            boolean doPurge = configuration.getAttribute("jacorb.naming.purge", "off").equals("on");
            boolean noPing = configuration.getAttribute("jacorb.naming.noping", "off").equals("on");
            ns.init(namingPOA, doPurge, noPing);

            // create and activate the root context.
            byte[] rootContextId = "root".getBytes();
            namingPOA.activate_object_with_id(rootContextId, ns);
            namingService = NamingContextExtHelper.narrow(namingPOA.create_reference_with_id(rootContextId,
                    "IDL:omg.org/CosNaming/NamingContextExt:1.0"));
        } catch (Exception e) {
            throw new StartException("Failed to start the CORBA Naming Service", e);
        }
View Full Code Here

Examples of org.omg.PortableServer.POA

    @Override
    public void start(StartContext context) throws StartException {
        JacORBLogger.ROOT_LOGGER.debugServiceStartup(context.getController().getName().getCanonicalName());

        ORB orb = this.orbInjector.getOptionalValue();
        POA parentPOA = this.parentPOAInjector.getOptionalValue();

        // if an ORB has been injected, we will use the ORB.resolve_initial_references method to instantiate the POA.
        if (orb != null) {
            try {
                this.poa = POAHelper.narrow(orb.resolve_initial_references(this.poaName));
            } catch (Exception e) {
                throw JacORBMessages.MESSAGES.errorResolvingInitRef(this.poaName, e);
            }
        }
        // if a parent POA has been injected, we use it to create the policies and then the POA itself.
        else if (parentPOA != null) {
            try {
                Policy[] poaPolicies = this.createPolicies(parentPOA);
                this.poa = parentPOA.create_POA(this.poaName, null, poaPolicies);
            } catch (Exception e) {
                throw JacORBMessages.MESSAGES.errorCreatingPOAFromParent(e);
            }
        } else {
            throw JacORBMessages.MESSAGES.invalidPOACreationArgs();
View Full Code Here

Examples of org.omg.PortableServer.POA

    @Override
    public void start(StartContext context) throws StartException {
        JacORBLogger.ROOT_LOGGER.debugServiceStartup(context.getController().getName().getCanonicalName());

        ORB orb = orbInjector.getValue();
        POA rootPOA = rootPOAInjector.getValue();
        POA namingPOA = namingPOAInjector.getValue();

        try {
            // initialize the static naming service variables.
            CorbaNamingContext.init(orb, rootPOA);

            // create and initialize the root context instance according to the configuration.
            CorbaNamingContext ns = new CorbaNamingContext();
            Configuration configuration = ((org.jacorb.orb.ORB) orb).getConfiguration();
            boolean doPurge = configuration.getAttribute("jacorb.naming.purge", "off").equals("on");
            boolean noPing = configuration.getAttribute("jacorb.naming.noping", "off").equals("on");
            ns.init(namingPOA, doPurge, noPing);

            // create and activate the root context.
            byte[] rootContextId = "root".getBytes();
            namingPOA.activate_object_with_id(rootContextId, ns);
            namingService = NamingContextExtHelper.narrow(namingPOA.create_reference_with_id(rootContextId,
                    "IDL:omg.org/CosNaming/NamingContextExt:1.0"));
        } catch (Exception e) {
            throw JacORBMessages.MESSAGES.failedToStartJBossCOSNaming(e);
        }
View Full Code Here

Examples of org.omg.PortableServer.POA

    public synchronized void start(final StartContext startContext) throws StartException {

        transientPoaMap = Collections.synchronizedMap(new HashMap<String, POA>());
        persistentPoaMap = Collections.synchronizedMap(new HashMap<String, POA>());
        final POA rootPOA = this.rootPOA.getValue();

        // Policies for per-servant transient POAs
        transientPoaPolicies = new Policy[]{rootPOA.create_lifespan_policy(
                LifespanPolicyValue.TRANSIENT),
                rootPOA.create_id_assignment_policy(IdAssignmentPolicyValue.USER_ID),
                rootPOA.create_servant_retention_policy(ServantRetentionPolicyValue.NON_RETAIN),
                rootPOA.create_request_processing_policy(RequestProcessingPolicyValue.USE_DEFAULT_SERVANT),
                rootPOA.create_id_uniqueness_policy( IdUniquenessPolicyValue.MULTIPLE_ID),
        };

        // Policies for per-servant persistent POAs
        persistentPoaPolicies = new Policy[]{
                rootPOA.create_lifespan_policy(
                        LifespanPolicyValue.PERSISTENT),
                rootPOA.create_id_assignment_policy(
                        IdAssignmentPolicyValue.USER_ID),
                rootPOA.create_servant_retention_policy(
                        ServantRetentionPolicyValue.NON_RETAIN),
                rootPOA.create_request_processing_policy(
                        RequestProcessingPolicyValue.USE_DEFAULT_SERVANT),
                rootPOA.create_id_uniqueness_policy(
                        IdUniquenessPolicyValue.MULTIPLE_ID),
        };

        // Create this POARegistry's ServantRegistry implementations
        registryWithTransientPOAPerServant = new ServantRegistryWithTransientPOAPerServant();
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.