本文整理汇总了Java中org.omg.PortableServer.POAPackage.ObjectAlreadyActive类的典型用法代码示例。如果您正苦于以下问题:Java ObjectAlreadyActive类的具体用法?Java ObjectAlreadyActive怎么用?Java ObjectAlreadyActive使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ObjectAlreadyActive类属于org.omg.PortableServer.POAPackage包,在下文中一共展示了ObjectAlreadyActive类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: activate_object
import org.omg.PortableServer.POAPackage.ObjectAlreadyActive; //导入依赖的package包/类
/**
* <code>activate_object</code>
* <b>Section 3.3.8.14</b>
*/
public byte[] activate_object(Servant servant)
throws ServantAlreadyActive, WrongPolicy
{
try {
lock() ;
if (debug) {
ORBUtility.dprint( this,
"Calling activate_object on poa " + this +
" (servant=" + servant + ")" ) ;
}
// Allocate a new system-generated object-id.
// This will throw WrongPolicy if not SYSTEM_ID
// policy.
byte[] id = mediator.newSystemId();
try {
mediator.activateObject( id, servant ) ;
} catch (ObjectAlreadyActive oaa) {
// This exception can not occur in this case,
// since id is always brand new.
//
}
return id ;
} finally {
if (debug) {
ORBUtility.dprint( this,
"Exiting activate_object on poa " + this ) ;
}
unlock() ;
}
}
示例2: activate_object_with_id
import org.omg.PortableServer.POAPackage.ObjectAlreadyActive; //导入依赖的package包/类
/**
* <code>activate_object_with_id</code>
* <b>Section 3.3.8.15</b>
*/
public void activate_object_with_id(byte[] id,
Servant servant)
throws ObjectAlreadyActive, ServantAlreadyActive, WrongPolicy
{
try {
lock() ;
if (debug) {
ORBUtility.dprint( this,
"Calling activate_object_with_id on poa " + this +
" (servant=" + servant + " id=" + id + ")" ) ;
}
// Clone the id to avoid possible errors due to aliasing
// (e.g. the client passes the id in and then changes it later).
byte[] idClone = (byte[])(id.clone()) ;
mediator.activateObject( idClone, servant ) ;
} finally {
if (debug) {
ORBUtility.dprint( this,
"Exiting activate_object_with_id on poa " + this ) ;
}
unlock() ;
}
}
示例3: activateObject
import org.omg.PortableServer.POAPackage.ObjectAlreadyActive; //导入依赖的package包/类
public final void activateObject(byte[] id, Servant servant)
throws WrongPolicy, ServantAlreadyActive, ObjectAlreadyActive
{
if (isUnique && activeObjectMap.contains(servant))
throw new ServantAlreadyActive();
ActiveObjectMap.Key key = new ActiveObjectMap.Key( id ) ;
AOMEntry entry = activeObjectMap.get( key ) ;
// Check for an ObjectAlreadyActive error
entry.activateObject() ;
activateServant( key, entry, servant ) ;
}
示例4: activateObject
import org.omg.PortableServer.POAPackage.ObjectAlreadyActive; //导入依赖的package包/类
public void activateObject() throws ObjectAlreadyActive {
try {
doIt( ACTIVATE ) ;
} catch (RuntimeException exc) {
Throwable thr = exc.getCause() ;
if (thr instanceof ObjectAlreadyActive)
throw (ObjectAlreadyActive)thr ;
else
throw exc ;
}
}