Package com.tangosol.net
Class SessionProvider.DefaultContext
- java.lang.Object
-
- com.tangosol.net.SessionProvider.DefaultContext
-
- All Implemented Interfaces:
SessionProvider.Context
- Enclosing interface:
- SessionProvider
public static class SessionProvider.DefaultContext extends Object implements SessionProvider.Context
-
-
Constructor Summary
Constructors Constructor Description DefaultContext(Coherence.Mode mode, SessionProvider provider, Iterable<? extends EventInterceptor<?>> interceptors, String sScopePrefix)Create a new default context.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SessionProvider.Contextcomplete()Complete this context without a session.SessionProvider.Contextcomplete(Session session)Complete this context.SessionProviderdefaultProvider()Returns the default session provider that may be used to delegate to for session creation.Iterable<? extends EventInterceptor<?>>getInterceptors()Returns zero or moreEventInterceptorinstances to add to the session.Coherence.ModegetMode()Returns the mode thatCoherenceis running in.StringgetScopePrefix()Return any prefix to prepend to the scope name of the session.SessiongetSession()Return theSessioncreated by the provider, ornullif no session could be created.booleanhasSession()Returntrueif the context contains a non-nullSessioninstance.booleanisComplete()Returntrueif this context has been completed.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.tangosol.net.SessionProvider.Context
createSession
-
-
-
-
Constructor Detail
-
DefaultContext
public DefaultContext(Coherence.Mode mode, SessionProvider provider, Iterable<? extends EventInterceptor<?>> interceptors, String sScopePrefix)
Create a new default context.- Parameters:
mode- the mode to create the sessionprovider- the defaultSessionProvidersScopePrefix- the prefix to prepend to the session scopeinterceptors- the interceptors to add to the session- Throws:
NullPointerException- if either parameter isnull
-
-
Method Detail
-
getMode
public Coherence.Mode getMode()
Description copied from interface:SessionProvider.ContextReturns the mode thatCoherenceis running in.- Specified by:
getModein interfaceSessionProvider.Context- Returns:
- the mode that
Coherenceis running in
-
complete
public SessionProvider.Context complete(Session session)
Description copied from interface:SessionProvider.ContextComplete this context.- Specified by:
completein interfaceSessionProvider.Context- Parameters:
session- theSessioncreated by the provider.- Returns:
- a completed
SessionProvider.Contextcontaining theSession
-
complete
public SessionProvider.Context complete()
Description copied from interface:SessionProvider.ContextComplete this context without a session.This will cause the root provider to return a
nullsession without trying any further providers in its chain.- Specified by:
completein interfaceSessionProvider.Context- Returns:
- a completed empty
SessionProvider.Context
-
isComplete
public boolean isComplete()
Description copied from interface:SessionProvider.ContextReturntrueif this context has been completed.- Specified by:
isCompletein interfaceSessionProvider.Context- Returns:
trueif this context has been completed
-
hasSession
public boolean hasSession()
Description copied from interface:SessionProvider.ContextReturntrueif the context contains a non-nullSessioninstance.- Specified by:
hasSessionin interfaceSessionProvider.Context- Returns:
trueif the context contains a non-nullSessioninstance
-
getSession
public Session getSession()
Description copied from interface:SessionProvider.ContextReturn theSessioncreated by the provider, ornullif no session could be created.- Specified by:
getSessionin interfaceSessionProvider.Context- Returns:
- the
Sessioncreated by the provider ornullif no session could be created
-
defaultProvider
public SessionProvider defaultProvider()
Description copied from interface:SessionProvider.ContextReturns the default session provider that may be used to delegate to for session creation.- Specified by:
defaultProviderin interfaceSessionProvider.Context- Returns:
- the default session provider
-
getInterceptors
public Iterable<? extends EventInterceptor<?>> getInterceptors()
Description copied from interface:SessionProvider.ContextReturns zero or moreEventInterceptorinstances to add to the session.- Specified by:
getInterceptorsin interfaceSessionProvider.Context- Returns:
- zero or more
EventInterceptorinstances to add to the session
-
getScopePrefix
public String getScopePrefix()
Description copied from interface:SessionProvider.ContextReturn any prefix to prepend to the scope name of the session.- Specified by:
getScopePrefixin interfaceSessionProvider.Context- Returns:
- any prefix to prepend to the scope name of the session
-
-