KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > ha > httpsession > beanimpl > interfaces > ClusteredHTTPSessionBusiness


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7
8 package org.jboss.ha.httpsession.beanimpl.interfaces;
9
10 import java.rmi.RemoteException JavaDoc;
11
12 import org.jboss.ha.httpsession.interfaces.SerializableHttpSession;
13
14 /**
15  * Business methods for the entity bean that will store HTTPSession
16  * in a clustered environment.
17  *
18  * @see org.jboss.ha.httpsession.beanimpl.interfaces.ClusteredHTTPSession
19  *
20  * @author <a HREF="mailto:sacha.labourey@cogito-info.ch">Sacha Labourey</a>.
21  * @version $Revision: 1.2 $
22  *
23  * <p><b>Revisions:</b>
24  *
25  * <p><b>31. décembre 2001 Sacha Labourey:</b>
26  * <ul>
27  * <li> First implementation </li>
28  * </ul>
29  */

30
31 public interface ClusteredHTTPSessionBusiness
32 {
33
34    /**
35     * Get the session identifier associated to this HTTPSession.
36     * This is the primary key of the entity bean.
37     * @return The session id.
38     */

39     public String JavaDoc getSessionId () throws RemoteException JavaDoc; // PK
40

41    /**
42     * Return the HttpSession object associated to its id. The main difference with the
43     * standard class is that this one is Serializable.
44     */

45    public SerializableHttpSession getSession () throws RemoteException JavaDoc;
46    /**
47     * Associate a new session (set of attributes, ...) to this id.
48     */

49    public void setSession (SerializableHttpSession session) throws RemoteException JavaDoc;
50    
51    // used to clean timeouted sessions without accessing the HttpSession object
52
//
53
/**
54     * Return the last time this session has been accessed in miliseconds since 1970.
55     * This method is a shortcut for getSession().getLastAccessedTime (). The reason
56     * is that the bean, when directly asked for the time, don't need to deserialize
57     * the session representation if not already done (lazy deserialization).
58     * If the only thing that changes in an HTTPSession it the last accessed time (and no attributes),
59     * the session may not be replicated on other node (to reduce traffic). Nevertheless,
60     * the new session is stored in the local bean. Consequently, if a load-balancer
61     * with sticky sessions is used, this is no problem (the local, updated, bean is used.
62     */

63    public long getLastAccessedTime() throws RemoteException JavaDoc;
64    /**
65     * Return the time when this session has been created in miliseconds since 1970.
66     * This method is a shortcut for getSession().getLastAccessedTime (). The reason
67     * is that the bean, when directly asked for the time, don't need to deserialize
68     * the session representation if not already done (lazy deserialization)
69     */

70    public long getCreationTime() throws RemoteException JavaDoc;
71
72 }
73
Popular Tags