EhCacheXAResourceHolder (Bitronix Transaction Manager :: Core 2.1.4 API)
Date: 2013-09-15

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## bitronix.tm.resource.ehcache
Class EhCacheXAResourceHolder

    java.lang.Object
      bitronix.tm.resource.common.AbstractXAStatefulHolder
          bitronix.tm.resource.common.AbstractXAResourceHolder
              bitronix.tm.resource.ehcache.EhCacheXAResourceHolder

All Implemented Interfaces:
  XAResourceHolder, XAStatefulHolder

    public class EhCacheXAResourceHolder

extends AbstractXAResourceHolder

Ehcache implementation of BTM's XAResourceHolder.

Copyright 2003-2010 Terracotta, Inc.

Author:
  lorban

Field Summary

Fields inherited from interface bitronix.tm.resource.common.XAStatefulHolder
`STATE_ACCESSIBLE, STATE_CLOSED, STATE_IN_POOL, STATE_NOT_ACCESSIBLE`

Constructor Summary
`EhCacheXAResourceHolder(XAResource resource, ResourceBean bean)` Create a new EhCacheXAResourceHolder for a particular XAResource

Method Summary
`void` | `close()` Close the physical connection that this `XAStatefulHolder` represents.
`Object` | `getConnectionHandle()` Create a disposable handler used to drive a pooled instance of `XAStatefulHolder`.
`Date` | `getLastReleaseDate()` Get the date at which this object was last released to the pool.
`ResourceBean` | `getResourceBean()` Get the ResourceBean which created this XAResourceHolder.
`XAResource` | `getXAResource()` Get the vendor's `XAResource` implementation of the wrapped resource.
`List<XAResourceHolder>` | `getXAResourceHolders()` Get the list of `XAResourceHolder`s created by this `XAStatefulHolder` that are still open.

Methods inherited from class bitronix.tm.resource.common.AbstractXAResourceHolder
`getXAResourceHolderStateGtrids, getXAResourceHolderStatesForGtrid, hasStateForXAResource, isParticipatingInActiveGlobalTransaction, putXAResourceHolderState, removeXAResourceHolderState`

Methods inherited from class bitronix.tm.resource.common.AbstractXAStatefulHolder
`addStateChangeEventListener, getState, removeStateChangeEventListener, setState`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface bitronix.tm.resource.common.XAStatefulHolder
`addStateChangeEventListener, getState, removeStateChangeEventListener, setState`

Constructor Detail

### 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 Detail

### 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 `XAResourceHolder`s created by this `XAStatefulHolder` that are still open.

  This method is thread-safe.

  Returns:
    the list of `XAResourceHolder`s created by this `XAStatefulHolder` that are still open.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2006-2013 Bitronix Software. All Rights Reserved.