org.nakedobjects.runtime.context
Class NakedObjectsContextStatic

java.lang.Object
  extended by org.nakedobjects.runtime.context.NakedObjectsContext
      extended by org.nakedobjects.runtime.context.NakedObjectsContextStatic
All Implemented Interfaces:
DebugInfo

public class NakedObjectsContextStatic
extends NakedObjectsContext

Provides access to the current NakedObjectSession in a single-user deployment (and thus implemented as a static singleton).


Nested Class Summary
 
Nested classes/interfaces inherited from class org.nakedobjects.runtime.context.NakedObjectsContext
NakedObjectsContext.ContextReplacePolicy, NakedObjectsContext.SessionClosePolicy
 
Constructor Summary
protected NakedObjectsContextStatic(NakedObjectsContext.ContextReplacePolicy replacePolicy, NakedObjectsContext.SessionClosePolicy sessionClosePolicy, NakedObjectSessionFactory sessionFactory)
           
 
Method Summary
 java.lang.String[] allSessionIds()
          All known session Ids.
 void closeAllSessionsInstance()
          Shutdown the application.
static NakedObjectsContext createInstance(NakedObjectSessionFactory sessionFactory)
           
static NakedObjectsContext createRelaxedInstance(NakedObjectSessionFactory sessionFactory)
          Intended for testing; the singleton can be replaced and sessions are autoclosed.
 void debug(DebugString debug)
           
 void debugAll(DebugString debug)
           
 java.lang.String debugTitle()
           
 void doClose()
          Overridable hook method called from NakedObjectsContext.closeSessionInstance(), allowing subclasses to clean up (for example datastructures).
 NakedObjectSession getSessionInstance()
          Locates the current NakedObjectSession.
protected  NakedObjectSession getSessionInstance(java.lang.String executionContextId)
          The NakedObjectSession for specified NakedObjectSession.getId().
 NakedObjectSession openSessionInstance(AuthenticationSession authenticationSession)
          Creates a new NakedObjectSession and binds into the current context.
 
Methods inherited from class org.nakedobjects.runtime.context.NakedObjectsContext
applySessionClosePolicy, closeAllSessions, closeSession, closeSessionInstance, debugData, debugSession, debugSystem, exists, getAuthenticationManager, getAuthenticationSession, getAuthorizationManager, getConfiguration, getCurrentTransaction, getDeploymentType, getInstance, getMessageBroker, getPersistenceSession, getServices, getSession, getSession, getSessionFactory, getSessionFactoryInstance, getSessionId, getSpecificationLoader, getTemplateImageLoader, getTransactionManager, getUpdateNotifier, getUserProfile, getUserProfileLoader, inSession, inTransaction, isContextReplaceable, isSessionAutocloseable, openSession, setConfiguration, testReset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NakedObjectsContextStatic

protected NakedObjectsContextStatic(NakedObjectsContext.ContextReplacePolicy replacePolicy,
                                    NakedObjectsContext.SessionClosePolicy sessionClosePolicy,
                                    NakedObjectSessionFactory sessionFactory)
Method Detail

createInstance

public static NakedObjectsContext createInstance(NakedObjectSessionFactory sessionFactory)

createRelaxedInstance

public static NakedObjectsContext createRelaxedInstance(NakedObjectSessionFactory sessionFactory)
Intended for testing; the singleton can be replaced and sessions are autoclosed.


getSessionInstance

public NakedObjectSession getSessionInstance()
Description copied from class: NakedObjectsContext
Locates the current NakedObjectSession.

This might just be a singleton (eg NakedObjectsContextStatic), or could be retrieved from the thread (eg NakedObjectsContextThreadLocal).

Specified by:
getSessionInstance in class NakedObjectsContext

openSessionInstance

public NakedObjectSession openSessionInstance(AuthenticationSession authenticationSession)
Description copied from class: NakedObjectsContext
Creates a new NakedObjectSession and binds into the current context.

Specified by:
openSessionInstance in class NakedObjectsContext

doClose

public void doClose()
Description copied from class: NakedObjectsContext
Overridable hook method called from NakedObjectsContext.closeSessionInstance(), allowing subclasses to clean up (for example datastructures).

The current NakedObjectSession will already have been closed.

Overrides:
doClose in class NakedObjectsContext

allSessionIds

public java.lang.String[] allSessionIds()
Description copied from class: NakedObjectsContext
All known session Ids.

Provided primarily for debugging.

Specified by:
allSessionIds in class NakedObjectsContext

closeAllSessionsInstance

public void closeAllSessionsInstance()
Description copied from class: NakedObjectsContext
Shutdown the application.

Specified by:
closeAllSessionsInstance in class NakedObjectsContext

debugTitle

public java.lang.String debugTitle()

debug

public void debug(DebugString debug)

debugAll

public void debugAll(DebugString debug)

getSessionInstance

protected NakedObjectSession getSessionInstance(java.lang.String executionContextId)
Description copied from class: NakedObjectsContext
The NakedObjectSession for specified NakedObjectSession.getId().

Specified by:
getSessionInstance in class NakedObjectsContext


Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.