User: dmaplesden
Date: 01/09/06 14:49:43
Modified: src/main/org/jboss/mq/pm/logged SpyTxLog.java
SpyMessageLog.java PersistenceManager.java
ObjectIntegrityLog.java IntegrityLog.java
Log:
Changed to remove reference to "jboss.jcml" file as file system anchor. Replaced
with "jboss.system.home" property.
Revision Changes Path
1.3 +4 -4 jbossmq/src/main/org/jboss/mq/pm/logged/SpyTxLog.java
Index: SpyTxLog.java
===================================================================
RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/pm/logged/SpyTxLog.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SpyTxLog.java 2001/08/17 03:04:05 1.2
+++ SpyTxLog.java 2001/09/06 21:49:43 1.3
@@ -18,7 +18,7 @@
*
* @created August 16, 2001
* @author: Hiram Chirino ([EMAIL PROTECTED])
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class SpyTxLog {
@@ -31,12 +31,12 @@
/////////////////////////////////////////////////////////////////////
// Constructors
/////////////////////////////////////////////////////////////////////
- public SpyTxLog( String fileName )
+ public SpyTxLog( java.io.File file )
throws JMSException {
try {
- transactionLog = new ObjectIntegrityLog( fileName );
+ transactionLog = new ObjectIntegrityLog( file );
} catch ( IOException e ) {
- throwJMSException( "Could not open the queue's tranaction log: " +
fileName, e );
+ throwJMSException( "Could not open the queue's tranaction log: " +
file.getAbsolutePath(), e );
}
}
1.3 +4 -4 jbossmq/src/main/org/jboss/mq/pm/logged/SpyMessageLog.java
Index: SpyMessageLog.java
===================================================================
RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/pm/logged/SpyMessageLog.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SpyMessageLog.java 2001/08/17 03:04:05 1.2
+++ SpyMessageLog.java 2001/09/06 21:49:43 1.3
@@ -21,7 +21,7 @@
*
* @created August 16, 2001
* @author: Hiram Chirino ([EMAIL PROTECTED])
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class SpyMessageLog {
@@ -36,12 +36,12 @@
/////////////////////////////////////////////////////////////////////
// Constructor
/////////////////////////////////////////////////////////////////////
- public SpyMessageLog( String fileName )
+ public SpyMessageLog( java.io.File file )
throws JMSException {
try {
- transactionLog = new ObjectIntegrityLog( fileName );
+ transactionLog = new ObjectIntegrityLog( file );
} catch ( IOException e ) {
- throwJMSException( "Could not open the queue's tranaction log: " +
fileName, e );
+ throwJMSException( "Could not open the queue's tranaction log: " +
file.getAbsolutePath(), e );
}
}
1.5 +9 -9 jbossmq/src/main/org/jboss/mq/pm/logged/PersistenceManager.java
Index: PersistenceManager.java
===================================================================
RCS file:
/cvsroot/jboss/jbossmq/src/main/org/jboss/mq/pm/logged/PersistenceManager.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- PersistenceManager.java 2001/09/01 03:01:00 1.4
+++ PersistenceManager.java 2001/09/06 21:49:43 1.5
@@ -6,6 +6,7 @@
*/
package org.jboss.mq.pm.logged;
+import java.io.File;
import java.net.URL;
import java.util.HashMap;
import java.util.Iterator;
@@ -35,7 +36,7 @@
* This class manages all persistence related services.
*
* @author Hiram Chirino ([EMAIL PROTECTED])
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
*/
public class PersistenceManager extends ServiceMBeanSupport implements
PersistenceManagerMBean, org.jboss.mq.pm.PersistenceManager
{
@@ -54,7 +55,7 @@
// The directory where persistence data should be stored
- URL dataDirURL;
+ File dataDirFile;
TxManager txManager;
private String dataDirectory;
@@ -121,11 +122,11 @@
public void initService() throws Exception
{
- URL configFile = getClass().getClassLoader().getResource("jboss.jcml");
+ File jbossHome = new File(System.getProperty("jboss.system.home"));
+ dataDirFile = new File(jbossHome, dataDirectory);
- dataDirURL = new URL(configFile, dataDirectory);
- URL txLogFile = new URL(dataDirURL, "transactions.dat");
- spyTxLog = new SpyTxLog(txLogFile.getFile());
+ File txLogFile = new File(dataDirFile, "transactions.dat");
+ spyTxLog = new SpyTxLog(txLogFile);
//Get an InitialContext
JMSServer server = (JMSServer)getServer().invoke(new
ObjectName(org.jboss.mq.server.JBossMQServiceMBean.OBJECT_NAME), "getJMSServer", new
Object[]{}, new String[]{});
@@ -159,8 +160,7 @@
try
{
- URL logFile = new URL(dataDirURL, dest.toString() + ".dat");
- java.io.File file = new java.io.File(logFile.getFile());
+ java.io.File file = new File(dataDirFile, dest.toString() + ".dat");
SpyMessageLog log = (SpyMessageLog)messageLogs.remove("" + dest);
if (log == null)
@@ -197,8 +197,8 @@
try
{
- URL logFile = new URL(dataDirURL, dest.toString() + ".dat");
- SpyMessageLog log = new SpyMessageLog(logFile.getFile());
+ File file = new File(dataDirFile, dest.toString() + ".dat");
+ SpyMessageLog log = new SpyMessageLog(file);
LogInfo info = new LogInfo(log, dest);
1.3 +4 -3 jbossmq/src/main/org/jboss/mq/pm/logged/ObjectIntegrityLog.java
Index: ObjectIntegrityLog.java
===================================================================
RCS file:
/cvsroot/jboss/jbossmq/src/main/org/jboss/mq/pm/logged/ObjectIntegrityLog.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ObjectIntegrityLog.java 2001/08/17 03:04:05 1.2
+++ ObjectIntegrityLog.java 2001/09/06 21:49:43 1.3
@@ -13,6 +13,7 @@
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.io.Serializable;
+import java.io.File;
import javax.jms.JMSException;
@@ -24,7 +25,7 @@
*
* @created August 16, 2001
* @author: Hiram Chirino ([EMAIL PROTECTED])
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class ObjectIntegrityLog {
@@ -38,9 +39,9 @@
/////////////////////////////////////////////////////////////////////
// Constructor
/////////////////////////////////////////////////////////////////////
- public ObjectIntegrityLog( String fileName )
+ public ObjectIntegrityLog( File file )
throws IOException {
- transactionLog = new IntegrityLog( fileName );
+ transactionLog = new IntegrityLog( file );
logOutputStream = transactionLog.getOutputStream();
out = new MyObjectOutputStream( logOutputStream );
}
1.3 +4 -5 jbossmq/src/main/org/jboss/mq/pm/logged/IntegrityLog.java
Index: IntegrityLog.java
===================================================================
RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/pm/logged/IntegrityLog.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- IntegrityLog.java 2001/08/17 03:04:05 1.2
+++ IntegrityLog.java 2001/09/06 21:49:43 1.3
@@ -21,7 +21,7 @@
*
* @created August 16, 2001
* @author: Hiram Chirino ([EMAIL PROTECTED])
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class IntegrityLog {
// in bytes
@@ -45,12 +45,11 @@
/////////////////////////////////////////////////////////////////////
// Constructor
/////////////////////////////////////////////////////////////////////
- public IntegrityLog( String fileName )
+ public IntegrityLog( File file )
throws IOException {
- File f = new File( fileName );
- boolean exists = f.isFile();
+ boolean exists = file.isFile();
- raf = new RandomAccessFile( f, "rw" );
+ raf = new RandomAccessFile( file, "rw" );
if ( exists ) {
loadHeader();
} else {
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development