当前位置: 首页>>代码示例>>Java>>正文


Java InvalidPolicy类代码示例

本文整理汇总了Java中org.omg.PortableServer.POAPackage.InvalidPolicy的典型用法代码示例。如果您正苦于以下问题:Java InvalidPolicy类的具体用法?Java InvalidPolicy怎么用?Java InvalidPolicy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


InvalidPolicy类属于org.omg.PortableServer.POAPackage包,在下文中一共展示了InvalidPolicy类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createPoaInstance

import org.omg.PortableServer.POAPackage.InvalidPolicy; //导入依赖的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);
}
 
开发者ID:vilie,项目名称:javify,代码行数:30,代码来源:gnuPOA.java

示例2: validatePolicies

import org.omg.PortableServer.POAPackage.InvalidPolicy; //导入依赖的package包/类
/**
 * Check if the policy set is valid.
 */
protected boolean validatePolicies(Policy[] a)
                            throws InvalidPolicy
{
  if (applies(ServantRetentionPolicyValue.NON_RETAIN))
    {
      if (!applies(RequestProcessingPolicyValue.USE_DEFAULT_SERVANT) &&
          !applies(RequestProcessingPolicyValue.USE_SERVANT_MANAGER)
         )
        {
          short p = 0;
          for (short i = 0; i < a.length; i++)
            {
              if (a [ i ].policy_type() == SERVANT_RETENTION_POLICY_ID.value)
                p = i;
            }
          throw new InvalidPolicy("NON_RETAIN requires either " +
                                  "USE_DEFAULT_SERVANT or USE_SERVANT_MANAGER",
                                  p
                                 );
        }
    }
  return true;
}
 
开发者ID:vilie,项目名称:javify,代码行数:27,代码来源:gnuPOA.java

示例3: ORB_1_4

import org.omg.PortableServer.POAPackage.InvalidPolicy; //导入依赖的package包/类
/**
 * Calls the parent constructor and additionally puts the "RootPOA",
 * "RootPOAManager", "POACurrent" and "DynAnyFactory" into initial references.
 */
public ORB_1_4()
{
  super();
  try
    {
      rootPOA = new gnuPOA(null, "RootPOA", null, StandardPolicies.rootPoa(), this);
    }
  catch (InvalidPolicy ex)
    {
      // Invalid default policy set.
      InternalError ierr = new InternalError();
      ierr.initCause(ex);
      throw ierr;
    }
  initial_references.put("RootPOA", rootPOA);
  initial_references.put("RootPOAManager", rootPOA.the_POAManager());
  initial_references.put("POACurrent", currents);
  initial_references.put("DynAnyFactory", factory);
  initial_references.put("PICurrent", ic_current);
}
 
开发者ID:vilie,项目名称:javify,代码行数:25,代码来源:ORB_1_4.java

示例4: gnuPOA

import org.omg.PortableServer.POAPackage.InvalidPolicy; //导入依赖的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();
}
 
开发者ID:vilie,项目名称:javify,代码行数:49,代码来源:gnuPOA.java

示例5: gnuPOA

import org.omg.PortableServer.POAPackage.InvalidPolicy; //导入依赖的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();
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:49,代码来源:gnuPOA.java

示例6: create_POA

import org.omg.PortableServer.POAPackage.InvalidPolicy; //导入依赖的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() ;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:60,代码来源:POAImpl.java

示例7: create_POA

import org.omg.PortableServer.POAPackage.InvalidPolicy; //导入依赖的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;
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:36,代码来源:gnuPOA.java

示例8: create_POA

import org.omg.PortableServer.POAPackage.InvalidPolicy; //导入依赖的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;
 
开发者ID:vilie,项目名称:javify,代码行数:27,代码来源:POAOperations.java

示例9: InvalidPolicyHolder

import org.omg.PortableServer.POAPackage.InvalidPolicy; //导入依赖的package包/类
/**
 * Create the initialised instance.
 * @param initialValue the value that will be assigned to
 * the <code>value</code> field.
 */
public InvalidPolicyHolder(InvalidPolicy initialValue)
{
  value = initialValue;
}
 
开发者ID:vilie,项目名称:javify,代码行数:10,代码来源:InvalidPolicyHolder.java


注:本文中的org.omg.PortableServer.POAPackage.InvalidPolicy类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。