KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > impl > oa > poa > POAPolicyMediator


1 /*
2  * @(#)POAPolicyMediator.java 1.23 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.corba.se.impl.oa.poa ;
9
10 import org.omg.PortableServer.Servant JavaDoc ;
11 import org.omg.PortableServer.ServantManager JavaDoc ;
12 import org.omg.PortableServer.ForwardRequest JavaDoc ;
13
14 import org.omg.PortableServer.POAPackage.ObjectAlreadyActive JavaDoc ;
15 import org.omg.PortableServer.POAPackage.ServantAlreadyActive JavaDoc ;
16 import org.omg.PortableServer.POAPackage.ServantNotActive JavaDoc ;
17 import org.omg.PortableServer.POAPackage.NoServant JavaDoc ;
18 import org.omg.PortableServer.POAPackage.WrongPolicy JavaDoc ;
19 import org.omg.PortableServer.POAPackage.ObjectNotActive JavaDoc ;
20
21 /** POAPolicyMediator defines an interface to which the POA delegates all
22  * policy specific operations. This permits code paths for different
23  * policies to be optimized by creating the correct code at POA creation
24  * time. Also note that as much as possible, this interface does not
25  * do any concurrency control, except as noted. The POA is responsible
26  * for concurrency control.
27  */

28 public interface POAPolicyMediator {
29     /** Return the policies object that was used to create this
30     * POAPolicyMediator.
31     */

32     Policies getPolicies() ;
33
34     /** Return the subcontract ID to use in the IIOP profile in IORs
35     * created by this POAPolicyMediator's POA. This is initialized
36     * according to the policies and the POA used to construct this
37     * POAPolicyMediator in the POAPolicyMediatorFactory.
38     */

39     int getScid() ;
40
41     /** Return the server ID to use in the IIOP profile in IORs
42     * created by this POAPolicyMediator's POA. This is initialized
43     * according to the policies and the POA used to construct this
44     * POAPolicyMediator in the POAPolicyMediatorFactory.
45     */

46     int getServerId() ;
47
48     /** Get the servant to use for an invocation with the
49     * given id and operation.
50     * @param id the object ID for which we are requesting a servant
51     * @param operation the name of the operation to be performed on
52     * the servant
53     * @return the resulting Servant.
54     */

55     java.lang.Object JavaDoc getInvocationServant( byte[] id,
56     String JavaDoc operation ) throws ForwardRequest JavaDoc ;
57
58     /** Release a servant that was obtained from getInvocationServant.
59     */

60     void returnServant() ;
61
62     /** Etherealize all servants associated with this POAPolicyMediator.
63     * Does nothing if the retention policy is non-retain.
64     */

65     void etherealizeAll() ;
66
67     /** Delete everything in the active object map.
68     */

69     void clearAOM() ;
70
71     /** Return the servant manager. Will throw WrongPolicy
72     * if the request processing policy is not USE_SERVANT_MANAGER.
73     */

74     ServantManager JavaDoc getServantManager() throws WrongPolicy JavaDoc ;
75
76     /** Set the servant manager. Will throw WrongPolicy
77     * if the request processing policy is not USE_SERVANT_MANAGER.
78     */

79     void setServantManager( ServantManager JavaDoc servantManager ) throws WrongPolicy JavaDoc ;
80
81     /** Return the default servant. Will throw WrongPolicy
82     * if the request processing policy is not USE_DEFAULT_SERVANT.
83     */

84     Servant JavaDoc getDefaultServant() throws NoServant JavaDoc, WrongPolicy JavaDoc ;
85
86     /** Set the default servant. Will throw WrongPolicy
87     * if the request processing policy is not USE_DEFAULT_SERVANT.
88     */

89     void setDefaultServant( Servant JavaDoc servant ) throws WrongPolicy JavaDoc ;
90
91     void activateObject( byte[] id, Servant JavaDoc servant )
92     throws ObjectAlreadyActive JavaDoc, ServantAlreadyActive JavaDoc, WrongPolicy JavaDoc ;
93
94     /** Deactivate the object that is associated with the given id.
95     * Returns the servant for id.
96     */

97     Servant JavaDoc deactivateObject( byte[] id ) throws ObjectNotActive JavaDoc, WrongPolicy JavaDoc ;
98
99     /** Allocate a new, unique system ID. Requires the ID assignment policy
100     * to be SYSTEM.
101     */

102     byte[] newSystemId() throws WrongPolicy JavaDoc ;
103
104     byte[] servantToId( Servant JavaDoc servant ) throws ServantNotActive JavaDoc, WrongPolicy JavaDoc ;
105
106     Servant JavaDoc idToServant( byte[] id ) throws ObjectNotActive JavaDoc, WrongPolicy JavaDoc ;
107 }
108
Popular Tags