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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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 41
Project: lookaside_java-1.8.0-openjdk   File: ORBInitInfoImpl.java   Source Code and License 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 42
Project: lookaside_java-1.8.0-openjdk   File: ORBInitInfoImpl.java   Source Code and License 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 43
Project: jdk8u_corba   File: ORBInitInfoImpl.java   Source Code and License 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 44
Project: jdk8u_corba   File: ORBInitInfoImpl.java   Source Code and License 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 45
Project: jdk8u_corba   File: ORBInitInfoImpl.java   Source Code and License 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 46
Project: javify   File: LocalObject.java   Source Code and License 5 votes vote down vote up
/**
 * This method is not appropriate for the local objects and just
 * throws an exception.
 *
 * @throws NO_IMPLEMENT, always.
 */
public org.omg.CORBA.Object _set_policy_override(Policy[] policies,
                                                 SetOverrideType how
                                                )
{
  throw new NO_IMPLEMENT(INAPPROPRIATE);
}
 
Example 47
Project: javify   File: gnuPOA.java   Source Code and License 5 votes vote down vote up
/**
 * 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();
}
 
Example 48
Project: javify   File: gnuPOA.java   Source Code and License 5 votes vote down vote up
/**
 * Get the policy of the given type, associated with this POA.
 *
 * @param a_policy_type a type of the requested policy.
 * @return a policy of the given type, applyting to this POA.
 *
 * @throws org.omg.CORBA.BAD_PARAM if the policy of this type has not
 * been specified for this POA.
 */
public Policy _get_policy(int a_policy_type)
                   throws org.omg.CORBA.BAD_PARAM
{
  for (int i = 0; i < s_policies.length; i++)
    {
      if (s_policies [ i ].policy_type() == a_policy_type)
        return s_policies [ i ].copy();
    }
  throw new BAD_PARAM("No policy type " + a_policy_type);
}
 
Example 49
Project: javify   File: gnuPOA.java   Source Code and License 5 votes vote down vote up
/**
 * Get the copy of the policy array.
 */
public Policy[] getPolicyArray()
{
  Policy[] r = new Policy[ s_policies.length ];
  for (int i = 0; i < s_policies.length; i++)
    {
      r [ i ] = s_policies [ i ].copy();
    }
  return r;
}
 
Example 50
Project: javify   File: ORB_1_4.java   Source Code and License 5 votes vote down vote up
/**
 * Create policy using the previously registered factory.
 */
public Policy create_policy(int type, Any value)
  throws PolicyError
{
  Integer policy = new Integer(type);

  PolicyFactory forge = (PolicyFactory) policyFactories.get(policy);
  if (forge == null)
    throw new PolicyError("No factory registered for policy " + type,
      (short) type);
  else
    return forge.create_policy(type, value);
}
 
Example 51
Project: javify   File: StandardPolicies.java   Source Code and License 5 votes vote down vote up
/**
 * Return the policy set, applicable for the root POA, as defined
 * in OMG specs.
 */
public static Policy[] rootPoa()
{
  Policy[] p = new Policy[ rootPOASet.length ];
  System.arraycopy(rootPOASet, 0, p, 0, p.length);
  return p;
}
 
Example 52
Project: javify   File: StandardPolicies.java   Source Code and License 5 votes vote down vote up
/**
 * Convert the potentially incomplete policy array into array, containing
 * the complete policy set.
 *
 * @param policies the policy list, may be incomplete (even zero size).
 *
 * @return the complete policy array. The missing, but needed policies
 * are added with they default values.
 */
public static Policy[] withDefault(Policy[] policies)
{
  ArrayList current = new ArrayList(rootPOASet.length);
  Policy p_default;
  boolean specified;

  for (int i = 0; i < rootPOASet.length; i++)
    {
      p_default = rootPOASet [ i ];
      specified = false;
      ForThis:
      for (int j = 0; j < policies.length; j++)
        {
          if (policies [ j ].policy_type() == p_default.policy_type())
            {
              specified = true;
              current.add(policies [ j ]);
              break ForThis;
            }
        }
      if (!specified)
        current.add(p_default.copy());
    }

  Policy[] complete = new Policy[ current.size() ];
  for (int i = 0; i < complete.length; i++)
    {
      complete [ i ] = (Policy) current.get(i);
    }
  return complete;
}
 
Example 53
Project: jvm-stm   File: LocalObject.java   Source Code and License 5 votes vote down vote up
/**
 * This method is not appropriate for the local objects and just
 * throws an exception.
 *
 * @throws NO_IMPLEMENT, always.
 */
public org.omg.CORBA.Object _set_policy_override(Policy[] policies,
                                                 SetOverrideType how
                                                )
{
  throw new NO_IMPLEMENT(INAPPROPRIATE);
}
 
Example 54
Project: jvm-stm   File: gnuPOA.java   Source Code and License 5 votes vote down vote up
/**
 * 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();
}
 
Example 55
Project: jvm-stm   File: gnuPOA.java   Source Code and License 5 votes vote down vote up
/**
 * Get the policy of the given type, associated with this POA.
 *
 * @param a_policy_type a type of the requested policy.
 * @return a policy of the given type, applyting to this POA.
 *
 * @throws org.omg.CORBA.BAD_PARAM if the policy of this type has not
 * been specified for this POA.
 */
public Policy _get_policy(int a_policy_type)
                   throws org.omg.CORBA.BAD_PARAM
{
  for (int i = 0; i < s_policies.length; i++)
    {
      if (s_policies [ i ].policy_type() == a_policy_type)
        return s_policies [ i ].copy();
    }
  throw new BAD_PARAM("No policy type " + a_policy_type);
}
 
Example 56
Project: jvm-stm   File: gnuPOA.java   Source Code and License 5 votes vote down vote up
/**
 * Get the copy of the policy array.
 */
public Policy[] getPolicyArray()
{
  Policy[] r = new Policy[ s_policies.length ];
  for (int i = 0; i < s_policies.length; i++)
    {
      r [ i ] = s_policies [ i ].copy();
    }
  return r;
}
 
Example 57
Project: jvm-stm   File: ORB_1_4.java   Source Code and License 5 votes vote down vote up
/**
 * Create policy using the previously registered factory.
 */
public Policy create_policy(int type, Any value)
  throws PolicyError
{
  Integer policy = new Integer(type);

  PolicyFactory forge = (PolicyFactory) policyFactories.get(policy);
  if (forge == null)
    throw new PolicyError("No factory registered for policy " + type,
      (short) type);
  else
    return forge.create_policy(type, value);
}
 
Example 58
Project: jvm-stm   File: StandardPolicies.java   Source Code and License 5 votes vote down vote up
/**
 * Return the policy set, applicable for the root POA, as defined
 * in OMG specs.
 */
public static Policy[] rootPoa()
{
  Policy[] p = new Policy[ rootPOASet.length ];
  System.arraycopy(rootPOASet, 0, p, 0, p.length);
  return p;
}
 
Example 59
Project: jvm-stm   File: StandardPolicies.java   Source Code and License 5 votes vote down vote up
/**
 * Convert the potentially incomplete policy array into array, containing
 * the complete policy set.
 *
 * @param policies the policy list, may be incomplete (even zero size).
 *
 * @return the complete policy array. The missing, but needed policies
 * are added with they default values.
 */
public static Policy[] withDefault(Policy[] policies)
{
  ArrayList current = new ArrayList(rootPOASet.length);
  Policy p_default;
  boolean specified;

  for (int i = 0; i < rootPOASet.length; i++)
    {
      p_default = rootPOASet [ i ];
      specified = false;
      ForThis:
      for (int j = 0; j < policies.length; j++)
        {
          if (policies [ j ].policy_type() == p_default.policy_type())
            {
              specified = true;
              current.add(policies [ j ]);
              break ForThis;
            }
        }
      if (!specified)
        current.add(p_default.copy());
    }

  Policy[] complete = new Policy[ current.size() ];
  for (int i = 0; i < complete.length; i++)
    {
      complete [ i ] = (Policy) current.get(i);
    }
  return complete;
}
 
Example 60
Project: infobip-open-jdk-8   File: ORBInitInfoImpl.java   Source Code and License 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 ) ;
}