|
NextApp Echo App Container 1.0.5 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nextapp.echoservlet.InstancePeer
A peer object for an user instance of an Echo application. Like EchoInstance, one instance of this class is created for each user.
Field Summary | |
private java.lang.String |
applicationUri
The URI required to make HTTP requests to this application. |
private java.lang.String |
cacheIdPrefix
Generated three-digit hexadecimal prefix for all cache Ids. |
private java.lang.String |
characterEncoding
The character encoding that will be used for all text-based renderings in the application. |
private java.util.Set |
clientActionProducers
A container of all visible action-producing component peers. |
private CacheableServiceWrapper |
clientErrorService
A per-user cacheable wrapper for the client error service. |
private java.util.Set |
clientInputProducers
A container of all visible input-producing component peers. |
private ClientProperties |
clientProperties
Information about the client browser. |
private java.util.Map |
componentMap
A mapping between components and component peers. |
private java.util.Set |
connections
A set of active Connection objects using this
InstancePeer . |
private java.util.Set |
contentPanes
A container of all visible content panes. |
private Controller |
controller
A service that is used to coordinate re-rendering of content and other updates of the client's browser. |
private CookieManager |
cookieManager
The CookieManager object responsible for handling cookies for this application instance. |
private Id |
defaultWindowId
The Id of the window that will be rendered if no Id is provided. |
private nextapp.echo.EchoInstance |
echoInstance
The application instance. |
private java.lang.String |
errorUri
The URI to redirect the browser to in the event of an unrecoverable error. |
private boolean |
exiting
True when the application is exiting. |
private java.util.Map |
idMap
A mapping between ids and component peers. |
private ImageRepository |
imageRepository
A repository of the ImagePeer s used by this
InstancePeer . |
private IncomingUpdateQueue |
incomingUpdateQueue
Changes incoming from the client. |
private boolean |
initialized
A flag indicating whether initialization has taken place (whether the init() method has been invoked). |
private long |
nextComponentId
The next id value assigned to a component. |
private OutgoingUpdateQueue |
outgoingUpdateQueue
Content that needs to be re-rendered. |
private int |
sequenceNumber
The request sequence number. |
private ServerContext |
serverContext
The server context that will be provided to this application's EchoInstance . |
private ServiceRegistry |
services
A container of all services available to this application instance. |
private javax.servlet.http.HttpSession |
session
A reference to the HTTP Session object in which this instance peer is being held. |
private java.lang.String |
terminationUri
Null if the application does not desire to exit or a URI to direct the browser to if the application does desire to exit. |
private java.security.Principal |
userPrincipal
The principal using the application. |
private VariableData |
variableData
A container of all variables used for templated services in this application instance. |
private java.util.Set |
windows
A container of all visible windows. |
Constructor Summary | |
(package private) |
InstancePeer(nextapp.echo.EchoInstance echoInstance,
java.lang.String applicationUri)
Creates a new instance peer for the provided instance. |
Method Summary | |
private void |
add(nextapp.echo.Component c,
boolean visibilityChange)
Registers the given component, and all visible components with visible parents beneath it. |
(package private) void |
addConnection(Connection conn)
Adds an active connection to the internal list of connections. |
private void |
childrenChange(java.beans.PropertyChangeEvent e)
Processes a property change event where a registered component has had children added or removed. |
(package private) void |
clearTerminationUri()
Clears the termination URI. |
(package private) void |
exit(java.lang.String uri)
Exits the application, redirecting an available browser window to the specified URI. |
Id |
generateId()
Generates a unique (to the application) identifier. |
(package private) java.lang.String |
getApplicationUri()
Returns the URI from which this application is available. |
(package private) java.lang.String |
getCacheIdPrefix()
Returns a prefix to prepend to cache ids in order to ensure that incorrect cached resources are used by client in the event either the server or the users session has restarted. |
(package private) java.lang.String |
getCharacterEncoding()
Returns the character encoding that will be used when communicating with the client browser. |
(package private) Service |
getClientErrorService()
Returns the client error service for this user. |
(package private) java.util.Iterator |
getClientInputProducers()
Returns an iterator over all registered ClientInputProducers s. |
ClientProperties |
getClientProperties()
Returns the "client properties" data collected about the client of this InstancePeer . |
PaneUI |
getContainingPane(ComponentPeer componentPeer)
Returns the PaneUI in which the given
ComponentPeer is contained. |
WindowUI |
getContainingWindow(ComponentPeer componentPeer)
Returns the WindowUI in which the given
ComponentPeer is contained. |
(package private) java.util.Iterator |
getContentPanes()
Returns an iterator over all registered content panes. |
Service |
getController()
Returns this instance's Controller |
CookieManager |
getCookieManager()
Returns the CookieManager used by this instance. |
(package private) Id |
getDefaultWindowId()
Returns the Id of the application's default window. |
(package private) java.lang.String |
getErrorUri()
Returns the URI the client is directed to in the event of an unrecoverable error. |
ImageRepository |
getImageRepository()
Returns the image repository. |
(package private) IncomingUpdateQueue |
getIncomingUpdateQueue()
Returns the application's incoming update queue. |
nextapp.echo.EchoInstance |
getInstance()
Returns the EchoInstance object this peer supports. |
(package private) OutgoingUpdateQueue |
getOutgoingUpdateQueue()
Returns the application's outgoing update queue. |
ComponentPeer |
getPeer(nextapp.echo.Component c)
Returns the ComponentPeer that corresponds to the given Component. |
ComponentPeer |
getPeer(Id id)
Returns the ComponentPeer that corresponds to the given Id. |
Service |
getSafeInvokeService()
Returns the service that renders the script containing the safeInvoke() method. |
(package private) int |
getSequenceNumber()
Returns the sequence number of the last successfully processed request from the client controller frame. |
(package private) ServiceRegistry |
getServiceRegistry()
Returns the ServiceRegistry that is used by this instance
to hold all Service objects available to it. |
(package private) javax.servlet.ServletConfig |
getServletConfig()
Returns the ServletConfig object containing that the
servlet container sent to the EchoServer's init() method (EchoServer
extends HttpServlet). |
(package private) javax.servlet.http.HttpSession |
getSession()
Returns the HttpSession object to which this instance peer is bound, or null if is not bound to a session. |
(package private) java.lang.String |
getTerminationUri()
Returns null if the application does not desire to exit or a URI to direct the browser to if the application does desire to exit. |
java.security.Principal |
getUserPrincipal()
Returns the principal (user) of this application. |
(package private) VariableData |
getVariableData()
Returns the VariableData object used by this instance
peer when rendering templated services. |
(package private) java.util.Iterator |
getWindows()
Returns an iterator of all registered windows. |
private boolean |
hasPeer(nextapp.echo.Component c)
Determines whether the specified component has a peer. |
(package private) void |
incrementSequenceNumber()
Increments the value of the controller frame sequence number by one. |
(package private) void |
init()
Initializes this InstancePeer , causing the represented
EchoInstance to also initialize. |
(package private) boolean |
isExiting()
Returns true if the application is exiting and should have therefore have its session invalidated. |
(package private) boolean |
isUserInRole(java.lang.String role)
Returns true if the user of the application is in the specified role. |
(package private) void |
lowerWindow(WindowUI windowUI)
Lowers the specified window to the background. |
void |
propertyChange(java.beans.PropertyChangeEvent e)
Handler for PropertyChangeEvents. |
(package private) void |
raiseWindow(WindowUI windowUI)
Raises the specified window to the foreground. |
void |
redraw(ComponentPeer componentPeer)
Causes the service containing the given component to be re-rendered. |
private void |
register(nextapp.echo.Component c)
Registers a component. |
private void |
remove(nextapp.echo.Component c,
boolean visibilityChange)
Recursively removes a component and its descendants from the InstancePeer by unregistering their peer objects and removing the InstancePeer from their lists of property change listeners. |
(package private) void |
removeConnection(Connection conn)
Removes an active connection from the internal list of connections. |
(package private) void |
restart()
Restarts application by suspending to applciation's own URI. |
(package private) void |
setCharacterEncoding(java.lang.String newValue)
Returns the character encoding that will be used when communicating with the client browser. |
(package private) void |
setClientProperties(ClientProperties clientProperties)
Sets the client properties for the user. |
(package private) void |
setErrorUri(java.lang.String errorUri)
Sets the URI the client is directed to in the event of an unrecoverable error. |
void |
setTitle(WindowUI windowUI)
Causes the specified window's title to be updated on the client. |
(package private) void |
setUserPrincipal(java.security.Principal userPrincipal)
Sets the principal (user) that is using the application. |
(package private) void |
suspend(java.lang.String uri)
Suspends the application, redirecting an available browser window to the specified URI. |
private void |
unregister(nextapp.echo.Component c)
Unregisters a component. |
private void |
updateLocalizedResources()
Updates localized resources. |
void |
valueBound(javax.servlet.http.HttpSessionBindingEvent e)
Listener implementation of HttpSessionBindingListener . |
void |
valueUnbound(javax.servlet.http.HttpSessionBindingEvent e)
Listener implementation of Mcode>HttpSessionBindingListener. |
private void |
visibilityChange(java.beans.PropertyChangeEvent e)
Handles the case where a registered component or immediate invisible descendent of a registered component has changed visibility. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private transient javax.servlet.http.HttpSession session
private final java.lang.String cacheIdPrefix
private final java.util.Map componentMap
private final java.util.Map idMap
private final java.util.Set windows
private final java.util.Set clientActionProducers
private final java.util.Set clientInputProducers
private final java.util.Set contentPanes
private final VariableData variableData
private final CacheableServiceWrapper clientErrorService
private final ServiceRegistry services
private final IncomingUpdateQueue incomingUpdateQueue
private final OutgoingUpdateQueue outgoingUpdateQueue
private final Controller controller
private final nextapp.echo.EchoInstance echoInstance
private final java.lang.String applicationUri
private ClientProperties clientProperties
private Id defaultWindowId
private java.lang.String errorUri
private boolean initialized
private java.lang.String characterEncoding
private boolean exiting
private java.lang.String terminationUri
private CookieManager cookieManager
private ServerContext serverContext
EchoInstance
.
private java.security.Principal userPrincipal
private long nextComponentId
private int sequenceNumber
private transient java.util.Set connections
Connection
objects using this
InstancePeer
. An active Connection
may be
needed for use by the InstancePeer
by certain operations,
such as isUserInRole()
which requires the use of a
Connection
's HttpServletRequest
.
private ImageRepository imageRepository
ImagePeer
s used by this
InstancePeer
.
Constructor Detail |
InstancePeer(nextapp.echo.EchoInstance echoInstance, java.lang.String applicationUri)
echoInstance
- The EchoInstance
object for which
this peer is being created.applicationUri
- The URI of the application.Method Detail |
private void add(nextapp.echo.Component c, boolean visibilityChange)
c
- The component to be added to the hierarchy.visibilityChange
- A flag indicating whether the component is being
added because it changed visibility or not. If this flag is
set, a property change listener won't be added to the component,
because it already has one.void addConnection(Connection conn)
conn
- The Connection to be added.
private void childrenChange(java.beans.PropertyChangeEvent e)
e
- A property change event indicating that children have been
added to or removed from a registered component.void clearTerminationUri()
void exit(java.lang.String uri)
uri
- The URI to redirect the browser window to.public Id generateId()
java.lang.String getApplicationUri()
java.lang.String getCharacterEncoding()
java.lang.String getCacheIdPrefix()
Service getClientErrorService()
java.util.Iterator getClientInputProducers()
ClientInputProducers
s.
ClientInputProducers
s.public ClientProperties getClientProperties()
InstancePeer
. This data contains
information such as the browser name, version, and the clients
screen resolution.
InstancePeer
.public PaneUI getContainingPane(ComponentPeer componentPeer)
PaneUI
in which the given
ComponentPeer
is contained.
componentPeer
- The ComponentPeer
whose containing
PaneUI
is to be returned.
PaneUI
containing the given
ComponentPeer
.public WindowUI getContainingWindow(ComponentPeer componentPeer)
WindowUI
in which the given
ComponentPeer
is contained.
componentPeer
- The ComponentPeer
whose containing
WindowUI
is to be returned.
WindowUI
containing the given
ComponentPeer
.java.util.Iterator getContentPanes()
public Service getController()
Controller service.
- Returns:
- This instance's
Controller service.
public CookieManager getCookieManager()
CookieManager
used by this instance.
CookieManager
used by this instance.Id getDefaultWindowId()
java.lang.String getErrorUri()
public ImageRepository getImageRepository()
IncomingUpdateQueue getIncomingUpdateQueue()
public nextapp.echo.EchoInstance getInstance()
OutgoingUpdateQueue getOutgoingUpdateQueue()
public ComponentPeer getPeer(nextapp.echo.Component c)
c
- The component whose peer is to be retrieved.
public ComponentPeer getPeer(Id id)
id
- The id of the peer to be retrieved.
public Service getSafeInvokeService()
int getSequenceNumber()
javax.servlet.http.HttpSession getSession()
ServiceRegistry getServiceRegistry()
ServiceRegistry
that is used by this instance
to hold all Service
objects available to it.
ServiceRegistry
.javax.servlet.ServletConfig getServletConfig()
ServletConfig
object containing that the
servlet container sent to the EchoServer's init() method (EchoServer
extends HttpServlet).
return The ServletConfig
object for this Echo servlet.
java.lang.String getTerminationUri()
public java.security.Principal getUserPrincipal()
HttpServletRequest.getUserPrincipal()
.
VariableData getVariableData()
VariableData
object used by this instance
peer when rendering templated services.
VariableData
object used by this instance peer.java.util.Iterator getWindows()
private boolean hasPeer(nextapp.echo.Component c)
c
- The component to analyze.
void incrementSequenceNumber()
getSequenceNumber()
void init()
InstancePeer
, causing the represented
EchoInstance
to also initialize. The default window
is obtained from the EchoInstance.init()
method and
added to the application.
boolean isExiting()
boolean isUserInRole(java.lang.String role)
HttpServletRequest.isUserInRole()
.
role
- The role for which to test membership.
void lowerWindow(WindowUI windowUI)
windowUI
- The window to lower.public void propertyChange(java.beans.PropertyChangeEvent e)
EchoInstance
and its
components such that it can update the client browser to reflect
the application's state.
propertyChange
in interface java.beans.PropertyChangeListener
e
- A property change event describing a property change to
the application represented by this peer or one of its
components.void raiseWindow(WindowUI windowUI)
windowUI
- The window to raise.public void redraw(ComponentPeer componentPeer)
componentPeer
- A ComponentPeer
whose represented
Component
has changed and therefore needs to be
updated on the client browser.private void register(nextapp.echo.Component c)
ClientActionProducer
, then it is added to this
instance's inventory of action producing components.ClientInputProducer
, then it is added to this
instance's inventory of input producing components.registered()
method invoked.
c
- The component to be registered.private void remove(nextapp.echo.Component c, boolean visibilityChange)
c
- The component to be removed from the hierarchy.visibilityChange
- A flag indicating whether the component is being
removed because it changed visibility or not. If this flag is
set, a property change listener will be kept on the component such
that it can be re-added if it becomes visible again.void removeConnection(Connection conn)
conn
- The Connection to be removed.
void restart()
void setCharacterEncoding(java.lang.String newValue)
newValue
- The character encoding that will be used when
communicating with the client browser.void setClientProperties(ClientProperties clientProperties)
clientProperties
- The client properties data to associate with this instance.void setErrorUri(java.lang.String errorUri)
errorUri
- The new error URI.public void setTitle(WindowUI windowUI)
windowUI
- The peer of the window whose title should be redrawn.void setUserPrincipal(java.security.Principal userPrincipal)
userPrincipal
- The principal (user) that is using the application.void suspend(java.lang.String uri)
uri
- The URI to redirect the browser.private void unregister(nextapp.echo.Component c)
c
- The component to be unregistered.private void updateLocalizedResources()
public void valueBound(javax.servlet.http.HttpSessionBindingEvent e)
HttpSessionBindingListener
.
Stores reference to session when invoked.
valueBound
in interface javax.servlet.http.HttpSessionBindingListener
HttpSessionBindingListener.valueBound(HttpSessionBindingEvent)
public void valueUnbound(javax.servlet.http.HttpSessionBindingEvent e)
valueUnbound
in interface javax.servlet.http.HttpSessionBindingListener
HttpSessionBindingListener.valueUnbound(HttpSessionBindingEvent)
private void visibilityChange(java.beans.PropertyChangeEvent e)
|
NextApp Echo App Container 1.0.5 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |