本文整理汇总了Java中org.omg.PortableServer.POAPackage.AdapterAlreadyExists类的典型用法代码示例。如果您正苦于以下问题:Java AdapterAlreadyExists类的具体用法?Java AdapterAlreadyExists怎么用?Java AdapterAlreadyExists使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AdapterAlreadyExists类属于org.omg.PortableServer.POAPackage包,在下文中一共展示了AdapterAlreadyExists类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create_POA
import org.omg.PortableServer.POAPackage.AdapterAlreadyExists; //导入依赖的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() ;
}
}
示例2: create_POA
import org.omg.PortableServer.POAPackage.AdapterAlreadyExists; //导入依赖的package包/类
/**
* Creates a new POA as a child of the target POA.
*
* @param child_name the name of the child POA being created.
* @param manager the manager that will control the new POA. If this parameter
* is null, a new POA manager is created and associated with the new POA.
*
* @param policies the policies, applicable for the parent POA. Policies
* are <i>not</i> inherited from the parent POA.
*
* @return an newly created POA. The POA will be intially in the holding
* state and must be activated to start processing requests.
*
* @throws AdapterAlreadyExists if the child with the given child_name
* already exists for the current POA.
* @throws InvalidPolicy if the policies conflict with each other or are
* otherwise inappropriate.
*
* @see #the_children()
*/
public POA create_POA(String child_name, POAManager manager, Policy[] policies)
throws AdapterAlreadyExists, InvalidPolicy
{
POA child;
for (int i = 0; i < children.size(); i++)
{
child = (POA) children.get(i);
if (child.the_name().equals(child_name))
throw new AdapterAlreadyExists(name + "/" + child_name);
}
POA poa = createPoaInstance(child_name, manager, policies, m_orb);
children.add(poa);
return poa;
}
示例3: create_POA
import org.omg.PortableServer.POAPackage.AdapterAlreadyExists; //导入依赖的package包/类
/**
* Creates a new POA as a child of the target POA.
*
* @param child_name the name of the child POA being created.
* @param manager the manager that will control the new POA. If this parameter
* is null, a new POA manager is created and associated with the new POA.
*
* @param policies the policies, applicable for the parent POA. Policies
* are <i>not</i> inherited from the parent POA. If some policy type
* is missing in the array (or the zero size array is passed), the missing
* policies obtain the default values from the table, specified
* in the {@link POA} documentation header.
*
* @return an newly created POA. The POA will be intially in the holding
* state and must be activated to start processing requests.
*
* @throws AdapterAlreadyExists if the child with the given child_name
* already exists for the current POA.
* @throws InvalidPolicy if the policies conflict with each other or are
* otherwise inappropriate.
*
* @see POA for the list of required policies.
* @see #the_children()
*/
POA create_POA(String child_name, POAManager manager, Policy[] policies)
throws AdapterAlreadyExists, InvalidPolicy;