Commit dc532953 authored by David Feliot's avatar David Feliot
Browse files

JORAM-166, JORAM-169, JORAM-170, JORAM-177, JORAM-179: improve persistence...

JORAM-166, JORAM-169, JORAM-170, JORAM-177, JORAM-179: improve persistence efficiency and use callback mechanism.
parent fb96e3ca
......@@ -90,7 +90,7 @@ public class FtpQueue extends Queue {
*
* @param firstTime true when first called by the factory
*/
public void initialize(boolean firstTime) {
public void initialize(boolean firstTime) throws Exception {
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG, "initialize(" + firstTime + ')');
......
......@@ -92,7 +92,7 @@ public class JMSBridgeQueue extends Queue {
*
* @param firstTime true when first called by the factory
*/
public void initialize(boolean firstTime) {
public void initialize(boolean firstTime) throws Exception {
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG, "initialize(" + firstTime + ')');
......@@ -271,7 +271,7 @@ public class JMSBridgeQueue extends Queue {
Message message;
for (Iterator msgs = not.getMessages().iterator(); msgs.hasNext();) {
message = new Message((org.objectweb.joram.shared.messages.Message) msgs.next());
message.order = arrivalsCounter++;
message.order = arrivalState.getAndIncrementArrivalCount(message.isPersistent());
outTable.put(message.getId(), message);
......
......@@ -67,7 +67,7 @@ public class SchedulerQueue extends Queue {
*
* @param firstTime true when first called by the factory
*/
public void initialize(boolean firstTime) {
public void initialize(boolean firstTime) throws Exception {
super.initialize(firstTime);
try {
......@@ -107,6 +107,10 @@ public class SchedulerQueue extends Queue {
try {
scheduler.scheduleEvent(new ScheduleEvent(msg.id, new Date(scheduleDate)),
new SchedulerQueueTask(getId()));
// Needs to save the SchedulerQueue.
// Queue may not be modified so a 'setSave' is required.
setSave();
} catch (Exception e) {
if (logger.isLoggable(BasicLevel.ERROR))
logger.log(BasicLevel.ERROR, "SchedulerQueue.postProcess(" + not + ')', e);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment