Java Code Examples for org.omg.CORBA.Policy

The following are top voted examples for showing how to use org.omg.CORBA.Policy. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: OpenJSharp   File: NamingContextImpl.java   View source code 6 votes vote down vote up
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 ) ;
    }
}
 
Example 2
Project: OpenJSharp   File: ServerRequestInfoImpl.java   View source code 6 votes vote down vote up
/**
 * 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;
}
 
Example 3
Project: openjdk-jdk10   File: NamingContextImpl.java   View source code 6 votes vote down vote up
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 ) ;
    }
}
 
Example 4
Project: openjdk-jdk10   File: ServerRequestInfoImpl.java   View source code 6 votes vote down vote up
/**
 * 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;
}
 
Example 5
Project: openjdk9   File: NamingContextImpl.java   View source code 6 votes vote down vote up
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 ) ;
    }
}
 
Example 6
Project: openjdk9   File: ServerRequestInfoImpl.java   View source code 6 votes vote down vote up
/**
 * 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;
}
 
Example 7
Project: lookaside_java-1.8.0-openjdk   File: NamingContextImpl.java   View source code 6 votes vote down vote up
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 ) ;
    }
}
 
Example 8
Project: lookaside_java-1.8.0-openjdk   File: ServerRequestInfoImpl.java   View source code 6 votes vote down vote up
/**
 * 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;
}
 
Example 9
Project: jdk8u_corba   File: NamingContextImpl.java   View source code 6 votes vote down vote up
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 ) ;
    }
}
 
Example 10
Project: jdk8u_corba   File: ServerRequestInfoImpl.java   View source code 6 votes vote down vote up
/**
 * 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;
}
 
Example 11
Project: javify   File: gnuPOA.java   View source code 6 votes vote down vote up
/**
 * 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);
}
 
Example 12
Project: javify   File: gnuPOA.java   View source code 6 votes vote down vote up
/**
 * 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;
}
 
Example 13
Project: jvm-stm   File: gnuPOA.java   View source code 6 votes vote down vote up
/**
 * 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);
}
 
Example 14
Project: jvm-stm   File: gnuPOA.java   View source code 6 votes vote down vote up
/**
 * 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;
}
 
Example 15
Project: infobip-open-jdk-8   File: NamingContextImpl.java   View source code 6 votes vote down vote up
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 ) ;
    }
}
 
Example 16
Project: infobip-open-jdk-8   File: ServerRequestInfoImpl.java   View source code 6 votes vote down vote up
/**
 * 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;
}
 
Example 17
Project: openjdk-source-code-learn   File: NamingContextImpl.java   View source code 6 votes vote down vote up
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 ) ;
    }
}
 
Example 18
Project: openjdk-source-code-learn   File: ServerRequestInfoImpl.java   View source code 6 votes vote down vote up
/**
 * 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;
}
 
Example 19
Project: OLD-OpenJDK8   File: NamingContextImpl.java   View source code 6 votes vote down vote up
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 ) ;
    }
}
 
Example 20
Project: OLD-OpenJDK8   File: ServerRequestInfoImpl.java   View source code 6 votes vote down vote up
/**
 * 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;
}
 
Example 21
Project: JamVM-PH   File: gnuPOA.java   View source code 6 votes vote down vote up
/**
 * 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);
}
 
Example 22
Project: JamVM-PH   File: gnuPOA.java   View source code 6 votes vote down vote up
/**
 * 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;
}
 
Example 23
Project: openjdk-orb   File: NamingContextImpl.java   View source code 6 votes vote down vote up
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 ) ;
    }
}
 
Example 24
Project: openjdk-orb   File: ServerRequestInfoImpl.java   View source code 6 votes vote down vote up
/**
 * 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;
}
 
Example 25
Project: classpath   File: gnuPOA.java   View source code 6 votes vote down vote up
/**
 * 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);
}
 
Example 26
Project: classpath   File: gnuPOA.java   View source code 6 votes vote down vote up
/**
 * 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;
}
 
Example 27
Project: openjdk-icedtea7   File: NamingContextImpl.java   View source code 6 votes vote down vote up
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 ) ;
    }
}
 
Example 28
Project: openjdk-icedtea7   File: ServerRequestInfoImpl.java   View source code 6 votes vote down vote up
/**
 * 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;
}
 
Example 29
Project: TIDorbJ   File: PolicyContext.java   View source code 6 votes vote down vote up
/**
 *  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
            }
        }
    }        
}
 
Example 30
Project: kuzoff   File: IIOPServerManager.java   View source code 6 votes vote down vote up
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();
}
 
Example 31
Project: OpenJSharp   File: ORBInitInfoImpl.java   View source code 5 votes vote down vote up
public void add_client_request_interceptor_with_policy (
    ClientRequestInterceptor interceptor, Policy[] policies )
    throws DuplicateName
{
    // XXX ignore policies for now
    add_client_request_interceptor( interceptor ) ;
}
 
Example 32
Project: OpenJSharp   File: ORBInitInfoImpl.java   View source code 5 votes vote down vote up
public void add_server_request_interceptor_with_policy (
    ServerRequestInterceptor interceptor, Policy[] policies )
    throws DuplicateName, PolicyError
{
    // XXX ignore policies for now
    add_server_request_interceptor( interceptor ) ;
}
 
Example 33
Project: OpenJSharp   File: ORBInitInfoImpl.java   View source code 5 votes vote down vote up
public void add_ior_interceptor_with_policy (
    IORInterceptor interceptor, Policy[] policies )
    throws DuplicateName, PolicyError
{
    // XXX ignore policies for now
    add_ior_interceptor( interceptor ) ;
}
 
Example 34
Project: openjdk-jdk10   File: ORBInitInfoImpl.java   View source code 5 votes vote down vote up
public void add_client_request_interceptor_with_policy (
    ClientRequestInterceptor interceptor, Policy[] policies )
    throws DuplicateName
{
    // XXX ignore policies for now
    add_client_request_interceptor( interceptor ) ;
}
 
Example 35
Project: openjdk-jdk10   File: ORBInitInfoImpl.java   View source code 5 votes vote down vote up
public void add_server_request_interceptor_with_policy (
    ServerRequestInterceptor interceptor, Policy[] policies )
    throws DuplicateName, PolicyError
{
    // XXX ignore policies for now
    add_server_request_interceptor( interceptor ) ;
}
 
Example 36
Project: openjdk-jdk10   File: ORBInitInfoImpl.java   View source code 5 votes vote down vote up
public void add_ior_interceptor_with_policy (
    IORInterceptor interceptor, Policy[] policies )
    throws DuplicateName, PolicyError
{
    // XXX ignore policies for now
    add_ior_interceptor( interceptor ) ;
}
 
Example 37
Project: openjdk9   File: ORBInitInfoImpl.java   View source code 5 votes vote down vote up
public void add_client_request_interceptor_with_policy (
    ClientRequestInterceptor interceptor, Policy[] policies )
    throws DuplicateName
{
    // XXX ignore policies for now
    add_client_request_interceptor( interceptor ) ;
}
 
Example 38
Project: openjdk9   File: ORBInitInfoImpl.java   View source code 5 votes vote down vote up
public void add_server_request_interceptor_with_policy (
    ServerRequestInterceptor interceptor, Policy[] policies )
    throws DuplicateName, PolicyError
{
    // XXX ignore policies for now
    add_server_request_interceptor( interceptor ) ;
}
 
Example 39
Project: openjdk9   File: ORBInitInfoImpl.java   View source code 5 votes vote down vote up
public void add_ior_interceptor_with_policy (
    IORInterceptor interceptor, Policy[] policies )
    throws DuplicateName, PolicyError
{
    // XXX ignore policies for now
    add_ior_interceptor( interceptor ) ;
}
 
Example 40
Project: lookaside_java-1.8.0-openjdk   File: ORBInitInfoImpl.java   View source code 5 votes vote down vote up
public void add_client_request_interceptor_with_policy (
    ClientRequestInterceptor interceptor, Policy[] policies )
    throws DuplicateName
{
    // XXX ignore policies for now
    add_client_request_interceptor( interceptor ) ;
}