NextApp Echo
App Container 1.0.5

nextapp.echoservlet
Class ServerContextImpl

java.lang.Object
  extended bynextapp.echoservlet.ServerContextImpl
All Implemented Interfaces:
java.io.Serializable, ServerContext

class ServerContextImpl
extends java.lang.Object
implements java.io.Serializable, ServerContext

The implementation of the ServerContext interface.

See Also:
ServerContext

Field Summary
private  java.lang.String defaultExitUri
           
private  InstancePeer instancePeer
           
 
Fields inherited from interface nextapp.echoservlet.ServerContext
ATTRIBUTE_NAME
 
Constructor Summary
ServerContextImpl(InstancePeer instancePeer)
          Creates a new instance for the given InstancePeer.
 
Method Summary
 void exit()
          Exits the application.
 void exit(java.lang.String uri)
          Exits the application.
 java.lang.String getAbnormalExitUri()
          Returns the abnormal exit URI.
 java.lang.String getCharacterEncoding()
          Returns the character encoding that will be used when communicating with the client.
 ClientProperties getClientProperties()
          Returns the client properties data that contains data about the client browser.
 CookieManager getCookieManager()
          Returns the CookieManager instance for the application.
 java.lang.String getDefaultExitUri()
          Returns the default exit URI.
 javax.servlet.ServletConfig getServletConfig()
          Returns the ServletConfig object provided to the EchoServer when it was initialized.
 javax.servlet.http.HttpSession getSession()
          Returns the HTTP session that in which the Echo application is held.
 java.security.Principal getUserPrincipal()
          Returns the principal (user) of the application.
 boolean isUserInRole(java.lang.String role)
          Returns true if the application's user is in the specified role.
 void setAbnormalExitUri(java.lang.String uri)
          Sets the abnormal exit URI.
 void setCharacterEncoding(java.lang.String characterEncoding)
          Sets the character encoding that will be used when communicating with the client.
 void setDefaultExitUri(java.lang.String uri)
          Sets the default exit URI The browser is redirected to the default exit URI automatically if the exit() or suspend() are called without a specific URI.
 void suspend()
          Suspends the application.
 void suspend(java.lang.String uri)
          Suspends the application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instancePeer

private InstancePeer instancePeer

defaultExitUri

private java.lang.String defaultExitUri
Constructor Detail

ServerContextImpl

public ServerContextImpl(InstancePeer instancePeer)
Creates a new instance for the given InstancePeer.

Parameters:
instancePeer - The InstancePeer that this ServerContext will serve.
Method Detail

exit

public void exit()
Description copied from interface: ServerContext
Exits the application. The application will be removed from the HTTP session, and if its URI is requested again, a new instance of the application will be provided. When an application exits, all browser windows used by the application will be closed except one. The remaining window will be redirected to the default exit URI.

Specified by:
exit in interface ServerContext
See Also:
ServerContext.exit()

exit

public void exit(java.lang.String uri)
Description copied from interface: ServerContext
Exits the application. The application will be removed from the HTTP session, and if its URI is requested again, a new instance of the application will be provided. When an application exits, all browser windows used by the application will be closed except one. The remaining window will be redirected to the specified URI.

Specified by:
exit in interface ServerContext
Parameters:
uri - The URI to redirect the browser to.
See Also:
ServerContext.exit(String)

getAbnormalExitUri

public java.lang.String getAbnormalExitUri()
Description copied from interface: ServerContext
Returns the abnormal exit URI. The browser is redirected to the abnormal exit URI automatically if the application encounters an unrecoverable error.

Specified by:
getAbnormalExitUri in interface ServerContext
Returns:
The abnormal exit URI.
See Also:
ServerContext.getAbnormalExitUri()

getClientProperties

public ClientProperties getClientProperties()
Description copied from interface: ServerContext
Returns the client properties data that contains data about the client browser.

Specified by:
getClientProperties in interface ServerContext
Returns:
The instance's client properties data.
See Also:
ServerContext.getClientProperties()

getCookieManager

public CookieManager getCookieManager()
Description copied from interface: ServerContext
Returns the CookieManager instance for the application.

Specified by:
getCookieManager in interface ServerContext
Returns:
The CookieManager instance for the application.
See Also:
ServerContext.getCookieManager()

getDefaultExitUri

public java.lang.String getDefaultExitUri()
Description copied from interface: ServerContext
Returns the default exit URI. The browser is redirected to the default exit URI automatically if the exit() or suspend() are called without a specific URI.

Specified by:
getDefaultExitUri in interface ServerContext
Returns:
The default exit URI.
See Also:
ServerContext.getDefaultExitUri()

getCharacterEncoding

public java.lang.String getCharacterEncoding()
Description copied from interface: ServerContext
Returns the character encoding that will be used when communicating with the client.

Specified by:
getCharacterEncoding in interface ServerContext
Returns:
The character encoding that will be used when communicating with the client.
See Also:
ServerContext.getCharacterEncoding()

getServletConfig

public javax.servlet.ServletConfig getServletConfig()
Description copied from interface: ServerContext
Returns the ServletConfig object provided to the EchoServer when it was initialized. The ServletConfig object provides access to servlet initialization parameters. Use ServletConfig.getServletContext() to obtain access to the ServletContext.

Specified by:
getServletConfig in interface ServerContext
Returns:
The ServletConfig object provided to the EchoServer when it was initialized.
See Also:
ServerContext.getServletConfig()

getSession

public javax.servlet.http.HttpSession getSession()
Description copied from interface: ServerContext
Returns the HTTP session that in which the Echo application is held.

Specified by:
getSession in interface ServerContext
Returns:
the HTTP session that in which the Echo application is held.
See Also:
ServerContext.getSession()

getUserPrincipal

public java.security.Principal getUserPrincipal()
Description copied from interface: ServerContext
Returns the principal (user) of the application.

Specified by:
getUserPrincipal in interface ServerContext
Returns:
The principal (user) of the application.
See Also:
ServerContext.getUserPrincipal()

isUserInRole

public boolean isUserInRole(java.lang.String role)
Description copied from interface: ServerContext
Returns true if the application's user is in the specified role.

Specified by:
isUserInRole in interface ServerContext
Returns:
True if the application's user is in the specified role.
See Also:
ServerContext.isUserInRole(String)

setAbnormalExitUri

public void setAbnormalExitUri(java.lang.String uri)
Description copied from interface: ServerContext
Sets the abnormal exit URI. The browser is redirected to the abnormal exit URI automatically if the application encounters an unrecoverable error.

Specified by:
setAbnormalExitUri in interface ServerContext
Parameters:
uri - The abnormal exit URI.
See Also:
ServerContext.setAbnormalExitUri(String)

setCharacterEncoding

public void setCharacterEncoding(java.lang.String characterEncoding)
Description copied from interface: ServerContext
Sets the character encoding that will be used when communicating with the client.

Specified by:
setCharacterEncoding in interface ServerContext
Parameters:
characterEncoding - The character encoding that will be used when communicating with the client.
See Also:
ServerContext.setCharacterEncoding(String)

setDefaultExitUri

public void setDefaultExitUri(java.lang.String uri)
Description copied from interface: ServerContext
Sets the default exit URI The browser is redirected to the default exit URI automatically if the exit() or suspend() are called without a specific URI.

Specified by:
setDefaultExitUri in interface ServerContext
Parameters:
uri - The default exit URI.
See Also:
ServerContext.setDefaultExitUri(String)

suspend

public void suspend()
Description copied from interface: ServerContext
Suspends the application. The application will still be held in the HTTP session, and if its URI is requested again, the application will reinitialize to its pre-suspended state. When an application is suspended, all browser windows used by the application will be closed except one. The remaining window will be redirected to the default exit URI.

Specified by:
suspend in interface ServerContext
See Also:
ServerContext.suspend()

suspend

public void suspend(java.lang.String uri)
Description copied from interface: ServerContext
Suspends the application. The application will still be held in the HTTP session, and if its URI is requested again, the application will reinitialize to its pre-suspended state. When an application is suspended, all browser windows used by the application will be closed except one. The remaining window will be redirected to the specified URI.

Specified by:
suspend in interface ServerContext
Parameters:
uri - The URI to redirect the browser to.
See Also:
ServerContext.suspend(String)

NextApp Echo
App Container 1.0.5