Commit 7fff2e13 authored by Guillaume Surrel's avatar Guillaume Surrel
Browse files

Harmonize exception handling with acquisition module.

parent 8f1ae6cf
......@@ -30,7 +30,6 @@ import org.objectweb.joram.mom.notifications.ClientMessages;
import org.objectweb.joram.mom.util.DMQManager;
import org.objectweb.joram.shared.MessageErrorConstants;
import org.objectweb.joram.shared.excepts.MessageValueException;
import org.objectweb.joram.shared.excepts.RequestException;
import org.objectweb.joram.shared.messages.ConversionHelper;
import org.objectweb.joram.shared.messages.Message;
import org.objectweb.util.monolog.api.BasicLevel;
......@@ -60,7 +59,7 @@ public class DistributionModule implements Serializable {
/** The distribution queue or topic using this module. */
private final Destination destination;
public DistributionModule(Destination destination, Properties properties) throws RequestException {
public DistributionModule(Destination destination, Properties properties) {
this.destination = destination;
setProperties(properties);
}
......@@ -68,7 +67,7 @@ public class DistributionModule implements Serializable {
/**
* Resets the distribution properties.
*/
private void setProperties(Properties props) throws RequestException {
private void setProperties(Properties props) {
if (props == null) {
return;
......@@ -97,11 +96,7 @@ public class DistributionModule implements Serializable {
} catch (Exception exc) {
logger.log(BasicLevel.ERROR, "DistributionModule: can't create distribution handler.", exc);
throw new RequestException(exc.getMessage());
}
} else if (distributionHandler == null) {
throw new RequestException("Distribution class not defined: use " + CLASS_NAME
+ " property to chose distribution class.");
}
}
......
......@@ -77,12 +77,7 @@ public class DistributionQueue extends Queue {
public void initialize(boolean firstTime) {
super.initialize(firstTime);
if (distributionModule == null) {
try {
distributionModule = new DistributionModule(this, (Properties) properties.clone());
} catch (RequestException exc) {
// Should not happen as distribution module creation previously succeeded in constructor
logger.log(BasicLevel.ERROR, "DistributionQueue.initialize prop = " + properties, exc);
}
distributionModule = new DistributionModule(this, (Properties) properties.clone());
}
}
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2010 - 2011 ScalAgent Distributed Technologies
* Copyright (C) 2010 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -77,12 +77,7 @@ public class DistributionTopic extends Topic {
public void initialize(boolean firstTime) {
super.initialize(firstTime);
if (distributionModule == null) {
try {
distributionModule = new DistributionModule(this, (Properties) properties.clone());
} catch (RequestException exc) {
// Should not happen as distribution module creation previously succeeded in constructor
logger.log(BasicLevel.ERROR, "DistributionTopic.initialize prop = " + properties, exc);
}
distributionModule = new DistributionModule(this, (Properties) properties.clone());
}
}
......
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