KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > omg > PortableServer > POAOperations


1 package org.omg.PortableServer;
2
3
4 /**
5 * org/omg/PortableServer/POAOperations.java .
6 * Generated by the IDL-to-Java compiler (portable), version "3.2"
7 * from ../../../../src/share/classes/org/omg/PortableServer/poa.idl
8 * Saturday, February 9, 2008 9:40:03 AM GMT
9 */

10
11
12 /**
13      * A POA object manages the implementation of a
14      * collection of objects. The POA supports a name space
15      * for the objects, which are identified by Object Ids.
16      * A POA also provides a name space for POAs. A POA is
17      * created as a child of an existing POA, which forms a
18      * hierarchy starting with the root POA. A POA object
19      * must not be exported to other processes, or
20      * externalized with ORB::object_to_string.
21      */

22 public interface POAOperations
23 {
24
25   /**
26      * This operation creates a new POA as a child of the
27      * target POA.
28      * @param adapter_name identifies the new POA with
29      * respect to other POAs with the same parent POA.
30      * @param a_POAManager specifies the POA Manager to be
31      * associated with the new POA.
32      * @param policies specifies policy objects to be
33      * associated with the POA to control its behavior.
34      * @exception AdapterAlreadyExists specifies that the
35      * target POA already has a child POA with
36      * the specified name.
37      * @exception InvalidPolicy is raised if any of the
38      * policy objects are not valid for the ORB,
39      * or are in conflict, or require an
40      * administrative action that has not been
41      * performed.
42      */

43   org.omg.PortableServer.POA JavaDoc create_POA (String JavaDoc adapter_name, org.omg.PortableServer.POAManager JavaDoc a_POAManager, org.omg.CORBA.Policy JavaDoc[] policies) throws org.omg.PortableServer.POAPackage.AdapterAlreadyExists JavaDoc, org.omg.PortableServer.POAPackage.InvalidPolicy JavaDoc;
44
45   /**
46      * If the target POA is the parent of a child POA with
47      * the specified name (relative to the target POA), that
48      * child POA is returned.
49      * @param adapter_name POA name to be found.
50      * @param activate_it if a POA with the specified
51      * name does not exist and the value of
52      * the activate_it parameter is TRUE, the target
53      * POA's AdapterActivator, if one exists,
54      * is invoked.
55      * @return POA if one exists or is activated by the
56      * AdapterActivator.
57      * @return AdapterNonExistent is raised if POA with
58      * a specified name cannot be found or
59      * activated using AdapaterActivator.
60      */

61   org.omg.PortableServer.POA JavaDoc find_POA (String JavaDoc adapter_name, boolean activate_it) throws org.omg.PortableServer.POAPackage.AdapterNonExistent JavaDoc;
62
63   /**
64      * This operation destroys the POA and all descendant
65      * POAs. All descendant POAs are destroyed (recursively)
66      * before the destruction of the containing POA. The POA
67      * so destroyed (that is, the POA with its name) may be
68      * re-created later in the same process.
69      * @param etherealize_objects flag to indicate whether
70      * etherealize operation on servant manager needs
71      * to be called.
72      * @param wait_for_completion flag to indicate whether
73      * POA and its children need to wait for active
74      * requests and the etherealization to complete.
75      *
76      */

77   void destroy (boolean etherealize_objects, boolean wait_for_completion);
78
79   /**
80      * These operations each return a reference to a policy
81      * object with the specified value.
82      * @param value policy type
83      * @return ThreadPolcy Object
84      */

85   org.omg.PortableServer.ThreadPolicy JavaDoc create_thread_policy (org.omg.PortableServer.ThreadPolicyValue JavaDoc value);
86
87   /**
88      * These operations each return a reference to a policy
89      * object with the specified value.
90      * @param value policy type
91      * @return LifespanPolicy Object.
92      */

93   org.omg.PortableServer.LifespanPolicy JavaDoc create_lifespan_policy (org.omg.PortableServer.LifespanPolicyValue JavaDoc value);
94
95   /**
96      * These operations each return a reference to a policy
97      * object with the specified value.
98      * @param value policy type
99      * @return IdUniquenessPolicy Object.
100      */

101   org.omg.PortableServer.IdUniquenessPolicy JavaDoc create_id_uniqueness_policy (org.omg.PortableServer.IdUniquenessPolicyValue JavaDoc value);
102
103   /**
104      * These operations each return a reference to a policy
105      * object with the specified value.
106      * @param value policy type
107      * @return IdAssignmentPolicy Object.
108      */

109   org.omg.PortableServer.IdAssignmentPolicy JavaDoc create_id_assignment_policy (org.omg.PortableServer.IdAssignmentPolicyValue JavaDoc value);
110
111   /**
112      * These operations each return a reference to a policy
113      * object with the specified value.
114      * @param value policy type
115      * @return ImplicitActivationPolicy Object.
116      */

117   org.omg.PortableServer.ImplicitActivationPolicy JavaDoc create_implicit_activation_policy (org.omg.PortableServer.ImplicitActivationPolicyValue JavaDoc value);
118
119   /**
120      * These operations each return a reference to a policy
121      * object with the specified value.
122      * @param value policy type
123      * @return ServantRetentionPolicy Object.
124      */

125   org.omg.PortableServer.ServantRetentionPolicy JavaDoc create_servant_retention_policy (org.omg.PortableServer.ServantRetentionPolicyValue JavaDoc value);
126
127   /**
128      * These operations each return a reference to a policy
129      * object with the specified value.
130      * @param value policy type
131      * @return RequestProcessingPolicy Object.
132      */

133   org.omg.PortableServer.RequestProcessingPolicy JavaDoc create_request_processing_policy (org.omg.PortableServer.RequestProcessingPolicyValue JavaDoc value);
134
135   /**
136      * This attribute identifies the POA relative to its
137      * parent. This name is assigned when the POA is created.
138      */

139   String JavaDoc the_name ();
140
141   /**
142      * This attribute identifies the parent of the POA.
143      * The parent of the root POA is null.
144      */

145   org.omg.PortableServer.POA JavaDoc the_parent ();
146
147   /**
148      * This attribute identifies the current set of all
149      * child POAs of the POA. The set of child POAs
150      * includes only the POA's immediate children, and
151      * not their descendants.
152      */

153   org.omg.PortableServer.POA JavaDoc[] the_children ();
154
155   /**
156      * This attribute identifies the POA manager
157      * associated with the POA.
158      */

159   org.omg.PortableServer.POAManager JavaDoc the_POAManager ();
160
161   /**
162      * This attribute identifies the adapter activator
163      * associated with the POA.
164      */

165   org.omg.PortableServer.AdapterActivator JavaDoc the_activator ();
166
167   /**
168      * This attribute identifies the adapter activator
169      * associated with the POA.
170      */

171   void the_activator (org.omg.PortableServer.AdapterActivator JavaDoc newThe_activator);
172
173   /**
174      *
175      * If the ServantRetentionPolicy of the POA is RETAIN,
176      * then the ServantManager argument (imgr) shall support
177      * the ServantActivator interface. For a NON_RETAIN policy,
178      * the ServantManager shall support the ServantLocator
179      * interface. If the argument is nil, or does not support
180      * the required interface, then the OBJ_ADAPTER
181      * exception is raised.
182      * @return ServantManager associated with a POA or null if
183      * none exists.
184      * @exception WrongPolicy raised if the
185      * USE_SERVANT_MANAGER policy is not specified.
186      */

187   org.omg.PortableServer.ServantManager JavaDoc get_servant_manager () throws org.omg.PortableServer.POAPackage.WrongPolicy JavaDoc;
188
189   /**
190      *
191      * This operation sets the default servant manager
192      * associated with the POA. This operation may only be
193      * invoked once after a POA has been created. Attempting
194      * to set the servant manager after one has already
195      * been set will result in the BAD_INV_ORDER exception
196      * being raised.
197      * @param imgr servant manager to be used as a default.
198      * @exception WrongPolicy raised if the
199      * USE_SERVANT_MANAGER policy is not specified.
200      */

201   void set_servant_manager (org.omg.PortableServer.ServantManager JavaDoc imgr) throws org.omg.PortableServer.POAPackage.WrongPolicy JavaDoc;
202
203   /**
204      * This operation returns the default servant associated
205      * with the POA.
206      * @return p_servant default servant associated with a POA.
207      * @exception NoServant raised if no default servant is
208      * associated with the POA.
209      * @exception WrongPolicy raised if the
210      * USE_DEFAULT_SERVANT policy is not specified.
211      */

212   org.omg.PortableServer.Servant JavaDoc get_servant () throws org.omg.PortableServer.POAPackage.NoServant JavaDoc, org.omg.PortableServer.POAPackage.WrongPolicy JavaDoc;
213
214   /**
215      *
216      * This operation registers the specified servant with
217      * the POA as the default servant. This servant will
218      * be used for all requests for which no servant is
219      * found in the Active Object Map.
220      * @param p_servant servant to be used as a default.
221      * @exception WrongPolicy raised if the
222      * USE_DEFAULT_SERVANT policy is not specified.
223      */

224   void set_servant (org.omg.PortableServer.Servant JavaDoc p_servant) throws org.omg.PortableServer.POAPackage.WrongPolicy JavaDoc;
225
226   /**
227      *
228      * This operation generates an Object Id and enters
229      * the Object Id and the specified servant in the
230      * Active Object Map.
231      * @param p_servant servant to be associated with an
232      * object to be activated.
233      * @return POA generated object id.
234      * @exception ServantAlreadyActive is raised if the
235      * POA has UNIQUE_ID policy and servant is
236      * is already in the Active Object Map.
237      * @exception WrongPolicy raised if the SYSTEM_ID and
238      * RETAIN policies are not specified.
239      */

240   byte[] activate_object (org.omg.PortableServer.Servant JavaDoc p_servant) throws org.omg.PortableServer.POAPackage.ServantAlreadyActive JavaDoc, org.omg.PortableServer.POAPackage.WrongPolicy JavaDoc;
241
242   /**
243          * This operation enters an association between the
244      * specified Object Id and the specified servant in the
245      * Active Object Map.
246      * @param id object id for the object to be activated.
247      * @param p_servant servant to be associated with the
248      * object.
249      * @exception ServantAlreadyActive raised if the POA
250      * has the UNIQUE_ID policy and the servant
251      * is already in the Active Object Map.
252      * @exception ObjectAlreadyActive raised if the object is
253      * already active in the POA.
254          * @exception WrongPolicy raised if the RETAIN policy is
255          * is not specified.
256          */

257   void activate_object_with_id (byte[] id, org.omg.PortableServer.Servant JavaDoc p_servant) throws org.omg.PortableServer.POAPackage.ServantAlreadyActive JavaDoc, org.omg.PortableServer.POAPackage.ObjectAlreadyActive JavaDoc, org.omg.PortableServer.POAPackage.WrongPolicy JavaDoc;
258
259   /**
260      *
261      * This operation causes the ObjectId specified in the
262      * oid parameter to be deactivated. An ObjectId which
263      * has been deactivated continues to process requests
264      * until there are no active requests for that ObjectId.
265      * A deactivated ObjectId is removed from the Active
266      * Object Map when all requests executing for that
267      * ObjectId have completed.
268      * @param oid Object Id for the object to be deactivated.
269      * @exception ObjectNotActive if the object with the
270      * specified oid is not in the Active Object
271      * Map.
272      * @exception WrongPolicy raised if the RETAIN policy is
273      * is not specified.
274      */

275   void deactivate_object (byte[] oid) throws org.omg.PortableServer.POAPackage.ObjectNotActive JavaDoc, org.omg.PortableServer.POAPackage.WrongPolicy JavaDoc;
276
277   /**
278      * This operation creates an object reference that
279      * encapsulates a POA-generated Object Id value and
280      * the specified interface repository id.
281      *
282      * @param intf rep id for creating an object reference.
283      * @return object reference created using intf.
284      * @exception WrongPolicy if SYSTEM_ID policy is not
285      * specified.
286      */

287   org.omg.CORBA.Object JavaDoc create_reference (String JavaDoc intf) throws org.omg.PortableServer.POAPackage.WrongPolicy JavaDoc;
288
289   /**
290      * This operation creates an object reference that
291      * encapsulates the specified Object Id and interface
292      * repository Id values. It does not cause an activation
293      * to take place. The resulting reference may be passed
294      * to clients, so that subsequent requests on those
295      * references will cause the object to be activated
296      * if necessary, or the default servant used, depending
297      * on the applicable policies.
298      * @param oid object id for creating an objref
299      * @param intf rep id for creating an objref
300      * @return object reference created using oid and intf
301      * @exception BAD_PARAM is raised if the POA has the
302      * SYSTEM_ID policy and it detects that the
303      * Object Id value was not generated by the
304      * system or for this POA.
305      */

306   org.omg.CORBA.Object JavaDoc create_reference_with_id (byte[] oid, String JavaDoc intf);
307
308   /**
309      * This operation has four possible behaviors.
310      * 1. If the POA has the UNIQUE_ID policy and the
311      * specified servant is active, the Object Id associated
312      * with that servant is returned.
313      * 2. If the POA has the IMPLICIT_ACTIVATION policy and
314      * either the POA has the MULTIPLE_ID policy or the
315      * specified servant is not active, the servant is
316      * activated using a POA-generated Object Id and the
317      * Interface Id associated with the servant, and that
318      * Object Id is returned.
319      * 3. If the POA has the USE_DEFAULT_SERVANT policy,
320      * the servant specified is the default servant, and the
321      * operation is being invoked in the context of executing
322      * a request on the default servant, then the ObjectId
323      * associated with the current invocation is returned.
324      * 4. Otherwise, the ServantNotActive exception is raised.
325      *
326      * @param p_servant servant for which the object disi returned.
327      * @return object id associated with the servant.
328      * @exception ServantNotActive if the above rules and
329      * policy combination is not met.
330      * @exception WrongPolicy if the USE_DEFAULT_SERVANT policy
331      * or a combination of the RETAIN policy and
332      * either the UNIQUE_ID or IMPLICIT_ACTIVATION
333      * policies are not present.
334      */

335   byte[] servant_to_id (org.omg.PortableServer.Servant JavaDoc p_servant) throws org.omg.PortableServer.POAPackage.ServantNotActive JavaDoc, org.omg.PortableServer.POAPackage.WrongPolicy JavaDoc;
336
337   /**
338      * This operation requires the RETAIN policy and either
339      * the UNIQUE_ID or IMPLICIT_ACTIVATION policies if
340      * invoked outside the context of an operation dispatched
341      * by this POA. It has four possible behaviors.
342      * 1. If the POA has both the RETAIN and the
343      * UNIQUE_ID policy and the specified servant is active,
344      * an object reference encapsulating the information used
345      * to activate the servant is returned.
346      * 2. If the POA has both the RETAIN and the
347      * IMPLICIT_ACTIVATION policy and either the POA has the
348      * MULTIPLE_ID policy or the specified servant is not
349      * active, the servant is activated using a POA-generated
350      * Object Id and the Interface Id associated with the
351      * servant, and a corresponding object reference is
352      * returned.
353      * 3. If the operation was invoked in the context of
354      * executing a request on the specified servant, the
355      * reference associated with the current invocation
356      * is returned.
357      * 4. Otherwise, the ServantNotActive exception is raised.
358      *
359      * @param p_servant servant for which the object reference
360      * needs to be obtained.
361      * @return object reference associated with the servant.
362      * @exception WrongPolicy if the operation is not invoked
363      * in the context of executing a request on
364      * the specified servant and the required
365      * policies are not present.
366      * @exception ServantNotActive if the above specified
367      * policies and rules are not met.
368      */

369   org.omg.CORBA.Object JavaDoc servant_to_reference (org.omg.PortableServer.Servant JavaDoc p_servant) throws org.omg.PortableServer.POAPackage.ServantNotActive JavaDoc, org.omg.PortableServer.POAPackage.WrongPolicy JavaDoc;
370
371   /**
372      * If the POA has the RETAIN policy and the specified
373      * object is present in the Active Object Map, this
374      * operation returns the servant associated with that
375      * object in the Active Object Map. Otherwise, if the
376      * POA has the USE_DEFAULT_SERVANT policy and a default
377      * servant has been registered with the POA, this
378      * operation returns the default servant. If the object
379      * reference was not created by this POA,
380      * the WrongAdapter exception is raised. (OMG Issue
381      * on inconsistency with the POA.IDL.
382      *
383      * @param reference object reference for which the
384      * servant is returned.
385      * @return servant associated with the reference.
386      * @exception WrongPolicy if neither the RETAIN policy or
387      * the USE_DEFAULT_SERVANT policy is present.
388      * @exception ObjectNotActive if the servant is not
389      * present in the Active Object Map (for RETAIN)
390      * or no default servant is registered (for
391      * USE_DEFAULT_POLICY).
392      * @exception WrongAdapter if reference was not created by
393      * this POA instance.
394      */

395   org.omg.PortableServer.Servant JavaDoc reference_to_servant (org.omg.CORBA.Object JavaDoc reference) throws org.omg.PortableServer.POAPackage.ObjectNotActive JavaDoc, org.omg.PortableServer.POAPackage.WrongPolicy JavaDoc, org.omg.PortableServer.POAPackage.WrongAdapter JavaDoc;
396
397   /**
398      * This operation returns the Object Id value
399      * encapsulated by the specified reference. This
400      * operation is valid only if the reference was created
401      * by the POA on which the operation is being performed.
402      * The object denoted by the reference does not have
403      * to be active for this operation to succeed.
404      *
405      * @param reference the object reference from which the
406      * object id needs to be returned.
407      * @return object id encapsulated in the reference.
408      * @exception WrongAdapter if the reference was not
409      * created by the POA specified in the
410      * reference.
411      * @exception WrongPolicy declared to allow future
412      * extensions.
413      *
414      */

415   byte[] reference_to_id (org.omg.CORBA.Object JavaDoc reference) throws org.omg.PortableServer.POAPackage.WrongAdapter JavaDoc, org.omg.PortableServer.POAPackage.WrongPolicy JavaDoc;
416
417   /**
418      * If the POA has the RETAIN policy and the specified
419      * ObjectId is in the Active Object Map, this operation
420      * returns the servant associated with that object in
421      * the Active Object Map. Otherwise, if the POA has
422      * the USE_DEFAULT_SERVANT policy and a default servant
423      * has been registered with the POA, this operation
424      * returns the default servant.
425      *
426      * @param oid object id for the which the servant is
427      * returned.
428      * @return servant associated with oid.
429      * @exception ObjectNotActive is raised if ObjectId is
430      * is not in the Active Object Map (for RETAIN
431      * policy), or no default servant is registered
432      * (for USE_DEFAULT_SERVANT policy).
433      *
434      * @exception WrongPolicy is raised if the RETAIN policy
435      * or the USE_DEFAULT_SERVANT
436      * policy is not present.
437      */

438   org.omg.PortableServer.Servant JavaDoc id_to_servant (byte[] oid) throws org.omg.PortableServer.POAPackage.ObjectNotActive JavaDoc, org.omg.PortableServer.POAPackage.WrongPolicy JavaDoc;
439
440   /**
441      * If an object with the specified Object Id value is
442      * currently active, a reference encapsulating the
443      * information used to activate the object is returned.
444      *
445      * @param oid id of the object for which the
446      * reference is returned.
447      * @return the object reference
448      *
449      * @exception ObjectNotActive if the Object Id value
450      * is not active in the POA.
451      * @exception WrongPolicy if the RETAIN policy is not
452      * present.
453      */

454   org.omg.CORBA.Object JavaDoc id_to_reference (byte[] oid) throws org.omg.PortableServer.POAPackage.ObjectNotActive JavaDoc, org.omg.PortableServer.POAPackage.WrongPolicy JavaDoc;
455
456   /**
457      * This returns the unique id of the POA in the process in which it
458      * is created. It is for use by portable interceptors.
459      * <p>
460      * This id is guaranteed unique for the life span of the POA in the
461      * process. For persistent POAs, this means that if a POA is created
462      * in the same path with the same name as another POA, these POAs
463      * are identical and, therefore, have the same id. For transient
464      * POAs, each POA is unique.
465      */

466   byte[] id ();
467 } // interface POAOperations
468
Popular Tags