| org.omg.PortableServer.CurrentPackage | The Portable Object Adapter (POA) provides more control on the request processing than it is possible when connecting objects directly to the ORB. |
| org.omg.PortableServer.POAManagerPackage | |
| org.omg.PortableServer.POAPackage | |
| org.omg.PortableServer.ServantLocatorPackage | Provides classes and interfaces for locating the servant. |
| org.omg.PortableServer.portable | Provides classes and interfaces for making the server side of your applications portable across multivendor ORBs. |
| AdapterActivator | Adapter activators are associated with POAs and supply the the ability to create child POAs on demand. | code | html |
| AdapterActivatorOperations | Defines the operations, applicable to the AdapterActivator. | code | html |
| Current | Provides the Id of the object currently being served and POA to that this object is connected. |
code | html |
| CurrentOperations | Provides the Id of the object currently being served and POA to that this object is connected. | code | html |
| ID_ASSIGNMENT_POLICY_ID | Holds an integer IdAssignmentPolicy identifier. | code | html |
| ID_UNIQUENESS_POLICY_ID | Holds an integer IdUniquenessPolicy identifier. | code | html |
| IMPLICIT_ACTIVATION_POLICY_ID | Holds an integer ImplicitActivationPolicy identifier. | code | html |
| IdAssignmentPolicy | Specifies the Object Id assignment policy. | code | html |
| IdAssignmentPolicyOperations | Defines the operations, applicable to the IdAssignmentPolicy. | code | html |
| IdUniquenessPolicy | Specfies the Id uniqueness policy. | code | html |
| IdUniquenessPolicyOperations | Defines the operations, applicable to the IdUniquenessPolicy. | code | html |
| ImplicitActivationPolicy | Specifies the implicit activation policy. | code | html |
| ImplicitActivationPolicyOperations | Defines the operations, applicable to the ImplicitActivationPolicy. | code | html |
| LIFESPAN_POLICY_ID | Holds an integer LifespanPolicy identifier. | code | html |
| LifespanPolicy | Specifies the object life span policy, if they can outlive the POA with that they were first created. | code | html |
| LifespanPolicyOperations | Defines the operations, applicable to the LifespanPolicy. | code | html |
| POA | The Portable Object Adapter (POA) provides more control on the request processing than it is possible when connecting objects directly to the ORB. |
code | html |
| POAManager | A POA manager is associated with one or more POAs and provides means to regulate they activity. |
code | html |
| POAManagerOperations | Defines the operations, applicable to the POAManager . | code | html |
| POAOperations | Defines the operations, applicable to the POA. | code | html |
| REQUEST_PROCESSING_POLICY_ID | Holds an integer RequestProcessingPolicy identifier. | code | html |
| RequestProcessingPolicy | Specifies the behaviour in the case when the requested object is not found in the Active Object Map or that map is not in use. | code | html |
| RequestProcessingPolicyOperations | Defines the operations, applicable to the RequestProcessingPolicy. | code | html |
| SERVANT_RETENTION_POLICY_ID | Holds an integer ServantRetentionPolicy identifier. | code | html |
| ServantActivator | The POA, that has the RETAIN policy uses servant managers that are ServantActivators. | code | html |
| ServantActivatorOperations | Defines the operations, applicable to the ServantActivator . | code | html |
| ServantLocator | When the POA has the NON_RETAIN policy it uses servant managers that are ServantLoacators. | code | html |
| ServantLocatorOperations | Defines the operations, applicable to the ServantLocator . | code | html |
| ServantManager | A servant manager is associated with POA and provide possibility to activate objects on demand. | code | html |
| ServantManagerOperations | This interface would define the operations, applicable to the ServantManager. | code | html |
| ServantRetentionPolicy | Specifies if the active servants should be retained in the Active Object Map. | code | html |
| ServantRetentionPolicyOperations | Defines the operations, applicable to the ServantRetentionPolicy. | code | html |
| THREAD_POLICY_ID | Holds an integer ThreadPolicy identifier. | code | html |
| ThreadPolicy | Defines the POA thread policy. | code | html |
| ThreadPolicyOperations | Defines the operations, applicable to the ThreadPolicy. | code | html |
| CurrentHelper | The PortableServer::Current interface, derived from CORBA::Current, provides method implementations with access to the identity of the object on which the method was invoked. | code | html |
| DynamicImplementation | Allows dynamic handling of object invocations. | code | html |
| ForwardRequestHelper | The helper operations for the exception ForwardRequest . | code | html |
| POAHelper | A POA object manages the implementation of a collection of objects. | code | html |
| Servant | Defines the native Servant type. |
code | html |
| ServantActivatorHelper | The helper operations for the CORBA object ServantActivator . | code | html |
| ServantActivatorPOA | This ServantActivator stub is an optional base for the servant activators. |
code | html |
| ServantLocatorHelper | The helper operations for the CORBA object ServantLocator . | code | html |
| ServantLocatorPOA | The ServantLocator stub is an optional base for the servant locators. |
code | html |
| ForwardRequest | This exception is raised by ServantManager to indicate that the invocation target has moved to another known location. |
code | html |
| IdAssignmentPolicyValue | Specifies the Object Id assignment policy. | code | html |
| IdUniquenessPolicyValue | Specifies the Object Id uniqueness policy. | code | html |
| ImplicitActivationPolicyValue | Specifies the implicit activation policy. | code | html |
| LifespanPolicyValue | Specifies the object life span policy. | code | html |
| RequestProcessingPolicyValue | Specifies the behaviour in the case when the requested object is not found in the Active Object Map or that map is not in use. | code | html |
| ServantActivatorPOA.delegator | This class is used to support _this. | code | html |
| ServantLocatorPOA.delegator | This class is used to support _this. | code | html |
| ServantRetentionPolicyValue | Specifies the servant retention policy. | code | html |
| ThreadPolicyValue | Defines the possible values for the POA thread policy. | code | html |
| _ServantActivatorStub | This ServantActivator stub is an optional base for the servant activators. |
code | html |
| _ServantLocatorStub | The ServantLocator stub is an optional base for the servant locators. |
code | html |
In Java, Portable Object Adaptor (POA)-based Dynamic Skeleton Interface (DSI) servants inherit from the standard DynamicImplementation class, which inherits from the Servant class. The native Servant type is defined by the PortableServer module for the POA. In Java, the Servant type is mapped to the Java org.omg.PortableServer.Servant class. It serves as the base class for all POA servant implementations and provides a number of methods that may be invoked by the application programmer, as well as methods which are invoked by the POA itself and may be overridden by the user to control aspects of servant behavior.
For a precise list of supported sections of official OMG specifications with which the Java[tm] Platform, Standard Edition 6 complies, see Official Specifications for CORBA support in Java[tm] SE 6.
The PortableServer module defines the following POA-related interfaces:
In addition, the POA defines the Servant native type.
Each of the interfaces listed above has an associated Operations interface. The Operations interface is generated by the idlj compiler and contains the method signatures for methods defined in its associated interface. The Operations interface can be accessed by both the client and the server, while its associated interface can only be called by the client.
PolicyValue provide the values used for the create_POA call, which sets the policy for the POA. See the sample code below for a demonstration. PolicyValue files include the following:
IdAssignmentPolicyValue
IdUniquenessPolicyValue
ImplicitActivationPolicyValue
LifespanPolicyValue
RequestProcessingPolicyValue
ServantRetentionPolicyValue
ThreadPolicyValue
Helper classes, which are generated for all user-defined types in an OMG IDL
interface, supply static methods needed to manipulate those types. There is only one method in a helper class that an application programmer uses: the narrow method. Only Java interfaces mapped from IDL interfaces will have a helper class that includes a narrow method, so in the PortableServer package, only the following classes have a narrow method:
ForwardRequestHelper
ServantActivatorHelper
ServantLocatorHelper
POA classes are used to implement the ServantActivator or ServantLocator.
The ForwardRequest exception indicates to the ORB
that it is responsible for delivering the current request and subsequent ForwardRequest requests to the object denoted in the
forward_reference member of the exception.
Most of what PortableServer does is transparent to the user. The result is that programmers will use only a few of the interfaces mentioned above. The remaining interfaces will be provided by the ORB implementation. The interfaces of interest to application programmers are the following:
AdapterActivator
Adapter activators are associated with POAs. An adapter activator supplies a POA with the ability to create child POAs on demand, as a side-effect of receiving a request that names the child POA (or one of its children), or when find_POA is called with an activate parameter value of TRUE. An application server that creates all its needed POAs at the beginning of execution does not need to use or provide an adapter activator; it is necessary only for the case in which POAs need to be created during request processing.
ServantLocator
When the POA has the NON_RETAIN policy, it uses servant managers that are ServantLocators.
ServantActivator
When the POA has the RETAIN policy, it uses servant managers that are ServantActivators.
This package supplies a CookieHolder class for passing
the Cookie type as an out parameter. The CookieHolder class
follows exactly the same pattern as the other holder classes for basic types.
For an overview of Java IDL, please see:
import javax.naming.InitialContext;
import javax.naming.Context;
import javax.rmi.PortableRemoteObject ;
import com.sun.corba.se.impl.poa.POAORB;
import org.omg.PortableServer.*;
import java.util.*;
import org.omg.CORBA.*;
import javax.rmi.CORBA.Stub;
import javax.rmi.CORBA.Util;
public class HelloServer {
public HelloServer(String[] args) {
try {
Properties p = System.getProperties();
// p.put("org.omg.CORBA.ORBClass", "com.sun.corba.ee.internal.POA.POAORB");
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);
String ObjectId = "MyObjectId";
byte[] oid = ObjectId.getBytes();
org.omg.CORBA.Object obj = tpoa.create_reference_with_id(oid,
new _HelloImpl_Tie()._all_interfaces(tpoa, oid)[0]);
HelloInterface helloRef = (HelloInterface)PortableRemoteObject.narrow(
obj, HelloInterface.class );
Context initialNamingContext = new InitialContext();
initialNamingContext.rebind("HelloService", helloRef);
System.out.println("Hello Server: Ready...");
orb.run();
} catch (Exception e) {
System.out.println("Trouble: " + e);
e.printStackTrace();
}
}
public static void main(String args[]) {
new HelloServer( args );
}
}
@since 1.4
@serial exclude