Package org.omg.PortableServer

Examples of org.omg.PortableServer.POA


  private CorbaReceiverImpl(EventListener eventListener,
      OrbManagement orbManagement, Properties properties, int cd,
      ResponseMonitor responseMonitor) throws ConnectionException {
    log.debug("ClientCallbackImpl constructor");
    ORB orb = orbManagement.getOrb();
    POA poa = orbManagement.getRootPoa();
    this.eventListener = eventListener;
    this.cd = cd;
    this.responseMonitor = responseMonitor;

    try {
      try {
        Policy[] policies = new Policy[0];
        m_default_poa = poa.create_POA("TODO", poa.the_POAManager(),
            policies);
      } catch (AdapterAlreadyExists e) {
        m_default_poa = poa.find_POA("TODO", true);
      }
      log.debug("JABSession createCallbackObject");
      activate_object = m_default_poa.activate_object(this);
      log.debug("activated this " + this);
View Full Code Here


    /** Use implicit activation to get an object reference for the servant.
     */
    public static org.omg.CORBA.Object activateServant( Servant servant )
    {
        POA poa = servant._default_POA() ;
        org.omg.CORBA.Object ref = null ;

        try {
            ref = poa.servant_to_reference( servant ) ;
        } catch (ServantNotActive sna) {
            throw wrapper.getDelegateServantNotActive( sna ) ;
        } catch (WrongPolicy wp) {
            throw wrapper.getDelegateWrongPolicy( wp ) ;
        }

        // Make sure that the POAManager is activated if no other
        // POAManager state management has taken place.
        POAManager mgr = poa.the_POAManager() ;
        if (mgr instanceof POAManagerImpl) {
            POAManagerImpl mgrImpl = (POAManagerImpl)mgr ;
            mgrImpl.implicitActivation() ;
        }

View Full Code Here

            int size = coll.size() ;
            POA[] result = new POA[ size ] ;
            int index = 0 ;
            Iterator iter = coll.iterator() ;
            while (iter.hasNext()) {
                POA poa = (POA)(iter.next()) ;
                result[ index++ ] = poa ;
            }

            return result ;
        } finally {
View Full Code Here

                    getInitialContext().lookup(StatelessSessionHome.JNDI_NAME),
                    StatelessSessionHome.class);
      StatelessSession session = home.create();
      //----------------------------------------------------------------------
      final ORB orb = ORB.init(new String[0], System.getProperties());
      POA poa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
      IdlInterfaceServant servant = new IdlInterfaceServant();
      org.omg.CORBA.Object original = servant._this_object(orb);
      poa.the_POAManager().activate();
      new Thread(
         new Runnable() {
            public void run() {
               orb.run();
            }
View Full Code Here

                    getInitialContext().lookup(StatelessSessionHome.JNDI_NAME),
                    StatelessSessionHome.class);
      StatelessSession session = home.create();
      //----------------------------------------------------------------------
      final ORB orb = ORB.init(new String[0], System.getProperties());
      POA poa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
      IdlInterfaceServant servant = new IdlInterfaceServant();
      org.omg.CORBA.Object obj = servant._this_object(orb);
      poa.the_POAManager().activate();
      new Thread(
         new Runnable() {
            public void run() {
               orb.run();
            }
View Full Code Here

    /** Use implicit activation to get an object reference for the servant.
     */
    public static org.omg.CORBA.Object activateServant( Servant servant )
    {
  POA poa = servant._default_POA() ;
  org.omg.CORBA.Object ref = null ;

  try {
      ref = poa.servant_to_reference( servant ) ;
  } catch (ServantNotActive sna) {
      throw wrapper.getDelegateServantNotActive( sna ) ;
  } catch (WrongPolicy wp) {
      throw wrapper.getDelegateWrongPolicy( wp ) ;
  }

  // Make sure that the POAManager is activated if no other
  // POAManager state management has taken place.
  POAManager mgr = poa.the_POAManager() ;
  if (mgr instanceof POAManagerImpl) {
      POAManagerImpl mgrImpl = (POAManagerImpl)mgr ;
      mgrImpl.implicitActivation() ;
  }

View Full Code Here

    {
        NamingSystemException wrapper = NamingSystemException.get( orb,
            CORBALogDomains.NAMING ) ;

        try {
            POA rootPOA = (POA) orb.resolve_initial_references(
                ORBConstants.ROOT_POA_NAME );
            rootPOA.the_POAManager().activate();

            int i = 0;
            Policy[] poaPolicy = new Policy[3];
            poaPolicy[i++] = rootPOA.create_lifespan_policy(
                LifespanPolicyValue.TRANSIENT);
            poaPolicy[i++] = rootPOA.create_id_assignment_policy(
                IdAssignmentPolicyValue.SYSTEM_ID);
            poaPolicy[i++] = rootPOA.create_servant_retention_policy(
                ServantRetentionPolicyValue.RETAIN);

            POA nsPOA = rootPOA.create_POA( "TNameService", null, poaPolicy );
            nsPOA.the_POAManager().activate();

            // Create an initial context
            TransientNamingContext initialContext =
                new TransientNamingContext(orb, null, nsPOA);
            byte[] rootContextId = nsPOA.activate_object( initialContext );
            initialContext.localRoot =
                nsPOA.id_to_reference( rootContextId );
            theInitialNamingContext = initialContext.localRoot;
            orb.register_initial_reference( nameServiceName,
                theInitialNamingContext );
        } catch (org.omg.CORBA.SystemException e) {
            throw wrapper.transNsCannotCreateInitialNcSys( e ) ;
View Full Code Here

        // Find out a better way of doing this, Since ORBD is an important
        // process which should not be killed because of some external process
        // orb.setPersistentServerId( (int) 1000 );

        // get and activate the root naming POA
        POA rootPOA = (POA)orb.resolve_initial_references(
            ORBConstants.ROOT_POA_NAME ) ;
        rootPOA.the_POAManager().activate();

        // create a new POA for persistent Naming Contexts
        // With Non-Retain policy, So that every time Servant Manager
        // will be contacted when the reference is made for the context
        // The id assignment is made by the NameServer, The Naming Context
        // id's will be in the format NC<Index>
        int i=0;
        Policy[] poaPolicy = new Policy[4];
        poaPolicy[i++] = rootPOA.create_lifespan_policy(
                         LifespanPolicyValue.PERSISTENT);
        poaPolicy[i++] = rootPOA.create_request_processing_policy(
                         RequestProcessingPolicyValue.USE_SERVANT_MANAGER);
        poaPolicy[i++] = rootPOA.create_id_assignment_policy(
                         IdAssignmentPolicyValue.USER_ID);
        poaPolicy[i++] = rootPOA.create_servant_retention_policy(
                         ServantRetentionPolicyValue.NON_RETAIN);


        nsPOA = rootPOA.create_POA("NameService", null, poaPolicy);
        nsPOA.the_POAManager().activate( );

        // create and set the servant manager
        contextMgr = new
            ServantManagerImpl(orb, logDir, this );
View Full Code Here

    private synchronized void createbiPOA( ) {
        if( biPOA != null ) {
            return;
        }
        try {
            POA rootPOA = (POA) orb.resolve_initial_references(
                ORBConstants.ROOT_POA_NAME );
            rootPOA.the_POAManager().activate( );

            int i = 0;
            Policy[] poaPolicy = new Policy[3];
            poaPolicy[i++] = rootPOA.create_lifespan_policy(
                LifespanPolicyValue.TRANSIENT);
            poaPolicy[i++] = rootPOA.create_id_assignment_policy(
                IdAssignmentPolicyValue.SYSTEM_ID);
            poaPolicy[i++] = rootPOA.create_servant_retention_policy(
                ServantRetentionPolicyValue.RETAIN);
            biPOA = rootPOA.create_POA("BindingIteratorPOA", null, poaPolicy );
            biPOA.the_POAManager().activate( );
        } catch( Exception e ) {
            throw readWrapper.namingCtxBindingIteratorCreate( e ) ;
        }
    }
View Full Code Here

            ClosureFactory.makeConstant( poaCurrent ) ) ;
    }

    public ObjectAdapter find( ObjectAdapterId oaid )
    {
        POA poa=null;
        try {
            boolean first = true ;
            Iterator iter = oaid.iterator() ;
            poa = getRootPOA();
            while (iter.hasNext()) {
                String name = (String)(iter.next()) ;

                if (first) {
                    if (!name.equals( ORBConstants.ROOT_POA_NAME ))
                        throw wrapper.makeFactoryNotPoa( name ) ;
                    first = false ;
                } else {
                    poa = poa.find_POA( name, true ) ;
                }
            }
        } catch ( org.omg.PortableServer.POAPackage.AdapterNonExistent ex ){
            throw omgWrapper.noObjectAdaptor( ex ) ;
        } catch ( OBJECT_NOT_EXIST ex ) {
View Full Code Here

TOP

Related Classes of org.omg.PortableServer.POA

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.