Interface PoolingRepository

All Superinterfaces:
PoolingRepositoryMBean, Repository

public interface PoolingRepository extends Repository, PoolingRepositoryMBean
Interface extending Repository to allow transparent access to internal session pooling implementation.
Version:
$Id$
  • Method Details

    • returnSession

      void returnSession(Session session)
      Returns the session to the pool.

      Note: There is no guard to prevent an object being returned to the pool multiple times. Clients are expected to discard references to returned objects and ensure that an object is not returned to the pool multiple times in sequence (i.e., without being borrowed again between returns). Violating this contract will result in the same object appearing multiple times in the pool and pool counters (numActive, numIdle) returning incorrect values.

      Parameters:
      session -
    • getResourceLifecycleManagement

      ResourceLifecycleManagement getResourceLifecycleManagement()
      Returns the resource lifecycle management implementation of this pool.
      See Also:
    • impersonate

      Session impersonate(Credentials credentials) throws LoginException, RepositoryException
      Tries impersonation by the provided the credentials. If this pooling repository is contained in a MultipleRepository implementation and the containing MultipleRepository has a proper repository for the provided credentials, then it can return a proper session impersonated. Otherwise, it returns null.
      Parameters:
      credentials -
      Throws:
      LoginException
      RepositoryException
    • setSessionsRefreshPendingAfter

      void setSessionsRefreshPendingAfter(long sessionsRefreshPendingTimeMillis)
      Sets time millis to have each session be refreshed on activation if the session is not refreshed after the specified time millis.
      Parameters:
      sessionsRefreshPendingTimeMillis -
    • setSessionsInvalidIfCreatedBeforeTimeMillis

      void setSessionsInvalidIfCreatedBeforeTimeMillis(long sessionsInvalidIfCreatedBeforeTimeMillis)
      Sets max acceptable PooledSession.timeCreated timestamp, in millis. Sessions created before this time should be disposed of.
    • getPoolingCounter

      PoolingCounter getPoolingCounter()
      Returns pooling counter.
    • isActive

      boolean isActive()
      Returns true if pooling repository is initialized to be available and not closed.
    • isDisposableWhenNotInUse

      boolean isDisposableWhenNotInUse()
      Returns true if pooling repository can be marked to be disposed when not in use. For example, if a pooling repository can be disposable at runtime, then this should return true.
      Returns:
      true if it is possible that this PoolingRepository gets marked to be disposable when it is not in use
      See Also:
    • isMarkedForDisposal

      boolean isMarkedForDisposal()
      Returns true if this PoolingRepository is marked for disposal. When a PoolingRepository is marked for disposal, it should not be used any more This can return true only when isDisposableWhenNotInUse() returns true.
      Returns:
      true if this PoolingRepository is marked for disposal
      See Also: