0 Replies Latest reply on Jul 12, 2006 1:10 AM by Weston M. Price

    POJO JCA

    Weston M. Price Master

      Fleshing out the jboss-jca implementation. The existing functionality leads to a few points that need to be considered in the POJO implementation.

      Pool Management/Lifecycle

      a) Typical pooling variables (min, max, idle). As an initial implementation, these can be injected via the PoolFactory.

      b) Pool lifecyle tasks (dumb runnables). My initial idea for this was dynamically setup PoolMonitors after the pool is created via a simple Advice. Basically:

      
       public Object invoke(Invocation invocation) throws Throwable
       {
       final ManagedConnectionContextPool pool = (ManagedConnectionContextPool)invocation.invokeNext();
      
       for (Iterator iter = monitors.iterator(); iter.hasNext();)
       {
       ManagedConnectionContextPoolMonitor monitor = (ManagedConnectionContextPoolMonitor) iter.next();
       monitor.setManagedConnectionContextPool(pool);
      
       }
      
       return pool;
       }
      
      


      This would be used for the IdleRemover, PoolFiller and BackgroundValidator. Also, this may be an interesting use case for the new Timer SPI (expiration tasks that do *something* to the underlying pool).

      3)Validation/ErrorHandling
      This could be encapsulated in simple advices to start.


      Advanced Pooling Features (TODO)

      Smarter Pool Handling:
      I think this is a good area for drastic improvement. Ideas off the top of my head would include

      Dynamic latch policies to reduce pool contention. This would supplant the simple Semaphore in the code today. Latch policies could be pluggable. This is a natural area for an spi.

      Generational pools (sort of like heaps) might be an interesting to think about in terms of having 'generational' handling of managed connections where time, or some other generational policy (also pluggable) would move a ManagedConnection through different phases/pools until death (timeout).

      Load optimizing pools (basically recording a history of load averages and attempting to make 'smart' anticipitory judgements about pool loads and access.
      Statistics (this really goes across JCA and is not particular to pools).

      All of the above should be pluggable via the MC/AOP etc, etc. Working examples of some of the above are going in.