Package com.sun.corba.ee.spi.extension
Class ServantCachingPolicy
- java.lang.Object
-
- org.omg.CORBA.LocalObject
-
- com.sun.corba.ee.spi.extension.ServantCachingPolicy
-
- All Implemented Interfaces:
java.io.Serializable
,Object
,Policy
,PolicyOperations
,IDLEntity
public class ServantCachingPolicy extends LocalObject implements Policy
Policy used to implement servant caching optimization in the POA. Creating a POA with an instance pol of this policy where pol.getType() > NO_SERVANT_CACHING will cause the servant to be looked up in the POA and cached in the LocalClientRequestDispatcher when the ClientRequestDispatcher is colocated with the implementation of the objref. This greatly speeds up invocations at the cost of violating the POA semantics. In particular, every request to a particular objref must be handled by the same servant. Note that this is typically the case for EJB implementations.If servant caching is used, there are two different additional features of the POA that are expensive:
- POA current semantics
- Proper handling of POA destroy.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
FULL_SEMANTICS
Perform servant caching, preserving POA current and POA destroy semantics.static int
INFO_ONLY_SEMANTICS
Perform servant caching, preservent only POA current semantics.private static ServantCachingPolicy
infoOnlyPolicy
static int
MINIMAL_SEMANTICS
Perform servant caching, not preserving POA current or POA destroy semantics.private static ServantCachingPolicy
minimalPolicy
static int
NO_SERVANT_CACHING
Do not cache servants in the ClientRequestDispatcher.private static ServantCachingPolicy
policy
private int
type
-
Constructor Summary
Constructors Modifier Constructor Description private
ServantCachingPolicy(int type)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Policy
copy()
Returns a copy of thePolicy
object.void
destroy()
Destroys thePolicy
object.static ServantCachingPolicy
getFullPolicy()
static ServantCachingPolicy
getInfoOnlyPolicy()
static ServantCachingPolicy
getMinimalPolicy()
static ServantCachingPolicy
getPolicy()
Return the default servant caching policy.int
getType()
int
policy_type()
Returns the constant value that corresponds to the type of the policy object.java.lang.String
toString()
java.lang.String
typeToName()
-
Methods inherited from class org.omg.CORBA.LocalObject
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface, _get_interface_def, _get_policy, _hash, _invoke, _is_a, _is_equivalent, _is_local, _non_existent, _orb, _release, _releaseReply, _request, _request, _servant_postinvoke, _servant_preinvoke, _set_policy_override, validate_connection
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.omg.CORBA.Object
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_policy, _hash, _is_a, _is_equivalent, _non_existent, _release, _request, _set_policy_override
-
-
-
-
Field Detail
-
NO_SERVANT_CACHING
public static final int NO_SERVANT_CACHING
Do not cache servants in the ClientRequestDispatcher. This will always support the full POA semantics, including changing the servant that handles requests on a particular objref.- See Also:
- Constant Field Values
-
FULL_SEMANTICS
public static final int FULL_SEMANTICS
Perform servant caching, preserving POA current and POA destroy semantics. We will use this as the new default, as the app server is making heavier use now of POA facilities.- See Also:
- Constant Field Values
-
INFO_ONLY_SEMANTICS
public static final int INFO_ONLY_SEMANTICS
Perform servant caching, preservent only POA current semantics. At least this level is required in order to support selection of ObjectCopiers for co-located RMI-IIOP calls, as the current copier is stored in OAInvocationInfo, which must be present on the stack inside the call.- See Also:
- Constant Field Values
-
MINIMAL_SEMANTICS
public static final int MINIMAL_SEMANTICS
Perform servant caching, not preserving POA current or POA destroy semantics.- See Also:
- Constant Field Values
-
policy
private static ServantCachingPolicy policy
-
infoOnlyPolicy
private static ServantCachingPolicy infoOnlyPolicy
-
minimalPolicy
private static ServantCachingPolicy minimalPolicy
-
type
private int type
-
-
Method Detail
-
typeToName
public java.lang.String typeToName()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getType
public int getType()
-
getPolicy
public static ServantCachingPolicy getPolicy()
Return the default servant caching policy.- Returns:
- default policy
-
getFullPolicy
public static ServantCachingPolicy getFullPolicy()
-
getInfoOnlyPolicy
public static ServantCachingPolicy getInfoOnlyPolicy()
-
getMinimalPolicy
public static ServantCachingPolicy getMinimalPolicy()
-
policy_type
public int policy_type()
Description copied from interface:PolicyOperations
Returns the constant value that corresponds to the type of the policy object. The values of the policy objects are allocated by the OMG. New values for PolicyType should be obtained from the OMG by sending mail to request@omg.org. In general the constant values that are allocated are defined in conjunction with the definition of the corresponding policy object.- Specified by:
policy_type
in interfacePolicyOperations
- Returns:
- the constant value that corresponds to the type of the policy object
-
copy
public Policy copy()
Description copied from interface:PolicyOperations
Returns a copy of thePolicy
object. The copy does not retain any relationships that the policy had with any domain or object.- Specified by:
copy
in interfacePolicyOperations
- Returns:
- a copy of the
Policy
object
-
destroy
public void destroy()
Description copied from interface:PolicyOperations
Destroys thePolicy
object. It is the responsibility of thePolicy
object to determine whether it can be destroyed.- Specified by:
destroy
in interfacePolicyOperations
-
-