java类org.omg.CORBA.Policy的实例源码

NamingContextImpl.java 文件源码 项目:OpenJSharp 阅读 25 收藏 0 点赞 0 评论 0
private synchronized void createbiPOA( ) {
    if( biPOA != null ) {
        return;
    }
    try {
        POA rootPOA = (POA) orb.resolve_initial_references(
            ORBConstants.ROOT_POA_NAME );
        rootPOA.the_POAManager().activate( );

        int i = 0;
        Policy[] poaPolicy = new Policy[3];
        poaPolicy[i++] = rootPOA.create_lifespan_policy(
            LifespanPolicyValue.TRANSIENT);
        poaPolicy[i++] = rootPOA.create_id_assignment_policy(
            IdAssignmentPolicyValue.SYSTEM_ID);
        poaPolicy[i++] = rootPOA.create_servant_retention_policy(
            ServantRetentionPolicyValue.RETAIN);
        biPOA = rootPOA.create_POA("BindingIteratorPOA", null, poaPolicy );
        biPOA.the_POAManager().activate( );
    } catch( Exception e ) {
        throw readWrapper.namingCtxBindingIteratorCreate( e ) ;
    }
}
ServerRequestInfoImpl.java 文件源码 项目:OpenJSharp 阅读 21 收藏 0 点赞 0 评论 0
/**
 * Returns the policy in effect for this operation for the given policy
 * type.
 */
public Policy get_server_policy (int type) {
    // access is currently valid for all states:
    //checkAccess( MID_GET_SERVER_POLICY );

    Policy result = null;

    if( objectAdapter != null ) {
        result = objectAdapter.getEffectivePolicy( type );
    }

    // _REVISIT_ RTF Issue: get_server_policy spec not in sync with
    // get_effective_policy spec.

    return result;
}
NamingContextImpl.java 文件源码 项目:openjdk-jdk10 阅读 22 收藏 0 点赞 0 评论 0
private synchronized void createbiPOA( ) {
    if( biPOA != null ) {
        return;
    }
    try {
        POA rootPOA = (POA) orb.resolve_initial_references(
            ORBConstants.ROOT_POA_NAME );
        rootPOA.the_POAManager().activate( );

        int i = 0;
        Policy[] poaPolicy = new Policy[3];
        poaPolicy[i++] = rootPOA.create_lifespan_policy(
            LifespanPolicyValue.TRANSIENT);
        poaPolicy[i++] = rootPOA.create_id_assignment_policy(
            IdAssignmentPolicyValue.SYSTEM_ID);
        poaPolicy[i++] = rootPOA.create_servant_retention_policy(
            ServantRetentionPolicyValue.RETAIN);
        biPOA = rootPOA.create_POA("BindingIteratorPOA", null, poaPolicy );
        biPOA.the_POAManager().activate( );
    } catch( Exception e ) {
        throw readWrapper.namingCtxBindingIteratorCreate( e ) ;
    }
}
ServerRequestInfoImpl.java 文件源码 项目:openjdk-jdk10 阅读 21 收藏 0 点赞 0 评论 0
/**
 * Returns the policy in effect for this operation for the given policy
 * type.
 */
public Policy get_server_policy (int type) {
    // access is currently valid for all states:
    //checkAccess( MID_GET_SERVER_POLICY );

    Policy result = null;

    if( objectAdapter != null ) {
        result = objectAdapter.getEffectivePolicy( type );
    }

    // _REVISIT_ RTF Issue: get_server_policy spec not in sync with
    // get_effective_policy spec.

    return result;
}
NamingContextImpl.java 文件源码 项目:openjdk9 阅读 19 收藏 0 点赞 0 评论 0
private synchronized void createbiPOA( ) {
    if( biPOA != null ) {
        return;
    }
    try {
        POA rootPOA = (POA) orb.resolve_initial_references(
            ORBConstants.ROOT_POA_NAME );
        rootPOA.the_POAManager().activate( );

        int i = 0;
        Policy[] poaPolicy = new Policy[3];
        poaPolicy[i++] = rootPOA.create_lifespan_policy(
            LifespanPolicyValue.TRANSIENT);
        poaPolicy[i++] = rootPOA.create_id_assignment_policy(
            IdAssignmentPolicyValue.SYSTEM_ID);
        poaPolicy[i++] = rootPOA.create_servant_retention_policy(
            ServantRetentionPolicyValue.RETAIN);
        biPOA = rootPOA.create_POA("BindingIteratorPOA", null, poaPolicy );
        biPOA.the_POAManager().activate( );
    } catch( Exception e ) {
        throw readWrapper.namingCtxBindingIteratorCreate( e ) ;
    }
}
ServerRequestInfoImpl.java 文件源码 项目:openjdk9 阅读 21 收藏 0 点赞 0 评论 0
/**
 * Returns the policy in effect for this operation for the given policy
 * type.
 */
public Policy get_server_policy (int type) {
    // access is currently valid for all states:
    //checkAccess( MID_GET_SERVER_POLICY );

    Policy result = null;

    if( objectAdapter != null ) {
        result = objectAdapter.getEffectivePolicy( type );
    }

    // _REVISIT_ RTF Issue: get_server_policy spec not in sync with
    // get_effective_policy spec.

    return result;
}
NamingContextImpl.java 文件源码 项目:lookaside_java-1.8.0-openjdk 阅读 22 收藏 0 点赞 0 评论 0
private synchronized void createbiPOA( ) {
    if( biPOA != null ) {
        return;
    }
    try {
        POA rootPOA = (POA) orb.resolve_initial_references(
            ORBConstants.ROOT_POA_NAME );
        rootPOA.the_POAManager().activate( );

        int i = 0;
        Policy[] poaPolicy = new Policy[3];
        poaPolicy[i++] = rootPOA.create_lifespan_policy(
            LifespanPolicyValue.TRANSIENT);
        poaPolicy[i++] = rootPOA.create_id_assignment_policy(
            IdAssignmentPolicyValue.SYSTEM_ID);
        poaPolicy[i++] = rootPOA.create_servant_retention_policy(
            ServantRetentionPolicyValue.RETAIN);
        biPOA = rootPOA.create_POA("BindingIteratorPOA", null, poaPolicy );
        biPOA.the_POAManager().activate( );
    } catch( Exception e ) {
        throw readWrapper.namingCtxBindingIteratorCreate( e ) ;
    }
}
ServerRequestInfoImpl.java 文件源码 项目:lookaside_java-1.8.0-openjdk 阅读 18 收藏 0 点赞 0 评论 0
/**
 * Returns the policy in effect for this operation for the given policy
 * type.
 */
public Policy get_server_policy (int type) {
    // access is currently valid for all states:
    //checkAccess( MID_GET_SERVER_POLICY );

    Policy result = null;

    if( objectAdapter != null ) {
        result = objectAdapter.getEffectivePolicy( type );
    }

    // _REVISIT_ RTF Issue: get_server_policy spec not in sync with
    // get_effective_policy spec.

    return result;
}
NamingContextImpl.java 文件源码 项目:jdk8u_corba 阅读 22 收藏 0 点赞 0 评论 0
private synchronized void createbiPOA( ) {
    if( biPOA != null ) {
        return;
    }
    try {
        POA rootPOA = (POA) orb.resolve_initial_references(
            ORBConstants.ROOT_POA_NAME );
        rootPOA.the_POAManager().activate( );

        int i = 0;
        Policy[] poaPolicy = new Policy[3];
        poaPolicy[i++] = rootPOA.create_lifespan_policy(
            LifespanPolicyValue.TRANSIENT);
        poaPolicy[i++] = rootPOA.create_id_assignment_policy(
            IdAssignmentPolicyValue.SYSTEM_ID);
        poaPolicy[i++] = rootPOA.create_servant_retention_policy(
            ServantRetentionPolicyValue.RETAIN);
        biPOA = rootPOA.create_POA("BindingIteratorPOA", null, poaPolicy );
        biPOA.the_POAManager().activate( );
    } catch( Exception e ) {
        throw readWrapper.namingCtxBindingIteratorCreate( e ) ;
    }
}
ServerRequestInfoImpl.java 文件源码 项目:jdk8u_corba 阅读 22 收藏 0 点赞 0 评论 0
/**
 * Returns the policy in effect for this operation for the given policy
 * type.
 */
public Policy get_server_policy (int type) {
    // access is currently valid for all states:
    //checkAccess( MID_GET_SERVER_POLICY );

    Policy result = null;

    if( objectAdapter != null ) {
        result = objectAdapter.getEffectivePolicy( type );
    }

    // _REVISIT_ RTF Issue: get_server_policy spec not in sync with
    // get_effective_policy spec.

    return result;
}
gnuPOA.java 文件源码 项目:javify 阅读 23 收藏 0 点赞 0 评论 0
/**
 * 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);
}
gnuPOA.java 文件源码 项目:javify 阅读 25 收藏 0 点赞 0 评论 0
/**
 * 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;
}
gnuPOA.java 文件源码 项目:jvm-stm 阅读 26 收藏 0 点赞 0 评论 0
/**
 * 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);
}
gnuPOA.java 文件源码 项目:jvm-stm 阅读 19 收藏 0 点赞 0 评论 0
/**
 * 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;
}
NamingContextImpl.java 文件源码 项目:infobip-open-jdk-8 阅读 17 收藏 0 点赞 0 评论 0
private synchronized void createbiPOA( ) {
    if( biPOA != null ) {
        return;
    }
    try {
        POA rootPOA = (POA) orb.resolve_initial_references(
            ORBConstants.ROOT_POA_NAME );
        rootPOA.the_POAManager().activate( );

        int i = 0;
        Policy[] poaPolicy = new Policy[3];
        poaPolicy[i++] = rootPOA.create_lifespan_policy(
            LifespanPolicyValue.TRANSIENT);
        poaPolicy[i++] = rootPOA.create_id_assignment_policy(
            IdAssignmentPolicyValue.SYSTEM_ID);
        poaPolicy[i++] = rootPOA.create_servant_retention_policy(
            ServantRetentionPolicyValue.RETAIN);
        biPOA = rootPOA.create_POA("BindingIteratorPOA", null, poaPolicy );
        biPOA.the_POAManager().activate( );
    } catch( Exception e ) {
        throw readWrapper.namingCtxBindingIteratorCreate( e ) ;
    }
}
ServerRequestInfoImpl.java 文件源码 项目:infobip-open-jdk-8 阅读 24 收藏 0 点赞 0 评论 0
/**
 * Returns the policy in effect for this operation for the given policy
 * type.
 */
public Policy get_server_policy (int type) {
    // access is currently valid for all states:
    //checkAccess( MID_GET_SERVER_POLICY );

    Policy result = null;

    if( objectAdapter != null ) {
        result = objectAdapter.getEffectivePolicy( type );
    }

    // _REVISIT_ RTF Issue: get_server_policy spec not in sync with
    // get_effective_policy spec.

    return result;
}
NamingContextImpl.java 文件源码 项目:openjdk-source-code-learn 阅读 26 收藏 0 点赞 0 评论 0
private synchronized void createbiPOA( ) {
    if( biPOA != null ) {
        return;
    }
    try {
        POA rootPOA = (POA) orb.resolve_initial_references(
            ORBConstants.ROOT_POA_NAME );
        rootPOA.the_POAManager().activate( );

        int i = 0;
        Policy[] poaPolicy = new Policy[3];
        poaPolicy[i++] = rootPOA.create_lifespan_policy(
            LifespanPolicyValue.TRANSIENT);
        poaPolicy[i++] = rootPOA.create_id_assignment_policy(
            IdAssignmentPolicyValue.SYSTEM_ID);
        poaPolicy[i++] = rootPOA.create_servant_retention_policy(
            ServantRetentionPolicyValue.RETAIN);
        biPOA = rootPOA.create_POA("BindingIteratorPOA", null, poaPolicy );
        biPOA.the_POAManager().activate( );
    } catch( Exception e ) {
        throw readWrapper.namingCtxBindingIteratorCreate( e ) ;
    }
}
ServerRequestInfoImpl.java 文件源码 项目:openjdk-source-code-learn 阅读 24 收藏 0 点赞 0 评论 0
/**
 * Returns the policy in effect for this operation for the given policy
 * type.
 */
public Policy get_server_policy (int type) {
    // access is currently valid for all states:
    //checkAccess( MID_GET_SERVER_POLICY );

    Policy result = null;

    if( objectAdapter != null ) {
        result = objectAdapter.getEffectivePolicy( type );
    }

    // _REVISIT_ RTF Issue: get_server_policy spec not in sync with
    // get_effective_policy spec.

    return result;
}
NamingContextImpl.java 文件源码 项目:OLD-OpenJDK8 阅读 22 收藏 0 点赞 0 评论 0
private synchronized void createbiPOA( ) {
    if( biPOA != null ) {
        return;
    }
    try {
        POA rootPOA = (POA) orb.resolve_initial_references(
            ORBConstants.ROOT_POA_NAME );
        rootPOA.the_POAManager().activate( );

        int i = 0;
        Policy[] poaPolicy = new Policy[3];
        poaPolicy[i++] = rootPOA.create_lifespan_policy(
            LifespanPolicyValue.TRANSIENT);
        poaPolicy[i++] = rootPOA.create_id_assignment_policy(
            IdAssignmentPolicyValue.SYSTEM_ID);
        poaPolicy[i++] = rootPOA.create_servant_retention_policy(
            ServantRetentionPolicyValue.RETAIN);
        biPOA = rootPOA.create_POA("BindingIteratorPOA", null, poaPolicy );
        biPOA.the_POAManager().activate( );
    } catch( Exception e ) {
        throw readWrapper.namingCtxBindingIteratorCreate( e ) ;
    }
}
ServerRequestInfoImpl.java 文件源码 项目:OLD-OpenJDK8 阅读 25 收藏 0 点赞 0 评论 0
/**
 * Returns the policy in effect for this operation for the given policy
 * type.
 */
public Policy get_server_policy (int type) {
    // access is currently valid for all states:
    //checkAccess( MID_GET_SERVER_POLICY );

    Policy result = null;

    if( objectAdapter != null ) {
        result = objectAdapter.getEffectivePolicy( type );
    }

    // _REVISIT_ RTF Issue: get_server_policy spec not in sync with
    // get_effective_policy spec.

    return result;
}
gnuPOA.java 文件源码 项目:JamVM-PH 阅读 29 收藏 0 点赞 0 评论 0
/**
 * 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);
}
gnuPOA.java 文件源码 项目:JamVM-PH 阅读 23 收藏 0 点赞 0 评论 0
/**
 * 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;
}
NamingContextImpl.java 文件源码 项目:openjdk-orb 阅读 25 收藏 0 点赞 0 评论 0
private synchronized void createbiPOA( ) {
    if( biPOA != null ) {
        return;
    }
    try {
        POA rootPOA = (POA) orb.resolve_initial_references(
            ORBConstants.ROOT_POA_NAME );
        rootPOA.the_POAManager().activate( );

        int i = 0;
        Policy[] poaPolicy = new Policy[3];
        poaPolicy[i++] = rootPOA.create_lifespan_policy(
            LifespanPolicyValue.TRANSIENT);
        poaPolicy[i++] = rootPOA.create_id_assignment_policy(
            IdAssignmentPolicyValue.SYSTEM_ID);
        poaPolicy[i++] = rootPOA.create_servant_retention_policy(
            ServantRetentionPolicyValue.RETAIN);
        biPOA = rootPOA.create_POA("BindingIteratorPOA", null, poaPolicy );
        biPOA.the_POAManager().activate( );
    } catch( Exception e ) {
        throw readWrapper.namingCtxBindingIteratorCreate( e ) ;
    }
}
ServerRequestInfoImpl.java 文件源码 项目:openjdk-orb 阅读 24 收藏 0 点赞 0 评论 0
/**
 * Returns the policy in effect for this operation for the given policy
 * type.
 */
public Policy get_server_policy (int type) {
    // access is currently valid for all states:
    //checkAccess( MID_GET_SERVER_POLICY );

    Policy result = null;

    if( objectAdapter != null ) {
        result = objectAdapter.getEffectivePolicy( type );
    }

    // _REVISIT_ RTF Issue: get_server_policy spec not in sync with
    // get_effective_policy spec.

    return result;
}
gnuPOA.java 文件源码 项目:classpath 阅读 24 收藏 0 点赞 0 评论 0
/**
 * 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);
}
gnuPOA.java 文件源码 项目:classpath 阅读 22 收藏 0 点赞 0 评论 0
/**
 * 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;
}
NamingContextImpl.java 文件源码 项目:openjdk-icedtea7 阅读 25 收藏 0 点赞 0 评论 0
private synchronized void createbiPOA( ) {
    if( biPOA != null ) {
        return;
    }
    try {
        POA rootPOA = (POA) orb.resolve_initial_references(
            ORBConstants.ROOT_POA_NAME );
        rootPOA.the_POAManager().activate( );

        int i = 0;
        Policy[] poaPolicy = new Policy[3];
        poaPolicy[i++] = rootPOA.create_lifespan_policy(
            LifespanPolicyValue.TRANSIENT);
        poaPolicy[i++] = rootPOA.create_id_assignment_policy(
            IdAssignmentPolicyValue.SYSTEM_ID);
        poaPolicy[i++] = rootPOA.create_servant_retention_policy(
            ServantRetentionPolicyValue.RETAIN);
        biPOA = rootPOA.create_POA("BindingIteratorPOA", null, poaPolicy );
        biPOA.the_POAManager().activate( );
    } catch( Exception e ) {
        throw readWrapper.namingCtxBindingIteratorCreate( e ) ;
    }
}
ServerRequestInfoImpl.java 文件源码 项目:openjdk-icedtea7 阅读 27 收藏 0 点赞 0 评论 0
/**
 * Returns the policy in effect for this operation for the given policy
 * type.
 */
public Policy get_server_policy (int type) {
    // access is currently valid for all states:
    //checkAccess( MID_GET_SERVER_POLICY );

    Policy result = null;

    if( objectAdapter != null ) {
        result = objectAdapter.getEffectivePolicy( type );
    }

    // _REVISIT_ RTF Issue: get_server_policy spec not in sync with
    // get_effective_policy spec.

    return result;
}
PolicyContext.java 文件源码 项目:TIDorbJ 阅读 24 收藏 0 点赞 0 评论 0
/**
 *  Reads the policies as a pair PolicyType/encapsuled policy data
 * @param input
 */
public void partialRead(CDRInputStream input)
{        
    int size = input.read_ulong();

    Policy policy = null;
    for (int i = 0; i< size; i++) {
        policy = PolicyFactory.readPolicy(input);
        if(policy != null) {            
            try {
                setPolicy(policy);
            }
            catch (PolicyError e) {//unreachable
            }
        }
    }        
}
IIOPServerManager.java 文件源码 项目:kuzoff 阅读 20 收藏 0 点赞 0 评论 0
public void start(String[] args) throws Exception {
    Properties p = System.getProperties();
    p.put("org.omg.CORBA.ORBClass", "com.sun.corba.se.internal.POA.POAORB");
    p.put("org.omg.CORBA.ORBSingletonClass", "com.sun.corba.se.internal.corba.ORBSingleton");

    ORB orb = ORB.init(args, p);

    POA rootPOA = (POA) orb.resolve_initial_references("RootPOA");

    Policy[] tpolicy = new Policy[3];
    tpolicy[0] = rootPOA.create_lifespan_policy(LifespanPolicyValue.TRANSIENT);
    tpolicy[1] = rootPOA.create_request_processing_policy(RequestProcessingPolicyValue.USE_ACTIVE_OBJECT_MAP_ONLY);
    tpolicy[2] = rootPOA.create_servant_retention_policy(ServantRetentionPolicyValue.RETAIN);
    POA tPOA = rootPOA.create_POA("MyTransientPOA", null, tpolicy);

    tPOA.the_POAManager().activate();
    Tie tie = (Tie) Util.getTie(remoteDatabaseManager);
    byte[] id = "db".getBytes();
    tPOA.activate_object_with_id(id, (Servant) tie);

    Context initialNamingContext = new InitialContext();
    initialNamingContext.rebind("DatabaseService", tPOA.create_reference_with_id(id, ((Servant) tie)._all_interfaces(tPOA, id)[0]));
    System.out.println("Database Server: Ready...");

    orb.run();
}


问题


面经


文章

微信
公众号

扫码关注公众号