to.etc.domui.state
Class WindowSession

java.lang.Object
  extended by to.etc.domui.state.WindowSession

public final class WindowSession
extends java.lang.Object

Manages conversations and the shelve stack. A WindowSession is in charge of all conversations within a given window, and maintains all state there.

Author:
Frits Jalvingh Created on Oct 24, 2008

Constructor Summary
WindowSession(AppSession session)
           
 
Method Summary
 void acceptNewConversation(ConversationContext cc)
           
 void clearGoto()
          Clear all goto stuff at request start time.
 ConversationContext createConversation(IRequestContext ctx, java.lang.Class<? extends ConversationContext> clz)
           
protected  void destroyConversation(ConversationContext cc)
           
 void dump()
          Dump all conversations and their resident pages.
 DomApplication getApplication()
           
 java.lang.Object getAttribute(java.lang.String name)
          EXPERIMENTAL DO NOT USE.
 long getLastUsed()
           
 java.util.List<ShelvedEntry> getShelvedPageStack()
           
 ConversationContext getTargetConversation()
           
 java.lang.Class<? extends ConversationContext> getTargetConversationClass()
           
 MoveMode getTargetMode()
           
 java.lang.Class<? extends UrlPage> getTargetPageClass()
           
 PageParameters getTargetPageParameters()
           
 java.lang.String getWindowID()
           
 boolean handleExceptionGoto(RequestContextImpl ctx, Page currentpg, boolean ajax)
          Goto handling in EXCEPTION handling mode: only Redirect is allowed here.
 boolean handleGoto(RequestContextImpl ctx, Page currentpg, boolean ajax)
          This checks whether a new page is to be made resident, instead of the current page.
 void internalAttachConversations()
          Call the "attach" method for all conversations, indicating that a new request is going to be handled.
 void internalDetachConversations()
          Detach all conversations, called just before the request is done.
 void internalSetLastPage(Page page)
           
 void internalSetNextPage(MoveMode m, java.lang.Class<? extends UrlPage> clz, ConversationContext cc, java.lang.Class<? extends ConversationContext> ccclz, PageParameters pp)
           
 void internalSetRedirect(java.lang.String targeturl)
           
 Page makeOrGetPage(IRequestContext rctx, java.lang.Class<? extends UrlPage> clz, PageParameters papa)
          Get a valid Page, either from the shelve stack or some other location.
 void setAttribute(java.lang.String name, java.lang.Object val)
          EXPERIMENTAL DO NOT USE.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WindowSession

public WindowSession(AppSession session)
Method Detail

getApplication

public final DomApplication getApplication()

getWindowID

public final java.lang.String getWindowID()

internalAttachConversations

public void internalAttachConversations()
                                 throws java.lang.Exception
Call the "attach" method for all conversations, indicating that a new request is going to be handled.

Throws:
java.lang.Exception

internalDetachConversations

public void internalDetachConversations()
Detach all conversations, called just before the request is done.


dump

public void dump()
Dump all conversations and their resident pages.


destroyConversation

protected void destroyConversation(ConversationContext cc)

createConversation

public ConversationContext createConversation(IRequestContext ctx,
                                              java.lang.Class<? extends ConversationContext> clz)
                                       throws java.lang.Exception
Throws:
java.lang.Exception

acceptNewConversation

public void acceptNewConversation(ConversationContext cc)
                           throws java.lang.Exception
Throws:
java.lang.Exception

getShelvedPageStack

public java.util.List<ShelvedEntry> getShelvedPageStack()

handleExceptionGoto

public boolean handleExceptionGoto(@Nonnull
                                   RequestContextImpl ctx,
                                   @Nonnull
                                   Page currentpg,
                                   boolean ajax)
                            throws java.lang.Exception
Goto handling in EXCEPTION handling mode: only Redirect is allowed here.

Parameters:
ctx -
currentpg -
ajax -
Returns:
Throws:
java.lang.Exception

handleGoto

public boolean handleGoto(@Nonnull
                          RequestContextImpl ctx,
                          @Nonnull
                          Page currentpg,
                          boolean ajax)
                   throws java.lang.Exception
This checks whether a new page is to be made resident, instead of the current page.

Parameters:
ctx -
currentpg - The page that is current (the one that issued the MOVE command).
Returns:
Throws:
java.lang.Exception

clearGoto

public void clearGoto()
Clear all goto stuff at request start time.


internalSetNextPage

public void internalSetNextPage(MoveMode m,
                                java.lang.Class<? extends UrlPage> clz,
                                ConversationContext cc,
                                java.lang.Class<? extends ConversationContext> ccclz,
                                PageParameters pp)

internalSetRedirect

public void internalSetRedirect(java.lang.String targeturl)

getTargetPageClass

public java.lang.Class<? extends UrlPage> getTargetPageClass()

getTargetPageParameters

public PageParameters getTargetPageParameters()

getTargetConversationClass

public java.lang.Class<? extends ConversationContext> getTargetConversationClass()

getTargetConversation

public ConversationContext getTargetConversation()

getTargetMode

public MoveMode getTargetMode()

makeOrGetPage

public Page makeOrGetPage(IRequestContext rctx,
                          java.lang.Class<? extends UrlPage> clz,
                          PageParameters papa)
                   throws java.lang.Exception
Get a valid Page, either from the shelve stack or some other location.

Parameters:
rctx -
clz -
papa -
Returns:
Throws:
java.lang.Exception

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getLastUsed

public long getLastUsed()

internalSetLastPage

public void internalSetLastPage(Page page)

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object val)
EXPERIMENTAL DO NOT USE.

Parameters:
name -
val -

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
EXPERIMENTAL DO NOT USE.

Parameters:
name -
Returns: