org.objectweb.jac.aspects.gui.web
Class Session

java.lang.Object
  extended byorg.objectweb.jac.aspects.gui.web.Session
All Implemented Interfaces:
Serializable

public class Session
extends Object
implements Serializable

This class defines a session for thin client servers.

See Also:
Request, Serialized Form

Field Summary
protected  Stack requests
          The requests stack for this session.
protected  String sid
          This session's ID.
 
Constructor Summary
Session(String sid)
          The constructor for a session with a given ID.
 
Method Summary
 Request endCurrentRequest()
          Ends the current request (same as getRequests().pop()).
 Request getCurrentRequest()
          Returns the current request of this session (same as getRequests().peek()).
 String getId()
          Returns the session's ID.
 Request getPreviousRequest()
          Returns the previous request of this session (ie the one that was achieved before the current one).
 int getRequestCount()
          Returns the number of active requests on the requests stack for this session.
 Stack getRequests()
          Returns the stack of the requests for this session.
 void newRequest(Request request)
          Creates a new request for this session (pushes it on the requests stack).
 String toString()
          Gets a humain-readable string representation of the session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

requests

protected transient Stack requests
The requests stack for this session.


sid

protected String sid
This session's ID.

Constructor Detail

Session

public Session(String sid)
The constructor for a session with a given ID.

Method Detail

getId

public String getId()
Returns the session's ID.

Returns:
the ID

getRequests

public Stack getRequests()
Returns the stack of the requests for this session.

getRequests().peek() is the request that is currently treated for this session.

Returns:
the requests stack

getRequestCount

public int getRequestCount()
Returns the number of active requests on the requests stack for this session.

Returns:
requests stack count

newRequest

public void newRequest(Request request)
Creates a new request for this session (pushes it on the requests stack). The newly created request becomes the current one of the session.

Parameters:
request - the request to push
See Also:
getCurrentRequest(), endCurrentRequest()

getCurrentRequest

public Request getCurrentRequest()
Returns the current request of this session (same as getRequests().peek()).

Returns:
the current request

getPreviousRequest

public Request getPreviousRequest()
Returns the previous request of this session (ie the one that was achieved before the current one).

Returns:
the previous request, null if no previous request is available

endCurrentRequest

public Request endCurrentRequest()
Ends the current request (same as getRequests().pop()).

Returns:
the request that has just been ended

toString

public String toString()
Gets a humain-readable string representation of the session.

Returns:
a string