本文整理汇总了Java中org.omg.PortableServer.POAPackage.ServantNotActive类的典型用法代码示例。如果您正苦于以下问题:Java ServantNotActive类的具体用法?Java ServantNotActive怎么用?Java ServantNotActive使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ServantNotActive类属于org.omg.PortableServer.POAPackage包,在下文中一共展示了ServantNotActive类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: activateServant
import org.omg.PortableServer.POAPackage.ServantNotActive; //导入依赖的package包/类
/** 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 ;
}
示例2: servant_to_id
import org.omg.PortableServer.POAPackage.ServantNotActive; //导入依赖的package包/类
/**
* <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() ;
}
}
示例3: servant_to_reference
import org.omg.PortableServer.POAPackage.ServantNotActive; //导入依赖的package包/类
/**
* <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() ;
}
}
示例4: servant_to_id
import org.omg.PortableServer.POAPackage.ServantNotActive; //导入依赖的package包/类
/**
* 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."
);
}
示例5: servant_to_id
import org.omg.PortableServer.POAPackage.ServantNotActive; //导入依赖的package包/类
/**
* 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."
);
}
示例6: setup
import org.omg.PortableServer.POAPackage.ServantNotActive; //导入依赖的package包/类
/**
* @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;
}
示例7: servantToId
import org.omg.PortableServer.POAPackage.ServantNotActive; //导入依赖的package包/类
public byte[] servantToId( Servant servant ) throws ServantNotActive, WrongPolicy
{
throw new WrongPolicy();
}