NextApp Echo2
v2.1.1

nextapp.echo2.webcontainer
Class ContainerInstance

java.lang.Object
  extended by nextapp.echo2.webrender.UserInstance
      extended by nextapp.echo2.webcontainer.ContainerInstance
All Implemented Interfaces:
java.io.Serializable, java.util.EventListener, javax.servlet.http.HttpSessionActivationListener, javax.servlet.http.HttpSessionBindingListener

public class ContainerInstance
extends nextapp.echo2.webrender.UserInstance

Web application container user instance.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class nextapp.echo2.webrender.UserInstance
PROPERTY_CLIENT_CONFIGURATION, PROPERTY_SERVER_DELAY_MESSAGE
 
Method Summary
 nextapp.echo2.app.ApplicationInstance getApplicationInstance()
          Returns the corresponding ApplicationInstance for this user instance.
 int getCallbackInterval()
          Determines the application-specified asynchronous monitoring service callback interval.
 nextapp.echo2.app.Component getComponentByElementId(java.lang.String elementId)
          Retrieves the Component with the specified element id.
static java.lang.String getElementId(nextapp.echo2.app.Component component)
          Returns the base HTML element id that should be used when rendering the specified Component.
 IdTable getIdTable()
          Retrieves the IdTable used by this ContainerInstance to assign weakly-referenced unique identifiers to arbitrary objects.
 java.util.Map getInitialRequestParameterMap()
          Returns an immutable Map containing the HTTP form parameters sent on the initial request to the application.
 RenderState getRenderState(nextapp.echo2.app.Component component)
          Retrieves the RenderState of the specified Component.
 nextapp.echo2.app.update.UpdateManager getUpdateManager()
          Convenience method to retrieve the application's UpdateManager, which is used to synchronize client and server states.
 void init(nextapp.echo2.webrender.Connection conn)
          Initializes the ContainerInstance, creating an instance of the target ApplicationInstance and initializing the state of the application.
static void newInstance(nextapp.echo2.webrender.Connection conn)
          Creates a new Web Application Container instance using the provided client Connection.
 void removeRenderState(nextapp.echo2.app.Component component)
          Removes the RenderState of the specified Component.
 void sessionDidActivate(javax.servlet.http.HttpSessionEvent e)
           
 void sessionWillPassivate(javax.servlet.http.HttpSessionEvent e)
           
 void setRenderState(nextapp.echo2.app.Component component, RenderState renderState)
          Sets the RenderState of the specified Component.
 void setTaskQueueCallbackInterval(nextapp.echo2.app.TaskQueueHandle taskQueue, int ms)
          Sets the interval between asynchronous callbacks from the client to check for queued tasks for a given TaskQueue.
 void valueUnbound(javax.servlet.http.HttpSessionBindingEvent e)
          Listener implementation of HttpSessionBindingListener.
 
Methods inherited from class nextapp.echo2.webrender.UserInstance
getCharacterEncoding, getClientConfiguration, getClientProperties, getCurrentTransactionId, getNextTransactionId, getServerDelayMessage, getServiceUri, getServiceUri, getServletUri, getSession, getUserInstanceUpdateManager, setClientConfiguration, setServerDelayMessage, valueBound
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getElementId

public static java.lang.String getElementId(nextapp.echo2.app.Component component)
Returns the base HTML element id that should be used when rendering the specified Component.

Parameters:
component - the component
Returns:
the base HTML element id

newInstance

public static void newInstance(nextapp.echo2.webrender.Connection conn)
Creates a new Web Application Container instance using the provided client Connection. The instance will automatically be stored in the relevant HttpSession

Parameters:
conn - the client/server Connection for which the instance is being instantiated

getApplicationInstance

public nextapp.echo2.app.ApplicationInstance getApplicationInstance()
Returns the corresponding ApplicationInstance for this user instance.

Returns:
the relevant ApplicationInstance

getCallbackInterval

public int getCallbackInterval()
Determines the application-specified asynchronous monitoring service callback interval.

Returns:
the callback interval, in ms

getComponentByElementId

public nextapp.echo2.app.Component getComponentByElementId(java.lang.String elementId)
Retrieves the Component with the specified element id.

Parameters:
elementId - the element id, e.g., "c_42323"
Returns:
the component (e.g., the component whose id is "42323")

getIdTable

public IdTable getIdTable()
Retrieves the IdTable used by this ContainerInstance to assign weakly-referenced unique identifiers to arbitrary objects.

Returns:
the IdTable

getInitialRequestParameterMap

public java.util.Map getInitialRequestParameterMap()
Returns an immutable Map containing the HTTP form parameters sent on the initial request to the application.

Returns:
the initial request parameter map

getRenderState

public RenderState getRenderState(nextapp.echo2.app.Component component)
Retrieves the RenderState of the specified Component.

Parameters:
component - the component
Returns:
the rendering state

getUpdateManager

public nextapp.echo2.app.update.UpdateManager getUpdateManager()
Convenience method to retrieve the application's UpdateManager, which is used to synchronize client and server states. This method is equivalent to invoking getApplicationInstance().getUpdateManager().

Returns:
the UpdateManager

init

public void init(nextapp.echo2.webrender.Connection conn)
Initializes the ContainerInstance, creating an instance of the target ApplicationInstance and initializing the state of the application.

Parameters:
conn - the relevant Connection

removeRenderState

public void removeRenderState(nextapp.echo2.app.Component component)
Removes the RenderState of the specified Component.

Parameters:
component - the component

setRenderState

public void setRenderState(nextapp.echo2.app.Component component,
                           RenderState renderState)
Sets the RenderState of the specified Component.

Parameters:
component - the component
renderState - the render state

setTaskQueueCallbackInterval

public void setTaskQueueCallbackInterval(nextapp.echo2.app.TaskQueueHandle taskQueue,
                                         int ms)
Sets the interval between asynchronous callbacks from the client to check for queued tasks for a given TaskQueue. If multiple TaskQueues are active, the smallest specified interval should be used. The default interval is 500ms. Application access to this method should be accessed via the ContainerContext.

Parameters:
taskQueue - the TaskQueue
ms - the number of milliseconds between asynchronous client callbacks
See Also:
ContainerContext.setTaskQueueCallbackInterval(nextapp.echo2.app.TaskQueueHandle, int)

sessionDidActivate

public void sessionDidActivate(javax.servlet.http.HttpSessionEvent e)
Specified by:
sessionDidActivate in interface javax.servlet.http.HttpSessionActivationListener
Overrides:
sessionDidActivate in class nextapp.echo2.webrender.UserInstance
See Also:
HttpSessionActivationListener.sessionDidActivate(javax.servlet.http.HttpSessionEvent)

sessionWillPassivate

public void sessionWillPassivate(javax.servlet.http.HttpSessionEvent e)
Specified by:
sessionWillPassivate in interface javax.servlet.http.HttpSessionActivationListener
Overrides:
sessionWillPassivate in class nextapp.echo2.webrender.UserInstance
See Also:
HttpSessionActivationListener.sessionWillPassivate(javax.servlet.http.HttpSessionEvent)

valueUnbound

public void valueUnbound(javax.servlet.http.HttpSessionBindingEvent e)
Description copied from class: nextapp.echo2.webrender.UserInstance
Listener implementation of HttpSessionBindingListener. Removes reference to session when invoked.

Specified by:
valueUnbound in interface javax.servlet.http.HttpSessionBindingListener
Overrides:
valueUnbound in class nextapp.echo2.webrender.UserInstance
See Also:
HttpSessionBindingListener.valueUnbound(javax.servlet.http.HttpSessionBindingEvent)

NextApp Echo2
v2.1.1