git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@603863 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2007-12-13 09:19:36 +00:00
parent 92bbce1d6f
commit a3b4c5a358
2 changed files with 5 additions and 3 deletions

View File

@ -724,6 +724,7 @@ public class BrokerService implements Service {
*/ */
public void setPersistenceAdapter(PersistenceAdapter persistenceAdapter) { public void setPersistenceAdapter(PersistenceAdapter persistenceAdapter) {
this.persistenceAdapter = persistenceAdapter; this.persistenceAdapter = persistenceAdapter;
configureService(this.persistenceAdapter);
} }
public TaskRunnerFactory getTaskRunnerFactory() { public TaskRunnerFactory getTaskRunnerFactory() {

View File

@ -140,6 +140,7 @@ public class AMQPersistenceAdapter implements PersistenceAdapter, UsageListener,
public void setBrokerService(BrokerService brokerService) { public void setBrokerService(BrokerService brokerService) {
this.brokerService = brokerService; this.brokerService = brokerService;
Thread.dumpStack();
} }
public synchronized void start() throws Exception { public synchronized void start() throws Exception {
@ -149,8 +150,8 @@ public class AMQPersistenceAdapter implements PersistenceAdapter, UsageListener,
if (this.directory == null) { if (this.directory == null) {
if (brokerService != null) { if (brokerService != null) {
this.directory = brokerService.getBrokerDataDirectory(); this.directory = brokerService.getBrokerDataDirectory();
} else { } else {
this.directory = new File(IOHelper.getDefaultDataDirectory(), IOHelper.toFileSystemSafeName(brokerName)); this.directory = new File(IOHelper.getDefaultDataDirectory(), IOHelper.toFileSystemSafeName(brokerName));
this.directory = new File(directory, "amqstore"); this.directory = new File(directory, "amqstore");
this.directoryPath=directory.getAbsolutePath(); this.directoryPath=directory.getAbsolutePath();
@ -159,10 +160,10 @@ public class AMQPersistenceAdapter implements PersistenceAdapter, UsageListener,
if (this.directoryArchive == null) { if (this.directoryArchive == null) {
this.directoryArchive = new File(this.directory,"archive"); this.directoryArchive = new File(this.directory,"archive");
} }
this.directory.mkdirs();
lockFile = new RandomAccessFile(new File(directory, "lock"), "rw"); lockFile = new RandomAccessFile(new File(directory, "lock"), "rw");
lock(); lock();
LOG.info("AMQStore starting using directory: " + directory); LOG.info("AMQStore starting using directory: " + directory);
this.directory.mkdirs();
if (archiveDataLogs) { if (archiveDataLogs) {
this.directoryArchive.mkdirs(); this.directoryArchive.mkdirs();
} }