|
VisiBroker for Java |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface POAOperations
A POA object manages the implementation of a collection of objects. The POA supports a name space for the objects, which are identified by Object Ids. A POA also provides a name space for POAs. A POA is created as a child of an existing POA, which forms a hierarchy starting with the root POA.
Method Summary | |
---|---|
void |
activate_object_with_id(byte[] id,
Servant p_servant)
This operation requires the RETAIN policy; if not present, the WrongPolicy exception is raised. |
byte[] |
activate_object(Servant p_servant)
This operation requires the SYSTEM_ID and RETAIN policy; if not present, the WrongPolicy exception is raised. |
IdAssignmentPolicy |
create_id_assignment_policy(IdAssignmentPolicyValue value)
This method returns an IdAssignmentPolicy object with the specified value. |
IdUniquenessPolicy |
create_id_uniqueness_policy(IdUniquenessPolicyValue value)
This method returns an IdUniquenessPolicy object with the specified value. |
ImplicitActivationPolicy |
create_implicit_activation_policy(ImplicitActivationPolicyValue value)
This method returns an ImplicitActivationPolicy object with the specified value. |
LifespanPolicy |
create_lifespan_policy(LifespanPolicyValue value)
This method returns a LifespanPolicy object with the specified value. |
POA |
create_POA(java.lang.String adapter_name,
POAManager a_POAManager,
Policy[] policies)
This operation creates a new POA as a child of the target POA. |
Object |
create_reference_with_id(byte[] oid,
java.lang.String intf)
This operation creates an object reference that encapsulates the specified Object Id and interface repository Id values. |
Object |
create_reference(java.lang.String intf)
This operation requires the SYSTEM_ID policy; if not present, the WrongPolicy exception is raised. |
RequestProcessingPolicy |
create_request_processing_policy(RequestProcessingPolicyValue value)
This method returns a RequestProcessingPolicy object with the specified value. |
ServantRetentionPolicy |
create_servant_retention_policy(ServantRetentionPolicyValue value)
This method returns a ServantRetentionPolicy object with the specified value. If no ServantRetentionPolicy is specified at POA creation, then the default is RETAIN. |
ThreadPolicy |
create_thread_policy(ThreadPolicyValue value)
This method returns a ThreadPolicy object with the specified value. If no ThreadPolicy is specified at POA creation, then the default is ORB_CTRL_MODEL. |
void |
deactivate_object(byte[] oid)
This operation requires the RETAIN policy; if not present, the WrongPolicy exception is raised. |
void |
destroy(boolean etherealize_objects,
boolean wait_for_completion)
This operation destroys the POA and all descendant POAs. |
POA |
find_POA(java.lang.String adapter_name,
boolean activate_it)
If the target POA is the parent of a child POA with the specified name (relative to the target POA), that child POA is returned. |
ServantManager |
get_servant_manager()
|
Servant |
get_servant()
This operation requires the USE_DEFAULT_SERVANT policy; if not present, the WrongPolicy exception is raised. |
Object |
id_to_reference(byte[] oid)
This operation requires the RETAIN policy; if not present, the WrongPolicy exception is raised.If an object with the specified Object Id value is currently active, a reference encapsulating the information used to activate the object is returned. |
Servant |
id_to_servant(byte[] oid)
This operation requires the RETAIN policy or the USE_DEFAULT_SERVANT policy. |
byte[] |
id()
This returns the unique id of the POA in the process in which it is created. |
byte[] |
reference_to_id(Object reference)
The WrongPolicy exception is declared to allow future extensions. |
Servant |
reference_to_servant(Object reference)
This operation requires the RETAIN policy or the USE_DEFAULT_SERVANT policy. |
byte[] |
servant_to_id(Servant p_servant)
This operation requires the USE_DEFAULT_SERVANT policy or a combination of the RETAIN policy and either the UNIQUE_ID or IMPLICIT_ACTIVATION policies; if not present, the WrongPolicy exception is raised. |
Object |
servant_to_reference(Servant p_servant)
This operation requires the RETAIN policy and either the UNIQUE_ID or IMPLICIT_ACTIVATION policies if invoked outside the context of an operation dispatched by this POA. |
void |
set_servant_manager(ServantManager imgr)
This operation requires the USE_SERVANT_MANAGER policy; if not present, the WrongPolicy exception is raised. |
void |
set_servant(Servant p_servant)
This operation requires the USE_DEFAULT_SERVANT policy; if not present, the WrongPolicy exception is raised. |
AdapterActivator |
the_activator()
This attribute identifies the adapter activator associated with the POA. |
void |
the_activator(AdapterActivator arg0)
This attribute identifies the adapter activator associated with the POA. |
POA[] |
the_children()
This method returns the current set of all child POAs of the POA. |
java.lang.String |
the_name()
This method returns the read-only attribute which identifies the POA relative to its parent. |
POA |
the_parent()
This method returns the POA's parent POA. |
POAManager |
the_POAManager()
This method returns the POAManager associated with the POA. |
POAManagerFactory |
the_POAManagerFactory()
This attribute returns the POAManagerFactory that created the POA |
Method Detail |
---|
byte[] id()
Object id_to_reference(byte[] oid) throws ObjectNotActive, WrongPolicy
oid
- The ObjectId of the object for which a reference is to be returned.
ObjectNotActive
- if the Object Id value is not active in the POA.
WrongPolicy
- if the RETAIN policy is not present.Servant id_to_servant(byte[] oid) throws ObjectNotActive, WrongPolicy
reference
- The object for which a servant is to be returned.
ObjectNotActive
- is raised if ObjectId is is not in the Active Object Map (for RETAIN policy), or no default servant is registered (for USE_DEFAULT_SERVANT policy).
WrongPolicy
- is raised if the RETAIN policy or the USE_DEFAULT_SERVANT policy is not present.byte[] reference_to_id(Object reference) throws WrongAdapter, WrongPolicy
The WrongPolicy exception is declared to allow future extensions. This operation returns the Object Id value encapsulated by the specified reference. This operation is valid only if the reference was created by the POA on which the operation is being performed. If the reference was not created by that POA, a WrongAdapter exception is raised. The object denoted by the reference does not have to be active for this operation to succeed.
Though the IDL specifies that a WrongPolicy exception may be raised by this method, it is simply declared for possible future extension.
reference
- The object for which an ObjectId is to be returned.
WrongAdapter
- if the reference was not created by the POA specified in the reference.
WrongPolicy
- declared to allow future extensions.Servant reference_to_servant(Object reference) throws ObjectNotActive, WrongAdapter, WrongPolicy
reference
- object reference for which the servant is returned.
WrongPolicy
- if neither the RETAIN policy or the USE_DEFAULT_SERVANT policy is present.
ObjectNotActive
- if the servant is not present in the Active Object Map (for RETAIN) or no default servant is registered (for USE_DEFAULT_POLICY).
WrongAdapter
- if reference was not created by this POA instance.Object servant_to_reference(Servant p_servant) throws ServantNotActive, WrongPolicy
p_servant
- The Servant for which a reference is to be returned.
WrongPolicy
- if the operation is not invoked in the context of executing a request on the specified servant and the required policies are not present.
ServantNotActive
- if the above specified policies and rules are not met.byte[] servant_to_id(Servant p_servant) throws ServantNotActive, WrongPolicy
p_servant
- The Servant for which the ObjectId to be returned is desired.
ServantNotActive
- if the above rules and policy combination is not met.
WrongPolicy
- if the USE_DEFAULT_SERVANT policy or a combination of the RETAIN policy and either the UNIQUE_ID or IMPLICIT_ACTIVATION policies are not present.Object create_reference_with_id(byte[] oid, java.lang.String intf)
oid
- object id for creating an objref.iintf
- rep id for creating an objref.Object create_reference(java.lang.String intf) throws WrongPolicy
intf
- RepositoryId of the Object.
WrongPolicy
- - if SYSTEM_ID policy is not specified.void deactivate_object(byte[] oid) throws ObjectNotActive, WrongPolicy
This operation requires the RETAIN policy; if not present, the WrongPolicy exception is raised. This operation causes the ObjectId specified in the oid parameter to be deactivated. An ObjectId which has been deactivated continues to process requests until there are no active requests for that ObjectId. A deactivated ObjectId is removed from the Active Object Map when all requests executing for that ObjectId have completed. If a servant manager is associated with the POA, ServantActivator::etherealize is invoked with the oid and the associated servant after the ObjectId has been removed from the Active Object Map. Reactivation for the ObjectId blocks until etherealization (if necessary) is complete. This includes implicit activation (as described in etherealize) and explicit activation via POA::activate_object_with_id. Once an ObjectId has been removed from the Active Object Map and etherealized (if necessary) it may then be reactivated through the usual mechanisms. The operation does not wait for requests or etherealization to complete and always returns immediately after deactivating the ObjectId.
oid
- The ObjectId of the object to be deactivated.
ObjectNotActive
- if the object with the specified oid is not in the Active Object Map.
WrongPolicy
- raised if the RETAIN policy is is not specified.void activate_object_with_id(byte[] id, Servant p_servant) throws ServantAlreadyActive, ObjectAlreadyActive, WrongPolicy
This operation requires the RETAIN policy; if not present, the WrongPolicy exception is raised. If the CORBA object denoted by the Object Id value is already active in this POA (there is a servant bound to it in the Active Object Map), the ObjectAlreadyActive exception is raised. If the POA has the UNIQUE_ID policy and the servant is already in the Active Object Map, the ServantAlreadyActive exception is raised. Otherwise, the activate_object_with_id operation enters an association between the specified Object Id and the specified servant in the Active Object Map.
If the POA has the SYSTEM_ID policy and it detects that the Object Id value was not generated by the system or for this POA, the activate_object_with_id operation may raise the BAD_PARAM system exception. An ORB is not required to detect all such invalid Object Id values, but a portable application must not invoke activate_object_with_id on a POA that has the SYSTEM_ID policy with an Object Id value that was not previously generated by the system for that POA, or, if the POA also has the PERSISTENT policy, for a previous instantiation of the same POA.
servant
- to be associated with an object to be activated.
ServantAlreadyActive
- raised if the POA has the UNIQUE_ID policy and the servant is already in the Active Object Map.
ObjectAlreadyActive
- raised if the object is already active in the POA.
WrongPolicy
- raised if the RETAIN policy is is not specified.byte[] activate_object(Servant p_servant) throws ServantAlreadyActive, WrongPolicy
servant
- The servant to be activated.
ServantAlreadyActive
- is raised if the POA has UNIQUE_ID policy and servant is is already in the Active Object Map.
WrongPolicy
- raised if the SYSTEM_ID and RETAIN policies are not specified.void set_servant(Servant p_servant) throws WrongPolicy
p_servant
- The Servant to be used as the default associated with the POA.
WrongPolicy
- raised if the USE_DEFAULT_SERVANT policy is not specified.Servant get_servant() throws NoServant, WrongPolicy
NoServant
- raised if no default servant is associated with the POA.
WrongPolicy
- raised if the USE_DEFAULT_SERVANT policy is not specified.void set_servant_manager(ServantManager imgr) throws WrongPolicy
imgr
- The ServantManager to be used as the default used with the POA.
WrongPolicy
- raised if the USE_SERVANT_MANAGER policy is not specified.ServantManager get_servant_manager() throws WrongPolicy
WrongPolicy
POAManagerFactory the_POAManagerFactory()
AdapterActivator the_activator()
void the_activator(AdapterActivator arg0)
POAManager the_POAManager()
POA[] the_children()
POA the_parent()
java.lang.String the_name()
RequestProcessingPolicy create_request_processing_policy(RequestProcessingPolicyValue value)
If
- set to USE_ACTIVE_OBJECT_MAP_ONLY and the object id is not found in the Active
Object Map, then an OBJECT_NOT_EXIST exception is returned to the client. (The
RETAIN policy is also required.)ServantRetentionPolicy create_servant_retention_policy(ServantRetentionPolicyValue value)
value
- If set to RETAIN, then the POA will retain active servants in its Active Object
Map. If set to NON_RETAIN, then servants are not retained by the POA.ImplicitActivationPolicy create_implicit_activation_policy(ImplicitActivationPolicyValue value)
value
- If set to IMPLICIT_ACTIVATION, the POA will support implicit activation
of servants: also requires SYSTEM_ID and RETAIN policies. If set to
NO_IMPLICIT_ACTIVATION, the POA will not support the implicit
activation of servants.IdAssignmentPolicy create_id_assignment_policy(IdAssignmentPolicyValue value)
value
- If set to USER_ID, then objects created the POA are assigned object ids
only by the application. If set to SYSTEM_ID, then objects created with
the POA are assigned object ids only by the POA.IdUniquenessPolicy create_id_uniqueness_policy(IdUniquenessPolicyValue value)
value
- If set to UNIQUE_ID, then servants which are activated with the POA support
exactly one object id. If set to MULTIPLE_ID, then a servant which is activated
with the POA may support one or more object ids.LifespanPolicy create_lifespan_policy(LifespanPolicyValue value)
value
- If set to TRANSIENT, then objects implemented in the POA cannot outlive
the POA instance in which they were first created. Once a transient POA is
deactivated, the use of any object references generated from it will result in
an OBJECT_NOT_EXIST exception being raised. If set to PERSISTENT, then
the objects implemented in the POA can outlive any process in which they
are first created.ThreadPolicy create_thread_policy(ThreadPolicyValue value)
value
- If set to ORB_CTRL_MODEL, the ORB is responsible for assigning requests
for an ORB-controlled POA to threads. In a multi-threaded environment,
concurrent requests may be delivered using multiple threads. If set to
SINGLE_THREAD_MODEL, then requests to the POA are processed
sequentially. In a multi-threaded environment, all upcalls made by the POA
to servants and servant managers are made in a manner that is safe for code
that is multi-thread unaware.void destroy(boolean etherealize_objects, boolean wait_for_completion)
This operation destroys the POA and all descendant POAs. All descendant POAs are destroyed (recursively) before the destruction of the containing POA. The POA so destroyed (that is, the POA with its name) may be re-created later in the same process. (This differs from the POAManager::deactivate operation that does not allow a re-creation of its associated POA in the same process. After a deactivate, re-creation is allowed only if the POA is later destroyed.) When destroy is called the POA behaves as follows: he POA calls destroy on all of its immediate descendants. After all descendant POAs have been destroyed and their servants etherealized, the POA continues to process requests until there are no requests executing in the POA. The apparent destruction of the POA occurs only after all executing requests in the POA have completed. After destruction has become apparent, the POA may be re-created via either an AdapterActivator or a call to create_POA. f t he etherealize_objects parameter is TRUE, the POA has the RETAIN policy, and a servant manager is registered with the POA, the etherealize operation on the servant manager is called for each active object in the Active Object Map. The apparent destruction of the POA occurs before any calls to etherealize are made. Thus, for example, an etherealize method that attempts to invoke operations on the POA receives the OBJECT_NOT_EXIST exception. Once apparent destruction has occurred, the POA behaves as if its POAManager is in the holding state until destruction is complete. Thus, for example, an invocation of create_POA with the same name blocks until POA destruction has finished. The wait_for_completion parameter is handled as follows: f wait_for_completion is TRUE and the current thread is not in an invocation context dispatched from some POA belonging to the same ORB as this POA, the destroy operation returns only after all active requests have completed and all invocations of etherealize have completed. f wait_for_completion is TRUE and the current thread is in an invocation context dispatched from some POA belonging to the same ORB as this POA, the BAD_INV_ORDER exception is raised and POA destruction does not occur.
If wait_for_completion is FALSE, the destroy operation destroys the POA and its children but waits neither for active requests to complete nor for etherealization to occur. If destroy is called multiple times before destruction is complete (because there are active requests), the etherealize_objects parameter applies only to the first call of destroy. Subsequent calls with conflicting etherealize_objects settings use the value of etherealize_objects from the first call. The wait_for_completion parameter is handled as defined above for each individual call (some callers may choose to block, while others may not).
etherealize_objects
- If True, the POA has the RETAIN policy, and a servant manager has registered
with the POA, then the etherealize method is called on each active object in
the Active Object Map. The apparent destruction of the POA occurs before
the etherealize method is called, and thus any etherealize method which
attempts to invoke methods on the POA raises a OBJECT_NOT_EXIST
exception.wait_for_completion
- If True and the current thread is not in an invocation context dispatched from
some POA belonging to the same ORB as this POA, the destroy method only
returns after all active requests and all invocations of etherealize have
completed.
If True and the current thread is in an invocation context dispatched from
some POA belonging to the same ORB as this POA, the BAD_INV_ORDER
exception is raised and POA destruction does not occur.POA find_POA(java.lang.String adapter_name, boolean activate_it) throws AdapterNonExistent
adapter_name
- The name of the AdapterActivator associated with the POA.activate_it
- If set to True and no child POA of the POA specified by adapter_name exists,
then the POA's AdapterActivator, if not null, is invoked, and, if it
successfully activates the child POA, then that POA is returned. Otherwise
an AdapterNonExistent exception is raised.
AdapterNonExistent.
AdapterNonExistent
POA create_POA(java.lang.String adapter_name, POAManager a_POAManager, Policy[] policies) throws AdapterAlreadyExists, InvalidPolicy
This operation creates a new POA as a child of the target POA. The specified name identifies the new POA with respect to other POAs with the same parent POA. If the target POA already has a child POA with the specified name, the AdapterAlreadyExists exception is raised. If the a_POAManager parameter is null, a new POAManager object is created and associated with the new POA. Otherwise, the specified POAManager object is associated with the new POA. The POAManager object can be obtained using the attribute name the_POAManager.
The specified policy objects are associated with the POA and used to control its behavior. The policy objects are effectively copied before this operation returns, so the application is free to destroy them while the POA is in use. Policies are not inherited from the parent POA. If any of the policy objects specified are not valid for the ORB implementation, if conflicting policy objects are specified, or if any of the specified policy objects require prior administrative action that has not been performed, an InvalidPolicy exception is raised containing the index in the policies parameter value of the first offending policy object. Note
adapter_name
- The name which specifies the new POA.a_POAManager
- The manager of the new POA.policies
- A list of policies which are to apply to the new POA.
AdapterAlreadyExists
- specifies that the target POA already has a child POA with the specified name.
InvalidPolicy
- is raised if any of the policy objects are not valid for the ORB, or are in conflict, or require an administrative action that has not been performed.
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |