KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > web > tomcat > tc5 > session > InstantSnapshotManager


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

7 package org.jboss.web.tomcat.tc5.session;
8
9 import org.apache.catalina.Context;
10 import org.apache.catalina.Session;
11 import org.jboss.logging.Logger;
12
13 /**
14  * A concrete implementation of the snapshot manager interface
15  * that does instant replication of a modified session
16  *
17  * @author Thomas Peuss <jboss@peuss.de>
18  * @version $Revision: 1.4.2.2 $
19  */

20 public class InstantSnapshotManager extends SnapshotManager
21 {
22    static Logger log = Logger.getLogger(InstantSnapshotManager.class);
23
24    public InstantSnapshotManager(AbstractJBossManager manager, String JavaDoc path)
25    {
26       super(manager, path);
27    }
28
29    /**
30     * Instant replication of the modified session
31     */

32    public void snapshot(String JavaDoc id)
33    {
34       try
35       {
36          // find the session that has been modified
37
Session session = (Session) manager.findSession(id);
38          manager.storeSession(session);
39       }
40       catch (Exception JavaDoc e)
41       {
42          log.warn("Failed to replicate sessionID:" + id, e);
43       }
44    }
45
46    public void start()
47    {
48    }
49
50    public void stop()
51    {
52    }
53 }
54
Popular Tags