User: fleury
Date: 00/05/31 12:09:15
Modified: src/main/org/jboss/ejb/plugins
StatefulSessionFilePersistenceManager.java
Log:
The old plugin was dependent on a non existent configuration file we now work from
the bin directory and create the storage directories accordingly
Revision Changes Path
1.3 +25 -15
jboss/src/main/org/jboss/ejb/plugins/StatefulSessionFilePersistenceManager.java
Index: StatefulSessionFilePersistenceManager.java
===================================================================
RCS file:
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/StatefulSessionFilePersistenceManager.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- StatefulSessionFilePersistenceManager.java 2000/05/19 07:11:53 1.2
+++ StatefulSessionFilePersistenceManager.java 2000/05/31 19:09:15 1.3
@@ -50,11 +50,15 @@
import org.jboss.ejb.StatefulSessionEnterpriseContext;
/**
- * <description>
+ * StatefulSessionFilePersistenceManager
+ *
+ * This class is one of the passivating plugins for jBoss.
+ * It is fairly simple and can work from the file system from wich jBoss is
operating
*
* @see <related>
* @author Rickard �berg ([EMAIL PROTECTED])
- * @version $Revision: 1.2 $
+ * @author <a href="[EMAIL PROTECTED]">Marc Fleury</a>
+ * @version $Revision: 1.3 $
*/
public class StatefulSessionFilePersistenceManager
implements StatefulSessionPersistenceManager
@@ -81,21 +85,27 @@
con = (StatefulSessionContainer)c;
}
- public void init()
- throws Exception
- {
- // Find methods
- ejbActivate = SessionBean.class.getMethod("ejbActivate", new Class[0]);
- ejbPassivate = SessionBean.class.getMethod("ejbPassivate", new Class[0]);
- ejbRemove = SessionBean.class.getMethod("ejbRemove", new Class[0]);
+ public void init()
+ throws Exception {
+
+ // Find methods
+ ejbActivate = SessionBean.class.getMethod("ejbActivate", new Class[0]);
+
+ ejbPassivate = SessionBean.class.getMethod("ejbPassivate", new
Class[0]);
+
+ ejbRemove = SessionBean.class.getMethod("ejbRemove", new Class[0]);
- String ejbName = con.getMetaData().getEjbName();
- dir = new
File(getClass().getResource("db.properties").getFile()).getParentFile();
- dir = new File(dir, ejbName);
-
- System.out.println("Storing sessions for "+ejbName+" in:"+dir);
- dir.mkdirs();
+ // Initialize the dataStore
+ String ejbName = con.getMetaData().getEjbName();
+
+ File database = new File("database");
+
+ dir = new File(database, ejbName);
+
+ dir.mkdirs();
+ System.out.println("Storing sessions for "+ejbName+" in:"+dir);
+
// Clear dir of old files
File[] sessions = dir.listFiles();
for (int i = 0; i < sessions.length; i++)