本文整理汇总了Java中org.omg.PortableServer.POAManager类的典型用法代码示例。如果您正苦于以下问题:Java POAManager类的具体用法?Java POAManager怎么用?Java POAManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
POAManager类属于org.omg.PortableServer包,在下文中一共展示了POAManager类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: activateServant
import org.omg.PortableServer.POAManager; //导入依赖的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: shutdown
import org.omg.PortableServer.POAManager; //导入依赖的package包/类
public void shutdown( boolean waitForCompletion )
{
// It is important to copy the list of POAManagers first because
// pm.deactivate removes itself from poaManagers!
Iterator managers = null ;
synchronized (this) {
isShuttingDown = true ;
managers = (new HashSet(poaManagers)).iterator();
}
while ( managers.hasNext() ) {
try {
((POAManager)managers.next()).deactivate(true, waitForCompletion);
} catch ( org.omg.PortableServer.POAManagerPackage.AdapterInactive e ) {}
}
}
示例3: createPoaInstance
import org.omg.PortableServer.POAManager; //导入依赖的package包/类
/**
* Create an instance of the POA with the given features.
* This method is not responsible for duplicate checking
* or adding the returned instance to any possible table.
*
* @param child_name the name of the poa being created.
* @param a_manager the poa manager (never null).
* @param policies the array of policies.
* @param an_orb the ORB for this POA.
*
* @return the created POA.
*
* @throws InvalidPolicy for conflicting or otherwise invalid policies.|
*/
protected POA createPoaInstance(String child_name, POAManager a_manager,
Policy[] policies, ORB_1_4 an_orb
)
throws InvalidPolicy
{
POAManager some_manager =
a_manager == null ? new gnuPOAManager() : a_manager;
if (some_manager instanceof gnuPOAManager)
{
((gnuPOAManager) some_manager).addPoa(this);
}
return new gnuPOA(this, child_name, some_manager, policies, an_orb);
}
示例4: the_POAManager
import org.omg.PortableServer.POAManager; //导入依赖的package包/类
/**
* <code>the_POAManager</code>
* <b>Section 3.3.8.8</b>
*/
public POAManager the_POAManager()
{
try {
lock() ;
return manager;
} finally {
unlock() ;
}
}
示例5: gnuPOA
import org.omg.PortableServer.POAManager; //导入依赖的package包/类
/**
* Create a new abstract POA.
*
* @param a_parent the parent of this POA.
* @param a_name a name for this POA.
* @param a_manager a manager for this POA. If null, a new
* {@link gnuPOAManager} will be instantiated.
* @param a_policies an array of policies that apply to this POA.
* @param an_orb an ORB for this POA.
*/
public gnuPOA(gnuPOA a_parent, String a_name, POAManager a_manager,
Policy[] a_policies, ORB_1_4 an_orb
)
throws InvalidPolicy
{
// Add default policies.
Policy[] all_policies = StandardPolicies.withDefault(a_policies);
name = a_name;
parent = a_parent;
m_orb = an_orb;
if (a_manager != null)
m_manager = a_manager;
else
m_manager = new gnuPOAManager();
if (m_manager instanceof gnuPOAManager)
{
gnuPOAManager g = (gnuPOAManager) m_manager;
g.addPoa(this);
}
m_policies = new HashSet(all_policies.length);
s_policies = new Policy[ all_policies.length ];
for (int i = 0; i < s_policies.length; i++)
{
s_policies [ i ] = all_policies [ i ].copy();
m_policies.add(((AccessiblePolicy) s_policies [ i ]).getValue());
}
retain_servant = applies(ServantRetentionPolicyValue.RETAIN);
validatePolicies(a_policies);
refTemplate = new RefTemplate();
}
示例6: gnuPOA
import org.omg.PortableServer.POAManager; //导入依赖的package包/类
/**
* Create a new abstract POA.
*
* @param a_parent the parent of this POA.
* @param a_name a name for this POA.
* @param a_manager a manager for this POA. If null, a new
* {@link gnuPOAManager} will be instantiated.
* @param a_policies an array of policies that apply to this POA.
* @param an_orb an ORB for this POA.
*/
public gnuPOA(gnuPOA a_parent, String a_name, POAManager a_manager,
Policy[] a_policies, ORB_1_4 an_orb
)
throws InvalidPolicy
{
// Add default policies.
Policy[] all_policies = StandardPolicies.withDefault(a_policies);
name = a_name;
parent = a_parent;
m_orb = an_orb;
if (a_manager != null)
m_manager = a_manager;
else
m_manager = new gnuPOAManager();
if (m_manager instanceof gnuPOAManager)
{
gnuPOAManager g = (gnuPOAManager) m_manager;
g.addPoa(this);
}
m_policies = new HashSet(all_policies.length);
s_policies = new Policy[ all_policies.length ];
for (int i = 0; i < s_policies.length; i++)
{
s_policies [ i ] = all_policies [ i ].copy();
m_policies.add(((AccessiblePolicy) s_policies [ i ]).getValue());
}
retain_servant = applies(ServantRetentionPolicyValue.RETAIN);
validatePolicies(a_policies);
refTemplate = new RefTemplate();
}
示例7: create_POA
import org.omg.PortableServer.POAManager; //导入依赖的package包/类
/**
* <code>create_POA</code>
* <b>Section 3.3.8.2</b>
*/
public POA create_POA(String name, POAManager
theManager, Policy[] policies) throws AdapterAlreadyExists,
InvalidPolicy
{
try {
lock() ;
if (debug) {
ORBUtility.dprint( this, "Calling create_POA(name=" + name +
" theManager=" + theManager + " policies=" + policies +
") on poa " + this ) ;
}
// We cannot create children of a POA that is (being) destroyed.
// This has been added to the CORBA 3.0 spec.
if (state > STATE_RUN)
throw omgLifecycleWrapper().createPoaDestroy() ;
POAImpl poa = (POAImpl)(children.get(name)) ;
if (poa == null) {
poa = new POAImpl( name, this, getORB(), STATE_START ) ;
}
try {
poa.lock() ;
if (debug) {
ORBUtility.dprint( this,
"Calling create_POA: new poa is " + poa ) ;
}
if ((poa.state != STATE_START) && (poa.state != STATE_INIT))
throw new AdapterAlreadyExists();
POAManagerImpl newManager = (POAManagerImpl)theManager ;
if (newManager == null)
newManager = new POAManagerImpl( manager.getFactory(),
manager.getPIHandler() );
int defaultCopierId =
getORB().getCopierManager().getDefaultId() ;
Policies POAPolicies =
new Policies( policies, defaultCopierId ) ;
poa.initialize( newManager, POAPolicies ) ;
return poa;
} finally {
poa.unlock() ;
}
} finally {
unlock() ;
}
}
示例8: removePoaManager
import org.omg.PortableServer.POAManager; //导入依赖的package包/类
public synchronized void removePoaManager( POAManager manager )
{
poaManagers.remove(manager);
}