Java Code Examples for org.omg.PortableServer.POAPackage.ServantNotActive

The following are top voted examples for showing how to use org.omg.PortableServer.POAPackage.ServantNotActive. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: OpenJSharp   File: StubAdapter.java   Source Code and License 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 2
Project: OpenJSharp   File: POAImpl.java   Source Code and License 6 votes vote down vote up
/**
 * <code>servant_to_id</code>
 * <b>3.3.8.19</b>
 */
public byte[] servant_to_id(Servant servant)
    throws ServantNotActive, WrongPolicy
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this, "Calling servant_to_id(servant=" +
                servant + ") on poa " + this ) ;
        }

        return mediator.servantToId( servant ) ;
    } finally {
        unlock() ;
    }
}
 
Example 3
Project: OpenJSharp   File: POAImpl.java   Source Code and License 6 votes vote down vote up
/**
 * <code>servant_to_reference</code>
 * <b>3.3.8.20</b>
 */
public org.omg.CORBA.Object servant_to_reference(Servant servant)
    throws ServantNotActive, WrongPolicy
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this,
                "Calling servant_to_reference(servant=" +
                servant + ") on poa " + this ) ;
        }

        byte[] oid = mediator.servantToId(servant);
        String repId = servant._all_interfaces( this, oid )[0] ;
        return create_reference_with_id(oid, repId);
    } finally {
        unlock() ;
    }
}
 
Example 4
Project: openjdk-jdk10   File: StubAdapter.java   Source Code and License 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
Project: openjdk-jdk10   File: POAImpl.java   Source Code and License 6 votes vote down vote up
/**
 * <code>servant_to_id</code>
 * <b>3.3.8.19</b>
 */
public byte[] servant_to_id(Servant servant)
    throws ServantNotActive, WrongPolicy
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this, "Calling servant_to_id(servant=" +
                servant + ") on poa " + this ) ;
        }

        return mediator.servantToId( servant ) ;
    } finally {
        unlock() ;
    }
}
 
Example 6
Project: openjdk-jdk10   File: POAImpl.java   Source Code and License 6 votes vote down vote up
/**
 * <code>servant_to_reference</code>
 * <b>3.3.8.20</b>
 */
public org.omg.CORBA.Object servant_to_reference(Servant servant)
    throws ServantNotActive, WrongPolicy
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this,
                "Calling servant_to_reference(servant=" +
                servant + ") on poa " + this ) ;
        }

        byte[] oid = mediator.servantToId(servant);
        String repId = servant._all_interfaces( this, oid )[0] ;
        return create_reference_with_id(oid, repId);
    } finally {
        unlock() ;
    }
}
 
Example 7
Project: openjdk9   File: StubAdapter.java   Source Code and License 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 8
Project: openjdk9   File: POAImpl.java   Source Code and License 6 votes vote down vote up
/**
 * <code>servant_to_id</code>
 * <b>3.3.8.19</b>
 */
public byte[] servant_to_id(Servant servant)
    throws ServantNotActive, WrongPolicy
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this, "Calling servant_to_id(servant=" +
                servant + ") on poa " + this ) ;
        }

        return mediator.servantToId( servant ) ;
    } finally {
        unlock() ;
    }
}
 
Example 9
Project: openjdk9   File: POAImpl.java   Source Code and License 6 votes vote down vote up
/**
 * <code>servant_to_reference</code>
 * <b>3.3.8.20</b>
 */
public org.omg.CORBA.Object servant_to_reference(Servant servant)
    throws ServantNotActive, WrongPolicy
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this,
                "Calling servant_to_reference(servant=" +
                servant + ") on poa " + this ) ;
        }

        byte[] oid = mediator.servantToId(servant);
        String repId = servant._all_interfaces( this, oid )[0] ;
        return create_reference_with_id(oid, repId);
    } finally {
        unlock() ;
    }
}
 
Example 10
Project: lookaside_java-1.8.0-openjdk   File: StubAdapter.java   Source Code and License 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
Project: lookaside_java-1.8.0-openjdk   File: POAImpl.java   Source Code and License 6 votes vote down vote up
/**
 * <code>servant_to_id</code>
 * <b>3.3.8.19</b>
 */
public byte[] servant_to_id(Servant servant)
    throws ServantNotActive, WrongPolicy
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this, "Calling servant_to_id(servant=" +
                servant + ") on poa " + this ) ;
        }

        return mediator.servantToId( servant ) ;
    } finally {
        unlock() ;
    }
}
 
Example 12
Project: lookaside_java-1.8.0-openjdk   File: POAImpl.java   Source Code and License 6 votes vote down vote up
/**
 * <code>servant_to_reference</code>
 * <b>3.3.8.20</b>
 */
public org.omg.CORBA.Object servant_to_reference(Servant servant)
    throws ServantNotActive, WrongPolicy
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this,
                "Calling servant_to_reference(servant=" +
                servant + ") on poa " + this ) ;
        }

        byte[] oid = mediator.servantToId(servant);
        String repId = servant._all_interfaces( this, oid )[0] ;
        return create_reference_with_id(oid, repId);
    } finally {
        unlock() ;
    }
}
 
Example 13
Project: jdk8u_corba   File: StubAdapter.java   Source Code and License 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
Project: jdk8u_corba   File: POAImpl.java   Source Code and License 6 votes vote down vote up
/**
 * <code>servant_to_id</code>
 * <b>3.3.8.19</b>
 */
public byte[] servant_to_id(Servant servant)
    throws ServantNotActive, WrongPolicy
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this, "Calling servant_to_id(servant=" +
                servant + ") on poa " + this ) ;
        }

        return mediator.servantToId( servant ) ;
    } finally {
        unlock() ;
    }
}
 
Example 15
Project: jdk8u_corba   File: POAImpl.java   Source Code and License 6 votes vote down vote up
/**
 * <code>servant_to_reference</code>
 * <b>3.3.8.20</b>
 */
public org.omg.CORBA.Object servant_to_reference(Servant servant)
    throws ServantNotActive, WrongPolicy
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this,
                "Calling servant_to_reference(servant=" +
                servant + ") on poa " + this ) ;
        }

        byte[] oid = mediator.servantToId(servant);
        String repId = servant._all_interfaces( this, oid )[0] ;
        return create_reference_with_id(oid, repId);
    } finally {
        unlock() ;
    }
}
 
Example 16
Project: infobip-open-jdk-8   File: StubAdapter.java   Source Code and License 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 17
Project: infobip-open-jdk-8   File: POAImpl.java   Source Code and License 6 votes vote down vote up
/**
 * <code>servant_to_id</code>
 * <b>3.3.8.19</b>
 */
public byte[] servant_to_id(Servant servant)
    throws ServantNotActive, WrongPolicy
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this, "Calling servant_to_id(servant=" +
                servant + ") on poa " + this ) ;
        }

        return mediator.servantToId( servant ) ;
    } finally {
        unlock() ;
    }
}
 
Example 18
Project: infobip-open-jdk-8   File: POAImpl.java   Source Code and License 6 votes vote down vote up
/**
 * <code>servant_to_reference</code>
 * <b>3.3.8.20</b>
 */
public org.omg.CORBA.Object servant_to_reference(Servant servant)
    throws ServantNotActive, WrongPolicy
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this,
                "Calling servant_to_reference(servant=" +
                servant + ") on poa " + this ) ;
        }

        byte[] oid = mediator.servantToId(servant);
        String repId = servant._all_interfaces( this, oid )[0] ;
        return create_reference_with_id(oid, repId);
    } finally {
        unlock() ;
    }
}
 
Example 19
Project: openjdk-source-code-learn   File: StubAdapter.java   Source Code and License 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 20
Project: openjdk-source-code-learn   File: POAImpl.java   Source Code and License 6 votes vote down vote up
/**
 * <code>servant_to_id</code>
 * <b>3.3.8.19</b>
 */
public byte[] servant_to_id(Servant servant)
    throws ServantNotActive, WrongPolicy
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this, "Calling servant_to_id(servant=" +
                servant + ") on poa " + this ) ;
        }

        return mediator.servantToId( servant ) ;
    } finally {
        unlock() ;
    }
}
 
Example 21
Project: openjdk-source-code-learn   File: POAImpl.java   Source Code and License 6 votes vote down vote up
/**
 * <code>servant_to_reference</code>
 * <b>3.3.8.20</b>
 */
public org.omg.CORBA.Object servant_to_reference(Servant servant)
    throws ServantNotActive, WrongPolicy
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this,
                "Calling servant_to_reference(servant=" +
                servant + ") on poa " + this ) ;
        }

        byte[] oid = mediator.servantToId(servant);
        String repId = servant._all_interfaces( this, oid )[0] ;
        return create_reference_with_id(oid, repId);
    } finally {
        unlock() ;
    }
}
 
Example 22
Project: OLD-OpenJDK8   File: StubAdapter.java   Source Code and License 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 23
Project: OLD-OpenJDK8   File: POAImpl.java   Source Code and License 6 votes vote down vote up
/**
 * <code>servant_to_id</code>
 * <b>3.3.8.19</b>
 */
public byte[] servant_to_id(Servant servant)
    throws ServantNotActive, WrongPolicy
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this, "Calling servant_to_id(servant=" +
                servant + ") on poa " + this ) ;
        }

        return mediator.servantToId( servant ) ;
    } finally {
        unlock() ;
    }
}
 
Example 24
Project: OLD-OpenJDK8   File: POAImpl.java   Source Code and License 6 votes vote down vote up
/**
 * <code>servant_to_reference</code>
 * <b>3.3.8.20</b>
 */
public org.omg.CORBA.Object servant_to_reference(Servant servant)
    throws ServantNotActive, WrongPolicy
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this,
                "Calling servant_to_reference(servant=" +
                servant + ") on poa " + this ) ;
        }

        byte[] oid = mediator.servantToId(servant);
        String repId = servant._all_interfaces( this, oid )[0] ;
        return create_reference_with_id(oid, repId);
    } finally {
        unlock() ;
    }
}
 
Example 25
Project: openjdk-orb   File: StubAdapter.java   Source Code and License 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 26
Project: openjdk-orb   File: POAImpl.java   Source Code and License 6 votes vote down vote up
/**
 * <code>servant_to_id</code>
 * <b>3.3.8.19</b>
 */
public byte[] servant_to_id(Servant servant)
    throws ServantNotActive, WrongPolicy
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this, "Calling servant_to_id(servant=" +
                servant + ") on poa " + this ) ;
        }

        return mediator.servantToId( servant ) ;
    } finally {
        unlock() ;
    }
}
 
Example 27
Project: openjdk-orb   File: POAImpl.java   Source Code and License 6 votes vote down vote up
/**
 * <code>servant_to_reference</code>
 * <b>3.3.8.20</b>
 */
public org.omg.CORBA.Object servant_to_reference(Servant servant)
    throws ServantNotActive, WrongPolicy
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this,
                "Calling servant_to_reference(servant=" +
                servant + ") on poa " + this ) ;
        }

        byte[] oid = mediator.servantToId(servant);
        String repId = servant._all_interfaces( this, oid )[0] ;
        return create_reference_with_id(oid, repId);
    } finally {
        unlock() ;
    }
}
 
Example 28
Project: openjdk-icedtea7   File: StubAdapter.java   Source Code and License 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 29
Project: openjdk-icedtea7   File: POAImpl.java   Source Code and License 6 votes vote down vote up
/**
 * <code>servant_to_id</code>
 * <b>3.3.8.19</b>
 */
public byte[] servant_to_id(Servant servant)
    throws ServantNotActive, WrongPolicy
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this, "Calling servant_to_id(servant=" +
                servant + ") on poa " + this ) ;
        }

        return mediator.servantToId( servant ) ;
    } finally {
        unlock() ;
    }
}
 
Example 30
Project: openjdk-icedtea7   File: POAImpl.java   Source Code and License 6 votes vote down vote up
/**
 * <code>servant_to_reference</code>
 * <b>3.3.8.20</b>
 */
public org.omg.CORBA.Object servant_to_reference(Servant servant)
    throws ServantNotActive, WrongPolicy
{
    try {
        lock() ;

        if (debug) {
            ORBUtility.dprint( this,
                "Calling servant_to_reference(servant=" +
                servant + ") on poa " + this ) ;
        }

        byte[] oid = mediator.servantToId(servant);
        String repId = servant._all_interfaces( this, oid )[0] ;
        return create_reference_with_id(oid, repId);
    } finally {
        unlock() ;
    }
}
 
Example 31
Project: javify   File: gnuPOA.java   Source Code and License 5 votes vote down vote up
/**
 * Returns the id of the object, served by the given servant (assuming that
 * the servant serves only one object). The id is found in one of the
 * following ways.
 * <ul>
 * <li>If the POA has both the RETAIN and the UNIQUE_ID policy and the
 * specified servant is active, the method return the Object Id associated
 * with that servant. </li>
 * <li> If the POA has both the RETAIN and the IMPLICIT_ACTIVATION policy and
 * either the POA has the MULTIPLE_ID policy or the specified servant is
 * inactive, the method activates the servant using a POA-generated Object Id
 * and the Interface Id associated with the servant, and returns that Object
 * Id. </li>
 * <li>If the POA has the USE_DEFAULT_SERVANT policy, the servant specified
 * is the default servant, and the method is being invoked in the context of
 * executing a request on the default servant, the method returns the ObjectId
 * associated with the current invocation. </li>
 * </ul>
 *
 * @throws ServantNotActive in all cases, not listed in the list above.
 * @throws WrongPolicy The method requres USE_DEFAULT_SERVANT policy or a
 * combination of the RETAIN policy and either the UNIQUE_ID or
 * IMPLICIT_ACTIVATION policies and throws the WrongPolicy if these conditions
 * are not satisfied.
 */
public byte[] servant_to_id(Servant the_Servant)
                     throws ServantNotActive, WrongPolicy
{
  if (applies(RequestProcessingPolicyValue.USE_DEFAULT_SERVANT) ||
      applies(ServantRetentionPolicyValue.RETAIN) &&
      (
        applies(IdUniquenessPolicyValue.UNIQUE_ID) ||
        applies(ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION)
      )
     )
    {
      AOM.Obj ref = null;
      if (!applies(IdUniquenessPolicyValue.MULTIPLE_ID))
        ref = aom.findServant(the_Servant);
      if (ref == null &&
          applies(ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION)
         )
        {
          // Try to activate.
          try
            {
              return activate_object(the_Servant);
            }
          catch (ServantAlreadyActive ex)
            {
              // Either it shuld not be or the policy allows multiple ids.
              throw new InternalError();
            }
        }
      if (ref == null)
        throw new ServantNotActive();
      else
        return ref.key;
    }
  else
    throw new WrongPolicy("(RETAIN and UNIQUE ID) " +
                          "or USE_DEFAULT_SERVANT required."
                         );
}
 
Example 32
Project: jvm-stm   File: gnuPOA.java   Source Code and License 5 votes vote down vote up
/**
 * Returns the id of the object, served by the given servant (assuming that
 * the servant serves only one object). The id is found in one of the
 * following ways.
 * <ul>
 * <li>If the POA has both the RETAIN and the UNIQUE_ID policy and the
 * specified servant is active, the method return the Object Id associated
 * with that servant. </li>
 * <li> If the POA has both the RETAIN and the IMPLICIT_ACTIVATION policy and
 * either the POA has the MULTIPLE_ID policy or the specified servant is
 * inactive, the method activates the servant using a POA-generated Object Id
 * and the Interface Id associated with the servant, and returns that Object
 * Id. </li>
 * <li>If the POA has the USE_DEFAULT_SERVANT policy, the servant specified
 * is the default servant, and the method is being invoked in the context of
 * executing a request on the default servant, the method returns the ObjectId
 * associated with the current invocation. </li>
 * </ul>
 * 
 * @throws ServantNotActive in all cases, not listed in the list above.
 * @throws WrongPolicy The method requres USE_DEFAULT_SERVANT policy or a
 * combination of the RETAIN policy and either the UNIQUE_ID or
 * IMPLICIT_ACTIVATION policies and throws the WrongPolicy if these conditions
 * are not satisfied.
 */
public byte[] servant_to_id(Servant the_Servant)
                     throws ServantNotActive, WrongPolicy
{
  if (applies(RequestProcessingPolicyValue.USE_DEFAULT_SERVANT) ||
      applies(ServantRetentionPolicyValue.RETAIN) &&
      (
        applies(IdUniquenessPolicyValue.UNIQUE_ID) ||
        applies(ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION)
      )
     )
    {
      AOM.Obj ref = null;
      if (!applies(IdUniquenessPolicyValue.MULTIPLE_ID))
        ref = aom.findServant(the_Servant);
      if (ref == null &&
          applies(ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION)
         )
        {
          // Try to activate.
          try
            {
              return activate_object(the_Servant);
            }
          catch (ServantAlreadyActive ex)
            {
              // Either it shuld not be or the policy allows multiple ids.
              throw new InternalError();
            }
        }
      if (ref == null)
        throw new ServantNotActive();
      else
        return ref.key;
    }
  else
    throw new WrongPolicy("(RETAIN and UNIQUE ID) " +
                          "or USE_DEFAULT_SERVANT required."
                         );
}
 
Example 33
Project: JamVM-PH   File: gnuPOA.java   Source Code and License 5 votes vote down vote up
/**
 * Returns the id of the object, served by the given servant (assuming that
 * the servant serves only one object). The id is found in one of the
 * following ways.
 * <ul>
 * <li>If the POA has both the RETAIN and the UNIQUE_ID policy and the
 * specified servant is active, the method return the Object Id associated
 * with that servant. </li>
 * <li> If the POA has both the RETAIN and the IMPLICIT_ACTIVATION policy and
 * either the POA has the MULTIPLE_ID policy or the specified servant is
 * inactive, the method activates the servant using a POA-generated Object Id
 * and the Interface Id associated with the servant, and returns that Object
 * Id. </li>
 * <li>If the POA has the USE_DEFAULT_SERVANT policy, the servant specified
 * is the default servant, and the method is being invoked in the context of
 * executing a request on the default servant, the method returns the ObjectId
 * associated with the current invocation. </li>
 * </ul>
 * 
 * @throws ServantNotActive in all cases, not listed in the list above.
 * @throws WrongPolicy The method requres USE_DEFAULT_SERVANT policy or a
 * combination of the RETAIN policy and either the UNIQUE_ID or
 * IMPLICIT_ACTIVATION policies and throws the WrongPolicy if these conditions
 * are not satisfied.
 */
public byte[] servant_to_id(Servant the_Servant)
                     throws ServantNotActive, WrongPolicy
{
  if (applies(RequestProcessingPolicyValue.USE_DEFAULT_SERVANT) ||
      applies(ServantRetentionPolicyValue.RETAIN) &&
      (
        applies(IdUniquenessPolicyValue.UNIQUE_ID) ||
        applies(ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION)
      )
     )
    {
      AOM.Obj ref = null;
      if (!applies(IdUniquenessPolicyValue.MULTIPLE_ID))
        ref = aom.findServant(the_Servant);
      if (ref == null &&
          applies(ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION)
         )
        {
          // Try to activate.
          try
            {
              return activate_object(the_Servant);
            }
          catch (ServantAlreadyActive ex)
            {
              // Either it shuld not be or the policy allows multiple ids.
              throw new InternalError();
            }
        }
      if (ref == null)
        throw new ServantNotActive();
      else
        return ref.key;
    }
  else
    throw new WrongPolicy("(RETAIN and UNIQUE ID) " +
                          "or USE_DEFAULT_SERVANT required."
                         );
}
 
Example 34
Project: classpath   File: gnuPOA.java   Source Code and License 5 votes vote down vote up
/**
 * Returns the id of the object, served by the given servant (assuming that
 * the servant serves only one object). The id is found in one of the
 * following ways.
 * <ul>
 * <li>If the POA has both the RETAIN and the UNIQUE_ID policy and the
 * specified servant is active, the method return the Object Id associated
 * with that servant. </li>
 * <li> If the POA has both the RETAIN and the IMPLICIT_ACTIVATION policy and
 * either the POA has the MULTIPLE_ID policy or the specified servant is
 * inactive, the method activates the servant using a POA-generated Object Id
 * and the Interface Id associated with the servant, and returns that Object
 * Id. </li>
 * <li>If the POA has the USE_DEFAULT_SERVANT policy, the servant specified
 * is the default servant, and the method is being invoked in the context of
 * executing a request on the default servant, the method returns the ObjectId
 * associated with the current invocation. </li>
 * </ul>
 *
 * @throws ServantNotActive in all cases, not listed in the list above.
 * @throws WrongPolicy The method requres USE_DEFAULT_SERVANT policy or a
 * combination of the RETAIN policy and either the UNIQUE_ID or
 * IMPLICIT_ACTIVATION policies and throws the WrongPolicy if these conditions
 * are not satisfied.
 */
public byte[] servant_to_id(Servant the_Servant)
                     throws ServantNotActive, WrongPolicy
{
  if (applies(RequestProcessingPolicyValue.USE_DEFAULT_SERVANT) ||
      applies(ServantRetentionPolicyValue.RETAIN) &&
      (
        applies(IdUniquenessPolicyValue.UNIQUE_ID) ||
        applies(ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION)
      )
     )
    {
      AOM.Obj ref = null;
      if (!applies(IdUniquenessPolicyValue.MULTIPLE_ID))
        ref = aom.findServant(the_Servant);
      if (ref == null &&
          applies(ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION)
         )
        {
          // Try to activate.
          try
            {
              return activate_object(the_Servant);
            }
          catch (ServantAlreadyActive ex)
            {
              // Either it shuld not be or the policy allows multiple ids.
              throw new InternalError();
            }
        }
      if (ref == null)
        throw new ServantNotActive();
      else
        return ref.key;
    }
  else
    throw new WrongPolicy("(RETAIN and UNIQUE ID) " +
                          "or USE_DEFAULT_SERVANT required."
                         );
}
 
Example 35
Project: framework-bulkioInterfaces   File: Java_Ports.java   Source Code and License 5 votes vote down vote up
/**
 * @generated
 */
public CF.Resource setup(final String compId, final String compName, final ORB orb, final POA poa) throws ServantNotActive, WrongPolicy
{
        CF.Resource retval = super.setup(compId, compName, orb, poa);
    this.registerPropertyChangePort(this.port_propEvent);
        return retval;
}
 
Example 36
Project: framework-bulkioInterfaces   File: Java_Ports.java   Source Code and License 5 votes vote down vote up
/**
 * @generated
 */
public CF.Resource setup(final String compId, final String compName, final ORB orb, final POA poa) throws ServantNotActive, WrongPolicy
{
        CF.Resource retval = super.setup(compId, compName, orb, poa);
    this.registerPropertyChangePort(this.port_propEvent);
        return retval;
}
 
Example 37
Project: OpenJSharp   File: POAPolicyMediatorImpl_NR_UDS.java   Source Code and License 4 votes vote down vote up
public byte[] servantToId( Servant servant ) throws ServantNotActive, WrongPolicy
{
    throw new WrongPolicy();
}
 
Example 38
Project: OpenJSharp   File: POAPolicyMediatorImpl_NR_USM.java   Source Code and License 4 votes vote down vote up
public byte[] servantToId( Servant servant ) throws ServantNotActive, WrongPolicy
{
    throw new WrongPolicy();
}
 
Example 39
Project: openjdk-jdk10   File: POAPolicyMediatorImpl_NR_UDS.java   Source Code and License 4 votes vote down vote up
public byte[] servantToId( Servant servant ) throws ServantNotActive, WrongPolicy
{
    throw new WrongPolicy();
}
 
Example 40
Project: openjdk-jdk10   File: POAPolicyMediatorImpl_NR_USM.java   Source Code and License 4 votes vote down vote up
public byte[] servantToId( Servant servant ) throws ServantNotActive, WrongPolicy
{
    throw new WrongPolicy();
}
 
Example 41
Project: openjdk9   File: POAPolicyMediatorImpl_NR_UDS.java   Source Code and License 4 votes vote down vote up
public byte[] servantToId( Servant servant ) throws ServantNotActive, WrongPolicy
{
    throw new WrongPolicy();
}
 
Example 42
Project: openjdk9   File: POAPolicyMediatorImpl_NR_USM.java   Source Code and License 4 votes vote down vote up
public byte[] servantToId( Servant servant ) throws ServantNotActive, WrongPolicy
{
    throw new WrongPolicy();
}
 
Example 43
Project: lookaside_java-1.8.0-openjdk   File: POAPolicyMediatorImpl_NR_UDS.java   Source Code and License 4 votes vote down vote up
public byte[] servantToId( Servant servant ) throws ServantNotActive, WrongPolicy
{
    throw new WrongPolicy();
}
 
Example 44
Project: lookaside_java-1.8.0-openjdk   File: POAPolicyMediatorImpl_NR_USM.java   Source Code and License 4 votes vote down vote up
public byte[] servantToId( Servant servant ) throws ServantNotActive, WrongPolicy
{
    throw new WrongPolicy();
}
 
Example 45
Project: jdk8u_corba   File: POAPolicyMediatorImpl_NR_UDS.java   Source Code and License 4 votes vote down vote up
public byte[] servantToId( Servant servant ) throws ServantNotActive, WrongPolicy
{
    throw new WrongPolicy();
}
 
Example 46
Project: jdk8u_corba   File: POAPolicyMediatorImpl_NR_USM.java   Source Code and License 4 votes vote down vote up
public byte[] servantToId( Servant servant ) throws ServantNotActive, WrongPolicy
{
    throw new WrongPolicy();
}
 
Example 47
Project: javify   File: gnuPOA.java   Source Code and License 4 votes vote down vote up
/**
 * <p>
 * Converts the given servant to the object reference. The servant will serve
 * all methods, invoked on the returned object. The returned object reference
 * can be passed to the remote client, enabling remote invocations.
 * </p>
 * <p>
 * If the specified servant is active, it is returned. Otherwise, if the POA
 * has the IMPLICIT_ACTIVATION policy the method activates the servant. In
 * this case, if the servant activator is set, the
 * {@link ServantActivatorOperations#incarnate} method will be called.
 * </p>
 *
 * @throws ServantNotActive if the servant is inactive and no
 * IMPLICIT_ACTIVATION policy applies.
 * @throws WrongPolicy This method needs the RETAIN policy and either the
 * UNIQUE_ID or IMPLICIT_ACTIVATION policies.
 *
 * @return the object, exposing the given servant in the context of this POA.
 */
public org.omg.CORBA.Object servant_to_reference(Servant the_Servant)
  throws ServantNotActive, WrongPolicy
{
  required(ServantRetentionPolicyValue.RETAIN);

  AOM.Obj exists = null;

  if (!applies(IdUniquenessPolicyValue.MULTIPLE_ID))
    exists = aom.findServant(the_Servant);

  if (exists != null)
    {
      if (exists.isDeactiveted())
        {
          if (applies(ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION))
            {
              checkDiscarding();
              exists.setDeactivated(false);
              incarnate(exists, exists.key, the_Servant, false);
            }
          else
            throw new ServantNotActive();
        }
      else
        return exists.object;
    }
  if (exists == null
    && applies(ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION))
    {
      checkDiscarding();

      byte[] object_key = AOM.getFreeId();

      ServantDelegateImpl delegate = new ServantDelegateImpl(the_Servant,
        this, object_key);
      create_and_connect(object_key, the_Servant._all_interfaces(this,
        object_key)[0], delegate);

      return delegate.object;
    }
  else
    throw new ServantNotActive();
}
 
Example 48
Project: jvm-stm   File: gnuPOA.java   Source Code and License 4 votes vote down vote up
/**
 * <p>
 * Converts the given servant to the object reference. The servant will serve
 * all methods, invoked on the returned object. The returned object reference
 * can be passed to the remote client, enabling remote invocations.
 * </p>
 * <p>
 * If the specified servant is active, it is returned. Otherwise, if the POA
 * has the IMPLICIT_ACTIVATION policy the method activates the servant. In
 * this case, if the servant activator is set, the
 * {@link ServantActivatorOperations#incarnate} method will be called.
 * </p>
 * 
 * @throws ServantNotActive if the servant is inactive and no
 * IMPLICIT_ACTIVATION policy applies.
 * @throws WrongPolicy This method needs the RETAIN policy and either the
 * UNIQUE_ID or IMPLICIT_ACTIVATION policies.
 * 
 * @return the object, exposing the given servant in the context of this POA.
 */
public org.omg.CORBA.Object servant_to_reference(Servant the_Servant)
  throws ServantNotActive, WrongPolicy
{
  required(ServantRetentionPolicyValue.RETAIN);

  AOM.Obj exists = null;

  if (!applies(IdUniquenessPolicyValue.MULTIPLE_ID))
    exists = aom.findServant(the_Servant);

  if (exists != null)
    {
      if (exists.isDeactiveted())
        {
          if (applies(ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION))
            {
              checkDiscarding();
              exists.setDeactivated(false);
              incarnate(exists, exists.key, the_Servant, false);
            }
          else
            throw new ServantNotActive();
        }
      else
        return exists.object;
    }
  if (exists == null
    && applies(ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION))
    {
      checkDiscarding();

      byte[] object_key = AOM.getFreeId();

      ServantDelegateImpl delegate = new ServantDelegateImpl(the_Servant,
        this, object_key);
      create_and_connect(object_key, the_Servant._all_interfaces(this,
        object_key)[0], delegate);

      return delegate.object;
    }
  else
    throw new ServantNotActive();
}
 
Example 49
Project: infobip-open-jdk-8   File: POAPolicyMediatorImpl_NR_UDS.java   Source Code and License 4 votes vote down vote up
public byte[] servantToId( Servant servant ) throws ServantNotActive, WrongPolicy
{
    throw new WrongPolicy();
}
 
Example 50
Project: infobip-open-jdk-8   File: POAPolicyMediatorImpl_NR_USM.java   Source Code and License 4 votes vote down vote up
public byte[] servantToId( Servant servant ) throws ServantNotActive, WrongPolicy
{
    throw new WrongPolicy();
}
 
Example 51
Project: openjdk-source-code-learn   File: POAPolicyMediatorImpl_NR_UDS.java   Source Code and License 4 votes vote down vote up
public byte[] servantToId( Servant servant ) throws ServantNotActive, WrongPolicy
{
    throw new WrongPolicy();
}
 
Example 52
Project: openjdk-source-code-learn   File: POAPolicyMediatorImpl_NR_USM.java   Source Code and License 4 votes vote down vote up
public byte[] servantToId( Servant servant ) throws ServantNotActive, WrongPolicy
{
    throw new WrongPolicy();
}
 
Example 53
Project: OLD-OpenJDK8   File: POAPolicyMediatorImpl_NR_UDS.java   Source Code and License 4 votes vote down vote up
public byte[] servantToId( Servant servant ) throws ServantNotActive, WrongPolicy
{
    throw new WrongPolicy();
}
 
Example 54
Project: OLD-OpenJDK8   File: POAPolicyMediatorImpl_NR_USM.java   Source Code and License 4 votes vote down vote up
public byte[] servantToId( Servant servant ) throws ServantNotActive, WrongPolicy
{
    throw new WrongPolicy();
}
 
Example 55
Project: JamVM-PH   File: gnuPOA.java   Source Code and License 4 votes vote down vote up
/**
 * <p>
 * Converts the given servant to the object reference. The servant will serve
 * all methods, invoked on the returned object. The returned object reference
 * can be passed to the remote client, enabling remote invocations.
 * </p>
 * <p>
 * If the specified servant is active, it is returned. Otherwise, if the POA
 * has the IMPLICIT_ACTIVATION policy the method activates the servant. In
 * this case, if the servant activator is set, the
 * {@link ServantActivatorOperations#incarnate} method will be called.
 * </p>
 * 
 * @throws ServantNotActive if the servant is inactive and no
 * IMPLICIT_ACTIVATION policy applies.
 * @throws WrongPolicy This method needs the RETAIN policy and either the
 * UNIQUE_ID or IMPLICIT_ACTIVATION policies.
 * 
 * @return the object, exposing the given servant in the context of this POA.
 */
public org.omg.CORBA.Object servant_to_reference(Servant the_Servant)
  throws ServantNotActive, WrongPolicy
{
  required(ServantRetentionPolicyValue.RETAIN);

  AOM.Obj exists = null;

  if (!applies(IdUniquenessPolicyValue.MULTIPLE_ID))
    exists = aom.findServant(the_Servant);

  if (exists != null)
    {
      if (exists.isDeactiveted())
        {
          if (applies(ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION))
            {
              checkDiscarding();
              exists.setDeactivated(false);
              incarnate(exists, exists.key, the_Servant, false);
            }
          else
            throw new ServantNotActive();
        }
      else
        return exists.object;
    }
  if (exists == null
    && applies(ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION))
    {
      checkDiscarding();

      byte[] object_key = AOM.getFreeId();

      ServantDelegateImpl delegate = new ServantDelegateImpl(the_Servant,
        this, object_key);
      create_and_connect(object_key, the_Servant._all_interfaces(this,
        object_key)[0], delegate);

      return delegate.object;
    }
  else
    throw new ServantNotActive();
}
 
Example 56
Project: openjdk-orb   File: POAPolicyMediatorImpl_NR_UDS.java   Source Code and License 4 votes vote down vote up
public byte[] servantToId( Servant servant ) throws ServantNotActive, WrongPolicy
{
    throw new WrongPolicy();
}
 
Example 57
Project: openjdk-orb   File: POAPolicyMediatorImpl_NR_USM.java   Source Code and License 4 votes vote down vote up
public byte[] servantToId( Servant servant ) throws ServantNotActive, WrongPolicy
{
    throw new WrongPolicy();
}
 
Example 58
Project: classpath   File: gnuPOA.java   Source Code and License 4 votes vote down vote up
/**
 * <p>
 * Converts the given servant to the object reference. The servant will serve
 * all methods, invoked on the returned object. The returned object reference
 * can be passed to the remote client, enabling remote invocations.
 * </p>
 * <p>
 * If the specified servant is active, it is returned. Otherwise, if the POA
 * has the IMPLICIT_ACTIVATION policy the method activates the servant. In
 * this case, if the servant activator is set, the
 * {@link ServantActivatorOperations#incarnate} method will be called.
 * </p>
 *
 * @throws ServantNotActive if the servant is inactive and no
 * IMPLICIT_ACTIVATION policy applies.
 * @throws WrongPolicy This method needs the RETAIN policy and either the
 * UNIQUE_ID or IMPLICIT_ACTIVATION policies.
 *
 * @return the object, exposing the given servant in the context of this POA.
 */
public org.omg.CORBA.Object servant_to_reference(Servant the_Servant)
  throws ServantNotActive, WrongPolicy
{
  required(ServantRetentionPolicyValue.RETAIN);

  AOM.Obj exists = null;

  if (!applies(IdUniquenessPolicyValue.MULTIPLE_ID))
    exists = aom.findServant(the_Servant);

  if (exists != null)
    {
      if (exists.isDeactiveted())
        {
          if (applies(ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION))
            {
              checkDiscarding();
              exists.setDeactivated(false);
              incarnate(exists, exists.key, the_Servant, false);
            }
          else
            throw new ServantNotActive();
        }
      else
        return exists.object;
    }
  if (exists == null
    && applies(ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION))
    {
      checkDiscarding();

      byte[] object_key = AOM.getFreeId();

      ServantDelegateImpl delegate = new ServantDelegateImpl(the_Servant,
        this, object_key);
      create_and_connect(object_key, the_Servant._all_interfaces(this,
        object_key)[0], delegate);

      return delegate.object;
    }
  else
    throw new ServantNotActive();
}
 
Example 59
Project: openjdk-icedtea7   File: POAPolicyMediatorImpl_NR_UDS.java   Source Code and License 4 votes vote down vote up
public byte[] servantToId( Servant servant ) throws ServantNotActive, WrongPolicy
{
    throw new WrongPolicy();
}
 
Example 60
Project: openjdk-icedtea7   File: POAPolicyMediatorImpl_NR_USM.java   Source Code and License 4 votes vote down vote up
public byte[] servantToId( Servant servant ) throws ServantNotActive, WrongPolicy
{
    throw new WrongPolicy();
}