org.omg.PortableServer.POA Java Examples

The following examples show how to use org.omg.PortableServer.POA. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: POAImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * <code>the_children</code>
 */
public org.omg.PortableServer.POA[] the_children()
{
    try {
        lock() ;

        Collection coll = children.values() ;
        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 {
        unlock() ;
    }
}
 
Example #2
Source File: POAFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public synchronized POA getRootPOA()
{
    if (rootPOA == null) {
        // See if we are trying to getRootPOA while shutting down the ORB.
        if (isShuttingDown) {
            throw omgWrapper.noObjectAdaptor( ) ;
        }

        try {
            Object obj = orb.resolve_initial_references(
                ORBConstants.ROOT_POA_NAME ) ;
            rootPOA = (POAImpl)obj ;
        } catch (InvalidName inv) {
            throw wrapper.cantResolveRootPoa( inv ) ;
        }
    }

    return rootPOA;
}
 
Example #3
Source File: TransientNamingContext.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Constructs a new TransientNamingContext object.
 * @param orb an orb object.
 * @param initial the initial naming context.
 * @exception Exception a Java exception thrown of the base class cannot
 * initialize.
 */
public TransientNamingContext(com.sun.corba.se.spi.orb.ORB orb,
    org.omg.CORBA.Object initial,
    POA nsPOA )
    throws java.lang.Exception
{
    super(orb, nsPOA );
    wrapper = NamingSystemException.get( orb, CORBALogDomains.NAMING ) ;

    this.localRoot = initial;
    readLogger = orb.getLogger( CORBALogDomains.NAMING_READ);
    updateLogger = orb.getLogger( CORBALogDomains.NAMING_UPDATE);
    lifecycleLogger = orb.getLogger(
        CORBALogDomains.NAMING_LIFECYCLE);
    lifecycleLogger.fine( "Root TransientNamingContext LIFECYCLE.CREATED" );
}
 
Example #4
Source File: StubAdapter.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/** 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() ;
    }

    return ref ;
}
 
Example #5
Source File: POAImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * <code>the_children</code>
 */
public org.omg.PortableServer.POA[] the_children()
{
    try {
        lock() ;

        Collection coll = children.values() ;
        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 {
        unlock() ;
    }
}
 
Example #6
Source File: StubAdapter.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/** 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() ;
    }

    return ref ;
}
 
Example #7
Source File: TransientNamingContext.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs a new TransientNamingContext object.
 * @param orb an orb object.
 * @param initial the initial naming context.
 * @exception Exception a Java exception thrown of the base class cannot
 * initialize.
 */
public TransientNamingContext(com.sun.corba.se.spi.orb.ORB orb,
    org.omg.CORBA.Object initial,
    POA nsPOA )
    throws java.lang.Exception
{
    super(orb, nsPOA );
    wrapper = NamingSystemException.get( orb, CORBALogDomains.NAMING ) ;

    this.localRoot = initial;
    readLogger = orb.getLogger( CORBALogDomains.NAMING_READ);
    updateLogger = orb.getLogger( CORBALogDomains.NAMING_UPDATE);
    lifecycleLogger = orb.getLogger(
        CORBALogDomains.NAMING_LIFECYCLE);
    lifecycleLogger.fine( "Root TransientNamingContext LIFECYCLE.CREATED" );
}
 
Example #8
Source File: POAImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * <code>the_children</code>
 */
public org.omg.PortableServer.POA[] the_children()
{
    try {
        lock() ;

        Collection coll = children.values() ;
        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 {
        unlock() ;
    }
}
 
Example #9
Source File: NamingContextImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
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 ) ;
    }
}
 
Example #10
Source File: StubAdapter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/** 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() ;
    }

    return ref ;
}
 
Example #11
Source File: POAFactory.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public synchronized POA getRootPOA()
{
    if (rootPOA == null) {
        // See if we are trying to getRootPOA while shutting down the ORB.
        if (isShuttingDown) {
            throw omgWrapper.noObjectAdaptor( ) ;
        }

        try {
            Object obj = orb.resolve_initial_references(
                ORBConstants.ROOT_POA_NAME ) ;
            rootPOA = (POAImpl)obj ;
        } catch (InvalidName inv) {
            throw wrapper.cantResolveRootPoa( inv ) ;
        }
    }

    return rootPOA;
}
 
Example #12
Source File: NamingContextImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
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 ) ;
    }
}
 
Example #13
Source File: StubAdapter.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/** 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() ;
    }

    return ref ;
}
 
Example #14
Source File: StubAdapter.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/** 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() ;
    }

    return ref ;
}
 
Example #15
Source File: NamingContextImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
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 ) ;
    }
}
 
Example #16
Source File: TransientNamingContext.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs a new TransientNamingContext object.
 * @param orb an orb object.
 * @param initial the initial naming context.
 * @exception Exception a Java exception thrown of the base class cannot
 * initialize.
 */
public TransientNamingContext(com.sun.corba.se.spi.orb.ORB orb,
    org.omg.CORBA.Object initial,
    POA nsPOA )
    throws java.lang.Exception
{
    super(orb, nsPOA );
    wrapper = NamingSystemException.get( orb, CORBALogDomains.NAMING ) ;

    this.localRoot = initial;
    readLogger = orb.getLogger( CORBALogDomains.NAMING_READ);
    updateLogger = orb.getLogger( CORBALogDomains.NAMING_UPDATE);
    lifecycleLogger = orb.getLogger(
        CORBALogDomains.NAMING_LIFECYCLE);
    lifecycleLogger.fine( "Root TransientNamingContext LIFECYCLE.CREATED" );
}
 
Example #17
Source File: TransientBindingIterator.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
  * Constructs a new TransientBindingIterator object.
  * @param orb a org.omg.CORBA.ORB object.
  * @param aTable A hashtable containing InternalBindingValues which is
  * the content of the TransientNamingContext.
  * @param java.lang.Exception a Java exception.
  * @exception Exception a Java exception thrown of the base class cannot
  * initialize.
*/
 public TransientBindingIterator(ORB orb, Hashtable aTable,
     POA thePOA )
     throws java.lang.Exception
 {
     super(orb);
     theHashtable = aTable;
     theEnumeration = this.theHashtable.elements();
     currentSize = this.theHashtable.size();
     this.nsPOA = thePOA;
 }
 
Example #18
Source File: PersistentBindingIterator.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
  * Constructs a new PersistentBindingIterator object.
  * @param orb a org.omg.CORBA.ORB object.
  * @param aTable A hashtable containing InternalBindingValues which is
  * the content of the PersistentNamingContext.
  * @param java.lang.Exception a Java exception.
  * @exception Exception a Java exception thrown of the base class cannot
  * initialize.
*/
 public PersistentBindingIterator(org.omg.CORBA.ORB orb, Hashtable aTable,
     POA thePOA ) throws java.lang.Exception
 {
     super(orb);
     this.orb = orb;
     theHashtable = aTable;
     theEnumeration = this.theHashtable.keys();
     currentSize = this.theHashtable.size();
     biPOA = thePOA;
 }
 
Example #19
Source File: POAManagerImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
synchronized void addPOA(POA poa)
{
    // XXX This is probably not the correct error
    if (state.value() == State._INACTIVE) {
        POASystemException wrapper = factory.getWrapper();
        throw wrapper.addPoaInactive( CompletionStatus.COMPLETED_NO ) ;
    }

    poas.add(poa);
}
 
Example #20
Source File: POAManagerImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
synchronized void removePOA(POA poa)
{
    poas.remove(poa);
    if ( poas.isEmpty() ) {
        factory.removePoaManager(this);
    }
}
 
Example #21
Source File: NamingContextImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a naming context servant.
 * Runs the super constructor.
 * @param orb an ORB object.
 * @exception java.lang.Exception a Java exception.
 */
public NamingContextImpl(ORB orb, POA poa) throws java.lang.Exception {
    super();
    this.orb = orb;
    wrapper = NamingSystemException.get( orb,
        CORBALogDomains.NAMING_UPDATE ) ;

    insImpl = new InterOperableNamingImpl( );
    this.nsPOA = poa;
    readLogger = orb.getLogger( CORBALogDomains.NAMING_READ);
    updateLogger = orb.getLogger( CORBALogDomains.NAMING_UPDATE);
    lifecycleLogger = orb.getLogger(
        CORBALogDomains.NAMING_LIFECYCLE);
}
 
Example #22
Source File: POAPolicyMediatorImpl_NR_USM.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void returnServant()
{
    OAInvocationInfo info = orb.peekInvocationInfo();
    if (locator == null)
        return;

    try {
        poa.unlock() ;
        locator.postinvoke(info.id(), (POA)(info.oa()),
            info.getOperation(), info.getCookieHolder().value,
            (Servant)(info.getServantContainer()) );
    } finally {
        poa.lock() ;
    }
}
 
Example #23
Source File: ServantManagerImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public Servant preinvoke(byte[] oid, POA adapter, String operation,
                         CookieHolder cookie) throws ForwardRequest
{

    String objKey = new String(oid);

    Servant servant = (Servant) contexts.get(objKey);

    if (servant == null)
    {
             servant =  readInContext(objKey);
    }

    return servant;
}
 
Example #24
Source File: PersistentBindingIterator.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
  * Constructs a new PersistentBindingIterator object.
  * @param orb a org.omg.CORBA.ORB object.
  * @param aTable A hashtable containing InternalBindingValues which is
  * the content of the PersistentNamingContext.
  * @param java.lang.Exception a Java exception.
  * @exception Exception a Java exception thrown of the base class cannot
  * initialize.
*/
 public PersistentBindingIterator(org.omg.CORBA.ORB orb, Hashtable aTable,
     POA thePOA ) throws java.lang.Exception
 {
     super(orb);
     this.orb = orb;
     theHashtable = aTable;
     theEnumeration = this.theHashtable.keys();
     currentSize = this.theHashtable.size();
     biPOA = thePOA;
 }
 
Example #25
Source File: ServantManagerImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public Servant preinvoke(byte[] oid, POA adapter, String operation,
                         CookieHolder cookie) throws ForwardRequest
{

    String objKey = new String(oid);

    Servant servant = (Servant) contexts.get(objKey);

    if (servant == null)
    {
             servant =  readInContext(objKey);
    }

    return servant;
}
 
Example #26
Source File: POAImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * <code>the_parent</code>
 * <b>Section 3.3.8.7</b>
 */
public POA the_parent()
{
    try {
        lock() ;

        return parent;
    } finally {
        unlock() ;
    }
}
 
Example #27
Source File: ServantManagerImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public Servant preinvoke(byte[] oid, POA adapter, String operation,
                         CookieHolder cookie) throws ForwardRequest
{

    String objKey = new String(oid);

    Servant servant = (Servant) contexts.get(objKey);

    if (servant == null)
    {
             servant =  readInContext(objKey);
    }

    return servant;
}
 
Example #28
Source File: TransientBindingIterator.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
  * Constructs a new TransientBindingIterator object.
  * @param orb a org.omg.CORBA.ORB object.
  * @param aTable A hashtable containing InternalBindingValues which is
  * the content of the TransientNamingContext.
  * @exception Exception a Java exception thrown of the base class cannot
  * initialize.
*/
 public TransientBindingIterator(ORB orb, Hashtable aTable,
     POA thePOA )
     throws java.lang.Exception
 {
     super(orb);
     theHashtable = aTable;
     theEnumeration = this.theHashtable.elements();
     currentSize = this.theHashtable.size();
     this.nsPOA = thePOA;
 }
 
Example #29
Source File: TransientBindingIterator.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
  * Constructs a new TransientBindingIterator object.
  * @param orb a org.omg.CORBA.ORB object.
  * @param aTable A hashtable containing InternalBindingValues which is
  * the content of the TransientNamingContext.
  * @param java.lang.Exception a Java exception.
  * @exception Exception a Java exception thrown of the base class cannot
  * initialize.
*/
 public TransientBindingIterator(ORB orb, Hashtable aTable,
     POA thePOA )
     throws java.lang.Exception
 {
     super(orb);
     theHashtable = aTable;
     theEnumeration = this.theHashtable.elements();
     currentSize = this.theHashtable.size();
     this.nsPOA = thePOA;
 }
 
Example #30
Source File: NamingContextImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a naming context servant.
 * Runs the super constructor.
 * @param orb an ORB object.
 * @exception java.lang.Exception a Java exception.
 */
public NamingContextImpl(ORB orb, POA poa) throws java.lang.Exception {
    super();
    this.orb = orb;
    wrapper = NamingSystemException.get( orb,
        CORBALogDomains.NAMING_UPDATE ) ;

    insImpl = new InterOperableNamingImpl( );
    this.nsPOA = poa;
    readLogger = orb.getLogger( CORBALogDomains.NAMING_READ);
    updateLogger = orb.getLogger( CORBALogDomains.NAMING_UPDATE);
    lifecycleLogger = orb.getLogger(
        CORBALogDomains.NAMING_LIFECYCLE);
}