Title: [992] trunk/core/src/main/java/org/servicemix/jbi/audit/AbstractAuditor.java: Check whether the auditor should be added to container.
- Revision
- 992
- Author
- gastaldi
- Date
- 2005-12-02 12:19:23 -0500 (Fri, 02 Dec 2005)
Log Message
Check whether the auditor should be added to container. Default is true.
Modified Paths
Diff
Modified: trunk/core/src/main/java/org/servicemix/jbi/audit/AbstractAuditor.java (991 => 992)
--- trunk/core/src/main/java/org/servicemix/jbi/audit/AbstractAuditor.java 2005-12-02 17:09:57 UTC (rev 991)
+++ trunk/core/src/main/java/org/servicemix/jbi/audit/AbstractAuditor.java 2005-12-02 17:19:23 UTC (rev 992)
@@ -45,6 +45,7 @@
protected final Log log = LogFactory.getLog(getClass());
protected JBIContainer container;
+ private boolean asContainerListener = true;
public JBIContainer getContainer() {
return container;
@@ -60,7 +61,8 @@
public void start() throws javax.jbi.JBIException {
super.start();
doStart();
- this.container.addListener(this);
+ if (isAsContainerListener())
+ this.container.addListener(this);
}
/* (non-Javadoc)
@@ -206,4 +208,20 @@
public void resendExchange(MessageExchange exchange) throws JBIException {
container.resendExchange(exchange);
}
+
+ /**
+ * Test if Auditor should be included as a container listener
+ * @return Returns the addToContainer.
+ */
+ public boolean isAsContainerListener() {
+ return asContainerListener;
+ }
+
+ /**
+ * Set if Auditor should be included as a container listener.
+ * @param addToContainer The addToContainer to set.
+ */
+ public void setAsContainerListener(boolean addToContainer) {
+ this.asContainerListener = addToContainer;
+ }
}