KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > ejb > spi > sfsb > store > SFSBStoreManager


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 package com.sun.ejb.spi.sfsb.store;
25
26 import java.util.Map JavaDoc;
27
28 import com.sun.ejb.spi.stats.MonitorableSFSBStoreManager;
29
30 /**
31  * Interface that will be used by the SFSB container to interact
32  * with a session store.
33  *
34  * Note that there is a one-one association between Container and Store
35  *
36  * @author Mahesh Kannan
37  */

38 public interface SFSBStoreManager {
39     
40     /**
41      * Store session data in this beanState
42      * This method used only for checkpointing; use passivateSave for passivating
43      */

44     public void checkpointSave(SFSBBeanState beanState)
45         throws SFSBStoreManagerException;
46       
47     /**
48      * A Factory method to create a SFSBBeanState. The StoreManager
49      * is responsible for filling the SFSBBeanState with the
50      * correct ClusterId, containerId and SFSBStoreManager
51      */

52     public SFSBBeanState createSFSBBeanState(Object JavaDoc sessionId,
53         long lastAccess, boolean isNew, byte[] state);
54
55     /**
56      *Get the SFSBStoreManagerMonitor
57      */

58     public MonitorableSFSBStoreManager getMonitorableSFSBStoreManager();
59
60     /**
61      * Return the SFSBBeanState containing
62      * the stored session data identified by this sessionKey
63      * @return the SFSBBeanState containing stored session data
64      * or null if the sessionKey is invalid / removed
65      */

66     public SFSBBeanState getState(Object JavaDoc sessionKey)
67         throws SFSBStoreManagerException;
68      
69     /**
70      * Called from the Container during container creation
71      */

72     public void initSessionStore(Map JavaDoc storeEnv)
73         throws SFSBStoreManagerException;
74     
75     /**
76      * Store session data in this beanState
77      * This method used only for passivation; use checkpointSave for checkpointing
78      */

79     public void passivateSave(SFSBBeanState beanState)
80         throws SFSBStoreManagerException;
81     
82     /**
83      * Remove the session data identified by this sessionKey
84      */

85     public void remove(Object JavaDoc sessionKey)
86         throws SFSBStoreManagerException;
87     
88     /**
89      * Remove all session data for this container
90      * called during undeployment
91      */

92     public void removeAll()
93         throws SFSBStoreManagerException;
94       
95     /**
96      * Remove all the idle/expired session data
97      * that are idle for idleTimeoutInSeconds (passed during initSessionStore())
98      */

99     public int removeExpiredSessions()
100         throws SFSBStoreManagerException;
101       
102     /**
103      * Called during shutdown of instance
104      */

105     public void shutdown()
106         throws SFSBStoreManagerException;
107
108     /**
109      * update only the lastAccessTime to the value time
110      * Used when the session has been accessed as well
111      * as periodically to keep session alive
112      */

113     public void updateLastAccessTime(Object JavaDoc sessionKey, long time)
114         throws SFSBStoreManagerException;
115     
116 }
117
Popular Tags