|
|
Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
Page 4 of 5
As in the code snippet shown above, you can create a POA without defining any policies; the default values will be used. In
the example above, the RootPOA and POAs A, B, and C use the default policy values, defined below:
You can also fine-tune the policies for each POA to match your exact requirements. For example, recall that a POA can create
either persistent or transient object references, but not both. The RootPOA can only create transient references, but you could create a new POA that can create persistent references. An example is
shown below:
.
.
.
// rootPOA is a reference to the Root POA
Policy[] policies = new Policy[1];
policies[0] = rootPOA.create_lifespan_policy(LifespanPolicyValue.PERSISTENT);
POA A = rootPOA.create_POA("A",null,policies);
.
.
.
This code differs from the earlier RootPOA creation in that instead of passing a null value as the third parameter in the create_POA() method, I pass in an array of Policy objects.
Now let's look at each policy more closely.
This policy specifies the threading model used with the created POA. It can have the following values:
ORB_CTRL_MODEL: When this default value is specified, the ORB assigns ORB-controlled POA requests to threads.
SINGLE_THREAD_MODEL: Specifies that requests for a single-threaded POA process sequentially. Note: J2SE 1.4's ORB doesn't support this value.
This policy specifies the lifespan of the objects implemented in the created POA and can have the following values:
TRANSIENT: This default value specifies that the objects implemented in the POA cannot outlive the POA instance in which they were first
created.
PERSISTENT: Specifies that the objects implemented in the POA can outlive the process in which they were first created.
This policy specifies whether the servants activated in the created POA must have unique object identities. It can have the following values:
UNIQUE_ID: This default value specifies that servants activated with the created POA support exactly one object ID.
MULTIPLE_ID: Specifies that a servant activated with the created POA can support one or more object IDs. That means the same servant instance
can incarnate multiple CORBA objects.
This policy specifies whether the application or the ORB generates the created POA's object IDs. This policy has the following values: