javax.rad.server
Class ServerContext

java.lang.Object
  extended by javax.rad.server.ServerContext
Direct Known Subclasses:
ServerContextImpl

public abstract class ServerContext
extends Object

A ServerContext contains all of the per-request state information related to the processing of a single server call. It is passed to, and potentially modified by, each phase of the request processing lifecycle.

A ServerContext instance remains active until its release() method is called.

While a ServerContext instance is active, it must not be referenced from any thread other than the one upon which the server executing this application utilizes for the processing of this call.

See Also:
ServerContext

Constructor Summary
ServerContext()
           
 
Method Summary
protected abstract  void destroy()
          Destroyes any resources associated with this ServerContext instance.
static ServerContext getCurrentInstance()
          Gets the current instance of ServerContext.
static ISession getCurrentSession()
          Gets the current session.
abstract  ISession getSession()
          Gets the session instance if available.
abstract  String getSystemIdentifier()
          Gets the system identifier.
 boolean isReleased()
          Gets the release state of this ServerContext.
 void release()
          Release any resources associated with this ServerContext instance.
protected  void setInstance(ServerContext pContext)
          Sets the current context instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerContext

public ServerContext()
Method Detail

destroy

protected abstract void destroy()
Destroyes any resources associated with this ServerContext instance.


getSession

public abstract ISession getSession()
Gets the session instance if available.

Returns:
the session or null if session is not available

getSystemIdentifier

public abstract String getSystemIdentifier()
Gets the system identifier. The identifier is unique for each server and deployment mode, e.g. web application deployed as war, desktop application, ...

Returns:
the identifier

getCurrentInstance

public static ServerContext getCurrentInstance()
Gets the current instance of ServerContext.

Returns:
the current instance

getCurrentSession

public static ISession getCurrentSession()
Gets the current session.

Returns:
the current session

setInstance

protected void setInstance(ServerContext pContext)
Sets the current context instance.

Parameters:
pContext - the context instance

release

public final void release()
Release any resources associated with this ServerContext instance.

See Also:
isReleased()

isReleased

public boolean isReleased()
Gets the release state of this ServerContext.

Returns:
true if there is no current instance of ServerContext (means that the ServerContext is released); otherwise false


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.