Interface PoolingRepository

  • All Superinterfaces:
    PoolingRepositoryMBean, javax.jcr.Repository

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

      • returnSession

        void returnSession​(javax.jcr.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 -
      • impersonate

        javax.jcr.Session impersonate​(javax.jcr.Credentials credentials)
                               throws javax.jcr.LoginException,
                                      javax.jcr.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:
        javax.jcr.LoginException
        javax.jcr.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()