Class EhCacheXAResourceHolder

All Implemented Interfaces:
XAResourceHolder, XAStatefulHolder

public class EhCacheXAResourceHolder extends AbstractXAResourceHolder
Ehcache implementation of BTM's XAResourceHolder.

Copyright 2003-2010 Terracotta, Inc.

Author:
lorban
  • Constructor Details

    • EhCacheXAResourceHolder

      public EhCacheXAResourceHolder(XAResource resource, ResourceBean bean)
      Create a new EhCacheXAResourceHolder for a particular XAResource
      Parameters:
      resource - the required XAResource
      bean - the required ResourceBean
  • Method Details

    • getXAResource

      public XAResource getXAResource()
      Get the vendor's XAResource implementation of the wrapped resource.
      Returns:
      the vendor's XAResource implementation.
    • getResourceBean

      public ResourceBean getResourceBean()
      Get the ResourceBean which created this XAResourceHolder.
      Returns:
      the ResourceBean which created this XAResourceHolder.
    • close

      public void close() throws Exception
      Close the physical connection that this XAStatefulHolder represents.
      Throws:
      Exception - a resource-specific exception thrown when there is an error closing the physical connection.
    • getConnectionHandle

      public Object getConnectionHandle() throws Exception
      Create a disposable handler used to drive a pooled instance of XAStatefulHolder.

      This method is thread-safe.

      Returns:
      a resource-specific disaposable connection object.
      Throws:
      Exception - a resource-specific exception thrown when the disaposable connection cannot be created.
    • getLastReleaseDate

      public Date getLastReleaseDate()
      Get the date at which this object was last released to the pool. This is required to check if it is eligible for discard when the containing pool needs to shrink.
      Returns:
      the date at which this object was last released to the pool or null if it never left the pool.
    • getXAResourceHolders

      public List<XAResourceHolder> getXAResourceHolders()
      Get the list of XAResourceHolders created by this XAStatefulHolder that are still open.

      This method is thread-safe.

      Returns:
      the list of XAResourceHolders created by this XAStatefulHolder that are still open.