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.Context
complete()
Complete this context without a session.SessionProvider.Context
complete(Session session)
Complete this context.SessionProvider
defaultProvider()
Returns the default session provider that may be used to delegate to for session creation.Iterable<? extends EventInterceptor<?>>
getInterceptors()
Returns zero or moreEventInterceptor
instances to add to the session.Coherence.Mode
getMode()
Returns the mode thatCoherence
is running in.String
getScopePrefix()
Return any prefix to prepend to the scope name of the session.Session
getSession()
Return theSession
created by the provider, ornull
if no session could be created.boolean
hasSession()
Returntrue
if the context contains a non-nullSession
instance.boolean
isComplete()
Returntrue
if 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 defaultSessionProvider
sScopePrefix
- 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.Context
Returns the mode thatCoherence
is running in.- Specified by:
getMode
in interfaceSessionProvider.Context
- Returns:
- the mode that
Coherence
is running in
-
complete
public SessionProvider.Context complete(Session session)
Description copied from interface:SessionProvider.Context
Complete this context.- Specified by:
complete
in interfaceSessionProvider.Context
- Parameters:
session
- theSession
created by the provider.- Returns:
- a completed
SessionProvider.Context
containing theSession
-
complete
public SessionProvider.Context complete()
Description copied from interface:SessionProvider.Context
Complete this context without a session.This will cause the root provider to return a
null
session without trying any further providers in its chain.- Specified by:
complete
in interfaceSessionProvider.Context
- Returns:
- a completed empty
SessionProvider.Context
-
isComplete
public boolean isComplete()
Description copied from interface:SessionProvider.Context
Returntrue
if this context has been completed.- Specified by:
isComplete
in interfaceSessionProvider.Context
- Returns:
true
if this context has been completed
-
hasSession
public boolean hasSession()
Description copied from interface:SessionProvider.Context
Returntrue
if the context contains a non-nullSession
instance.- Specified by:
hasSession
in interfaceSessionProvider.Context
- Returns:
true
if the context contains a non-nullSession
instance
-
getSession
public Session getSession()
Description copied from interface:SessionProvider.Context
Return theSession
created by the provider, ornull
if no session could be created.- Specified by:
getSession
in interfaceSessionProvider.Context
- Returns:
- the
Session
created by the provider ornull
if no session could be created
-
defaultProvider
public SessionProvider defaultProvider()
Description copied from interface:SessionProvider.Context
Returns the default session provider that may be used to delegate to for session creation.- Specified by:
defaultProvider
in interfaceSessionProvider.Context
- Returns:
- the default session provider
-
getInterceptors
public Iterable<? extends EventInterceptor<?>> getInterceptors()
Description copied from interface:SessionProvider.Context
Returns zero or moreEventInterceptor
instances to add to the session.- Specified by:
getInterceptors
in interfaceSessionProvider.Context
- Returns:
- zero or more
EventInterceptor
instances to add to the session
-
getScopePrefix
public String getScopePrefix()
Description copied from interface:SessionProvider.Context
Return any prefix to prepend to the scope name of the session.- Specified by:
getScopePrefix
in interfaceSessionProvider.Context
- Returns:
- any prefix to prepend to the scope name of the session
-
-