本文整理汇总了Java中org.omg.PortableServer.Servant类的典型用法代码示例。如果您正苦于以下问题:Java Servant类的具体用法?Java Servant怎么用?Java Servant使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Servant类属于org.omg.PortableServer包,在下文中一共展示了Servant类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: activateTie
import org.omg.PortableServer.Servant; //导入依赖的package包/类
/** Given any Tie, return the corresponding object refernce, activating
* the Servant if necessary.
*/
public static org.omg.CORBA.Object activateTie( Tie tie )
{
/** Any implementation of Tie should be either a Servant or an ObjectImpl,
* depending on which style of code generation is used. rmic -iiop by
* default results in an ObjectImpl-based Tie, while rmic -iiop -poa
* results in a Servant-based Tie. Dynamic RMI-IIOP also uses Servant-based
* Ties (see impl.presentation.rmi.ReflectiveTie).
*/
if (tie instanceof ObjectImpl) {
return tie.thisObject() ;
} else if (tie instanceof Servant) {
Servant servant = (Servant)tie ;
return activateServant( servant ) ;
} else {
throw wrapper.badActivateTieCall() ;
}
}
示例2: set_servant
import org.omg.PortableServer.Servant; //导入依赖的package包/类
/**
* <code>set_servant</code>
* <b>Section 3.3.8.13</b>
*/
public void set_servant(Servant defaultServant)
throws WrongPolicy
{
try {
lock() ;
if (debug) {
ORBUtility.dprint( this, "Calling set_servant on poa " +
this + " defaultServant=" + defaultServant ) ;
}
mediator.setDefaultServant( defaultServant ) ;
} finally {
unlock() ;
}
}
示例3: servant_to_reference
import org.omg.PortableServer.Servant; //导入依赖的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: reference_to_servant
import org.omg.PortableServer.Servant; //导入依赖的package包/类
/**
* <code>reference_to_servant</code>
* <b>3.3.8.21</b>
*/
public Servant reference_to_servant(org.omg.CORBA.Object reference)
throws ObjectNotActive, WrongPolicy, WrongAdapter
{
try {
lock() ;
if (debug) {
ORBUtility.dprint( this,
"Calling reference_to_servant(reference=" +
reference + ") on poa " + this ) ;
}
if ( state >= STATE_DESTROYING ) {
throw lifecycleWrapper().adapterDestroyed() ;
}
// reference_to_id should throw WrongAdapter
// if the objref was not created by this POA
byte [] id = internalReferenceToId(reference);
return mediator.idToServant( id ) ;
} finally {
unlock() ;
}
}
示例5: id_to_reference
import org.omg.PortableServer.Servant; //导入依赖的package包/类
/**
* <code>id_to_reference</code>
* <b>3.3.8.24</b>
*/
public org.omg.CORBA.Object id_to_reference(byte[] id)
throws ObjectNotActive, WrongPolicy
{
try {
lock() ;
if (debug) {
ORBUtility.dprint( this, "Calling id_to_reference(id=" +
id + ") on poa " + this ) ;
}
if( state >= STATE_DESTROYING ) {
throw lifecycleWrapper().adapterDestroyed() ;
}
Servant s = mediator.idToServant( id ) ;
String repId = s._all_interfaces( this, id )[0] ;
return makeObject(repId, id );
} finally {
unlock() ;
}
}
示例6: activateServant
import org.omg.PortableServer.Servant; //导入依赖的package包/类
protected void activateServant( ActiveObjectMap.Key key, AOMEntry entry, Servant servant )
{
setDelegate(servant, key.id );
if (orb.shutdownDebugFlag) {
System.out.println("Activating object " + servant +
" with POA " + poa);
}
activeObjectMap.putServant( servant, entry ) ;
if (Util.isInstanceDefined()) {
POAManagerImpl pm = (POAManagerImpl)poa.the_POAManager() ;
POAFactory factory = pm.getFactory() ;
factory.registerPOAForServant(poa, servant);
}
}
示例7: activateServant
import org.omg.PortableServer.Servant; //导入依赖的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 ;
}
示例8: deactivateHelper
import org.omg.PortableServer.Servant; //导入依赖的package包/类
protected void deactivateHelper( ActiveObjectMap.Key key, AOMEntry entry,
Servant s ) throws ObjectNotActive, WrongPolicy
{
// Default does nothing, but the USE_SERVANT_MANAGER case
// must handle etherealization
activeObjectMap.remove(key);
if (Util.isInstanceDefined()) {
POAManagerImpl pm = (POAManagerImpl)poa.the_POAManager() ;
POAFactory factory = pm.getFactory() ;
factory.unregisterPOAForServant(poa, s);
}
}
示例9: internalKeyToServant
import org.omg.PortableServer.Servant; //导入依赖的package包/类
protected Servant internalKeyToServant( ActiveObjectMap.Key key )
{
AOMEntry entry = activeObjectMap.get(key);
if (entry == null)
return null ;
return activeObjectMap.getServant( entry ) ;
}
示例10: preinvoke
import org.omg.PortableServer.Servant; //导入依赖的package包/类
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;
}
示例11: idToServant
import org.omg.PortableServer.Servant; //导入依赖的package包/类
public Servant idToServant( byte[] id )
throws WrongPolicy, ObjectNotActive
{
if (defaultServant != null)
return defaultServant;
throw new ObjectNotActive() ;
}
示例12: activate_object
import org.omg.PortableServer.Servant; //导入依赖的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() ;
}
}
示例13: activate_object_with_id
import org.omg.PortableServer.Servant; //导入依赖的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() ;
}
}
示例14: remove
import org.omg.PortableServer.Servant; //导入依赖的package包/类
public final void remove( Key key )
{
AOMEntry entry = (AOMEntry)keyToEntry.remove( key ) ;
Servant servant = (Servant)entryToServant.remove( entry ) ;
if (servant != null)
servantToEntry.remove( servant ) ;
removeEntry( entry, key ) ;
}
示例15: getServant
import org.omg.PortableServer.Servant; //导入依赖的package包/类
Servant getServant()
{
Servant servant = (Servant)(peekThrowInternal().getServantContainer());
// If is OK for the servant to be null.
// This could happen if POAImpl.getServant is called but
// POAImpl.internalGetServant throws an exception.
return servant;
}