org.nees.util.sessions
Class AuthenticatedSessionProvider

java.lang.Object
  extended byorg.nees.util.sessions.SessionProvider
      extended byorg.nees.util.sessions.AuthenticatedSessionProvider

public class AuthenticatedSessionProvider
extends SessionProvider

This class manages a session factory and provides a session when asked for. If a provided session fails while executing commands (because of a service becoming unavailable, or credentials expiring, etc.) the provider will attempt to acquire a new session from the factory. This relieves applications from having to worry about sessions expiring.

Users of AuthenticatedSessionProvider should only cache provided sessions one or two commands, then call getSession again.


Constructor Summary
AuthenticatedSessionProvider(AuthenticatedSessionFactory sessionFactory)
           
 
Method Summary
 Session getSession(AuthenticIdentity aId)
           
 
Methods inherited from class org.nees.util.sessions.SessionProvider
getSession, releaseSession
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthenticatedSessionProvider

public AuthenticatedSessionProvider(AuthenticatedSessionFactory sessionFactory)
Parameters:
sessionFactory - the factory to use to create new sessions.
Method Detail

getSession

public Session getSession(AuthenticIdentity aId)
                   throws SessionUnavailableException
Throws:
SessionUnavailableException