making the journal broker aware so that it can pass on the broker service config to the long term persistence

adapter if it is also broker aware.



git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@657904 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2008-05-19 18:39:59 +00:00
parent ab3b155ff6
commit b9797bc618
1 changed files with 10 additions and 1 deletions

View File

@ -38,6 +38,8 @@ import org.apache.activeio.journal.JournalEventListener;
import org.apache.activeio.journal.RecordLocation;
import org.apache.activeio.packet.ByteArrayPacket;
import org.apache.activeio.packet.Packet;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.broker.BrokerServiceAware;
import org.apache.activemq.broker.ConnectionContext;
import org.apache.activemq.command.ActiveMQDestination;
import org.apache.activemq.command.ActiveMQQueue;
@ -79,7 +81,7 @@ import org.apache.commons.logging.LogFactory;
* @org.apache.xbean.XBean
* @version $Revision: 1.17 $
*/
public class JournalPersistenceAdapter implements PersistenceAdapter, JournalEventListener, UsageListener {
public class JournalPersistenceAdapter implements PersistenceAdapter, JournalEventListener, UsageListener, BrokerServiceAware {
private static final Log LOG = LogFactory.getLog(JournalPersistenceAdapter.class);
@ -689,4 +691,11 @@ public class JournalPersistenceAdapter implements PersistenceAdapter, JournalEve
return 0;
}
public void setBrokerService(BrokerService brokerService) {
PersistenceAdapter pa = getLongTermPersistence();
if( pa instanceof BrokerServiceAware ) {
((BrokerServiceAware)pa).setBrokerService(brokerService);
}
}
}