< prev index next >

src/java.corba/share/classes/com/sun/corba/se/spi/extension/ServantCachingPolicy.java

Print this page




  27 
  28 import org.omg.CORBA.Policy ;
  29 import org.omg.CORBA.LocalObject ;
  30 import com.sun.corba.se.impl.orbutil.ORBConstants ;
  31 
  32 /** Policy used to implement servant caching optimization in the POA.
  33 * Creating a POA with an instance pol of this policy where
  34 * pol.getType() &gt; NO_SERVANT_CACHING will cause the servant to be
  35 * looked up in the POA and cached in the LocalClientRequestDispatcher when
  36 * the ClientRequestDispatcher is colocated with the implementation of the
  37 * objref.  This greatly speeds up invocations at the cost of violating the
  38 * POA semantics.  In particular, every request to a particular objref
  39 * must be handled by the same servant.  Note that this is typically the
  40 * case for EJB implementations.
  41 * <p>
  42 * If servant caching is used, there are two different additional
  43 * features of the POA that are expensive:
  44 * <ol>
  45 * <li>POA current semantics
  46 * <li>Proper handling of POA destroy.
  47 * <ol>
  48 * POA current semantics requires maintaining a ThreadLocal stack of
  49 * invocation information that is always available for POACurrent operations.
  50 * Maintaining this stack is expensive on the timescale of optimized co-located
  51 * calls, so the option is provided to turn it off.  Similarly, causing
  52 * POA.destroy() calls to wait for all active calls in the POA to complete
  53 * requires careful tracking of the entry and exit of invocations in the POA.
  54 * Again, tracking this is somewhat expensive.
  55 */
  56 public class ServantCachingPolicy extends LocalObject implements Policy
  57 {
  58     /** Do not cache servants in the ClientRequestDispatcher.  This will
  59      * always support the full POA semantics, including changing the
  60      * servant that handles requests on a particular objref.
  61      */
  62     public static final int NO_SERVANT_CACHING = 0 ;
  63 
  64     /** Perform servant caching, preserving POA current and POA destroy semantics.
  65     * We will use this as the new default, as the app server is making heavier use
  66     * now of POA facilities.
  67     */




  27 
  28 import org.omg.CORBA.Policy ;
  29 import org.omg.CORBA.LocalObject ;
  30 import com.sun.corba.se.impl.orbutil.ORBConstants ;
  31 
  32 /** Policy used to implement servant caching optimization in the POA.
  33 * Creating a POA with an instance pol of this policy where
  34 * pol.getType() &gt; NO_SERVANT_CACHING will cause the servant to be
  35 * looked up in the POA and cached in the LocalClientRequestDispatcher when
  36 * the ClientRequestDispatcher is colocated with the implementation of the
  37 * objref.  This greatly speeds up invocations at the cost of violating the
  38 * POA semantics.  In particular, every request to a particular objref
  39 * must be handled by the same servant.  Note that this is typically the
  40 * case for EJB implementations.
  41 * <p>
  42 * If servant caching is used, there are two different additional
  43 * features of the POA that are expensive:
  44 * <ol>
  45 * <li>POA current semantics
  46 * <li>Proper handling of POA destroy.
  47 * </ol>
  48 * POA current semantics requires maintaining a ThreadLocal stack of
  49 * invocation information that is always available for POACurrent operations.
  50 * Maintaining this stack is expensive on the timescale of optimized co-located
  51 * calls, so the option is provided to turn it off.  Similarly, causing
  52 * POA.destroy() calls to wait for all active calls in the POA to complete
  53 * requires careful tracking of the entry and exit of invocations in the POA.
  54 * Again, tracking this is somewhat expensive.
  55 */
  56 public class ServantCachingPolicy extends LocalObject implements Policy
  57 {
  58     /** Do not cache servants in the ClientRequestDispatcher.  This will
  59      * always support the full POA semantics, including changing the
  60      * servant that handles requests on a particular objref.
  61      */
  62     public static final int NO_SERVANT_CACHING = 0 ;
  63 
  64     /** Perform servant caching, preserving POA current and POA destroy semantics.
  65     * We will use this as the new default, as the app server is making heavier use
  66     * now of POA facilities.
  67     */


< prev index next >