User: vharcq  
  Date: 01/12/23 11:50:47

  Modified:    src/main/org/jboss/ejb InstancePool.java
  Added:       src/main/org/jboss/ejb InstancePoolFeeder.java
  Log:
  Add a pool feeder to create asynchronously instances of beans and push them in the 
pool stack.
  Look at jboss.dtd for information on parameters
  
  Revision  Changes    Path
  1.9       +31 -8     jboss/src/main/org/jboss/ejb/InstancePool.java
  
  Index: InstancePool.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/InstancePool.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- InstancePool.java 2001/11/24 20:43:22     1.8
  +++ InstancePool.java 2001/12/23 19:50:47     1.9
  @@ -11,37 +11,52 @@
   
   /**
    * Defines the model for a EnterpriseContext instance pool.
  - *      
  + *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Rickard �berg</a>
  - * @version $Revision: 1.8 $
  - *      
  + * @version $Revision: 1.9 $
  + *
    * <p><b>Revisions:</b>
    * <p><b>20010718 andreas schaefer:</b>
    * <ul>
    * <li>- Marked the InstancePool as Statistics Provider
    * </ul>
  + * <p><b>20011208 Vincent Harcq:</b>
  + * <ul>
  + * <li> Added a Pool Feeder (Thread that pre-create bean instances to avoid
  + *      setContext overhead.
  + * </ul>
    */
   public interface InstancePool
      extends ContainerPlugin, StatisticsProvider
   {
      /**
  +    *  Add an instance in the Pool.
  +    *  Is used by the TimedInstancePoolFeeder thread to create instances ready for 
use by
  +    *  the interceptor.
  +    *
  +    * @exception Exception when an Instance can not be instantiated
  +    */
  +   public void add()
  +         throws Exception;
  +
  +   /**
       * Get an instance without identity.
  -    * 
  +    *
       * <p>Can be used by finders and create-methods, or stateless beans
       *
       * @return    Context/w instance
  -    * 
  -    * @throws Exception    RemoteException  
  +    *
  +    * @throws Exception    RemoteException
       */
      EnterpriseContext get() throws Exception;
  -   
  +
      /**
       * Return an anonymous instance after invocation.
       *
       * @param ctx    The context to free.
       */
      void free(EnterpriseContext ctx);
  -   
  +
      /**
       * Discard an anonymous instance after invocation.
       * This is called if the instance should not be reused, perhaps due to some
  @@ -50,5 +65,13 @@
       * @param ctx    The context to discard.
       */
      void discard(EnterpriseContext ctx);
  +
  +   /**
  +    * Return the size of the pool.
  +    *
  +    * @return the size of the pool.
  +    */
  +   int getCurrentSize();
  +
   }
   
  
  
  
  1.1                  jboss/src/main/org/jboss/ejb/InstancePoolFeeder.java
  
  Index: InstancePoolFeeder.java
  ===================================================================
  /*
   * JBoss, the OpenSource EJB server
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  package org.jboss.ejb;
  
  import org.jboss.metadata.XmlLoadable;
  import org.jboss.ejb.InstancePool;
  
  /**
   * Interface for bean instances Pool Feeder
   *
   * @author <a href="mailto:[EMAIL PROTECTED]";>Vincent Harcq</a>
   *
   * @version $Revision: 1.1 $
   */
  public interface InstancePoolFeeder
        extends XmlLoadable
  {
  
     /**
      * Start the pool feeder.
      */
     public void start();
  
     /**
      * Stop the pool feeder.
      */
     public void stop();
  
     /**
      * Sets the instance pool inside the pool feeder.
      *
      * @param ip the instance pool
      */
     public void setInstancePool(InstancePool ip);
  
     /**
      * Tells if the pool feeder is already started.
      * The reason is that we start the PF at first get() on the pool and we
      * want to give a warning to the user when the pool is empty.
      *
      * @return true if started
      */
     public boolean isStarted();
  
  }
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to