Title: [685] trunk/jbi: Move component classes out of container
Revision
685
Author
gnt
Date
2005-10-27 04:08:52 -0400 (Thu, 27 Oct 2005)

Log Message

Move component classes out of container

Modified Paths


Added Paths

Removed Paths

  • trunk/core/src/main/java/org/servicemix/jbi/binding/
  • trunk/core/src/main/java/org/servicemix/jbi/component/

Property Changed

  • trunk/jbi/

Diff

Modified: trunk/components/base/src/main/java/org/servicemix/components/activesoap/ASInOutBinding.java (684 => 685)

--- trunk/components/base/src/main/java/org/servicemix/components/activesoap/ASInOutBinding.java	2005-10-27 08:06:36 UTC (rev 684)
+++ trunk/components/base/src/main/java/org/servicemix/components/activesoap/ASInOutBinding.java	2005-10-27 08:08:52 UTC (rev 685)
@@ -18,7 +18,7 @@
 package org.servicemix.components.activesoap;
 
 import org.codehaus.activesoap.RestService;
-import org.servicemix.jbi.binding.OutBinding;
+import org.servicemix.components.util.OutBinding;
 import org.servicemix.jbi.messaging.MessageExchangeImpl;
 
 import javax.jbi.messaging.ExchangeStatus;

Modified: trunk/components/base/src/main/java/org/servicemix/components/activesoap/ASOutBinding.java (684 => 685)

--- trunk/components/base/src/main/java/org/servicemix/components/activesoap/ASOutBinding.java	2005-10-27 08:06:36 UTC (rev 684)
+++ trunk/components/base/src/main/java/org/servicemix/components/activesoap/ASOutBinding.java	2005-10-27 08:08:52 UTC (rev 685)
@@ -18,7 +18,7 @@
 package org.servicemix.components.activesoap;
 
 import org.codehaus.activesoap.RestService;
-import org.servicemix.jbi.binding.OutBinding;
+import org.servicemix.components.util.OutBinding;
 
 import javax.jbi.messaging.ExchangeStatus;
 import javax.jbi.messaging.MessageExchange;

Modified: trunk/components/base/src/main/java/org/servicemix/components/drools/DroolsComponent.java (684 => 685)

--- trunk/components/base/src/main/java/org/servicemix/components/drools/DroolsComponent.java	2005-10-27 08:06:36 UTC (rev 684)
+++ trunk/components/base/src/main/java/org/servicemix/components/drools/DroolsComponent.java	2005-10-27 08:08:52 UTC (rev 685)
@@ -23,7 +23,7 @@
 import org.drools.io.RuleBaseLoader;
 import org.servicemix.components.util.CopyTransformer;
 import org.servicemix.components.util.MessageTransformer;
-import org.servicemix.jbi.binding.OutBinding;
+import org.servicemix.components.util.OutBinding;
 import org.springframework.core.io.Resource;
 
 import javax.jbi.JBIException;

Modified: trunk/components/base/src/main/java/org/servicemix/components/email/MimeMailSender.java (684 => 685)

--- trunk/components/base/src/main/java/org/servicemix/components/email/MimeMailSender.java	2005-10-27 08:06:36 UTC (rev 684)
+++ trunk/components/base/src/main/java/org/servicemix/components/email/MimeMailSender.java	2005-10-27 08:08:52 UTC (rev 685)
@@ -17,7 +17,7 @@
  **/
 package org.servicemix.components.email;
 
-import org.servicemix.jbi.binding.OutBinding;
+import org.servicemix.components.util.OutBinding;
 import org.springframework.mail.MailException;
 import org.springframework.mail.javamail.JavaMailSender;
 import org.springframework.mail.javamail.MimeMessagePreparator;

Modified: trunk/components/base/src/main/java/org/servicemix/components/email/SimpleMailSender.java (684 => 685)

--- trunk/components/base/src/main/java/org/servicemix/components/email/SimpleMailSender.java	2005-10-27 08:06:36 UTC (rev 684)
+++ trunk/components/base/src/main/java/org/servicemix/components/email/SimpleMailSender.java	2005-10-27 08:08:52 UTC (rev 685)
@@ -22,7 +22,7 @@
 import javax.jbi.messaging.MessagingException;
 import javax.jbi.messaging.NormalizedMessage;
 
-import org.servicemix.jbi.binding.OutBinding;
+import org.servicemix.components.util.OutBinding;
 import org.springframework.mail.MailException;
 import org.springframework.mail.MailSender;
 import org.springframework.mail.SimpleMailMessage;

Modified: trunk/components/base/src/main/java/org/servicemix/components/file/FileWriter.java (684 => 685)

--- trunk/components/base/src/main/java/org/servicemix/components/file/FileWriter.java	2005-10-27 08:06:36 UTC (rev 684)
+++ trunk/components/base/src/main/java/org/servicemix/components/file/FileWriter.java	2005-10-27 08:08:52 UTC (rev 685)
@@ -21,7 +21,7 @@
 import org.apache.commons.logging.LogFactory;
 import org.servicemix.components.util.DefaultFileMarshaler;
 import org.servicemix.components.util.FileMarshaler;
-import org.servicemix.jbi.binding.OutBinding;
+import org.servicemix.components.util.OutBinding;
 
 import javax.jbi.JBIException;
 import javax.jbi.messaging.MessageExchange;

Modified: trunk/components/base/src/main/java/org/servicemix/components/jabber/JabberComponentSupport.java (684 => 685)

--- trunk/components/base/src/main/java/org/servicemix/components/jabber/JabberComponentSupport.java	2005-10-27 08:06:36 UTC (rev 684)
+++ trunk/components/base/src/main/java/org/servicemix/components/jabber/JabberComponentSupport.java	2005-10-27 08:08:52 UTC (rev 685)
@@ -24,7 +24,7 @@
 import org.jivesoftware.smack.XMPPConnection;
 import org.jivesoftware.smack.XMPPException;
 import org.jivesoftware.smack.packet.Packet;
-import org.servicemix.jbi.binding.OutBinding;
+import org.servicemix.components.util.OutBinding;
 import org.springframework.beans.factory.InitializingBean;
 
 import javax.jbi.JBIException;

Modified: trunk/components/base/src/main/java/org/servicemix/components/jaxrpc/JaxRpcInBinding.java (684 => 685)

--- trunk/components/base/src/main/java/org/servicemix/components/jaxrpc/JaxRpcInBinding.java	2005-10-27 08:06:36 UTC (rev 684)
+++ trunk/components/base/src/main/java/org/servicemix/components/jaxrpc/JaxRpcInBinding.java	2005-10-27 08:08:52 UTC (rev 685)
@@ -17,7 +17,7 @@
  **/
 package org.servicemix.components.jaxrpc;
 
-import org.servicemix.jbi.binding.OutBinding;
+import org.servicemix.components.util.OutBinding;
 
 import javax.jbi.messaging.MessageExchange;
 import javax.jbi.messaging.MessagingException;

Modified: trunk/components/base/src/main/java/org/servicemix/components/jms/JmsInBinding.java (684 => 685)

--- trunk/components/base/src/main/java/org/servicemix/components/jms/JmsInBinding.java	2005-10-27 08:06:36 UTC (rev 684)
+++ trunk/components/base/src/main/java/org/servicemix/components/jms/JmsInBinding.java	2005-10-27 08:08:52 UTC (rev 685)
@@ -17,7 +17,7 @@
  **/
 package org.servicemix.components.jms;
 
-import org.servicemix.jbi.binding.RuntimeJBIException;
+import org.servicemix.jbi.RuntimeJBIException;
 import org.servicemix.components.util.ComponentSupport;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;

Modified: trunk/components/base/src/main/java/org/servicemix/components/jms/JmsOutBinding.java (684 => 685)

--- trunk/components/base/src/main/java/org/servicemix/components/jms/JmsOutBinding.java	2005-10-27 08:06:36 UTC (rev 684)
+++ trunk/components/base/src/main/java/org/servicemix/components/jms/JmsOutBinding.java	2005-10-27 08:08:52 UTC (rev 685)
@@ -19,7 +19,7 @@
 
 import org.logicblaze.lingo.jms.JmsProducer;
 import org.logicblaze.lingo.jms.JmsProducerPool;
-import org.servicemix.jbi.binding.OutBinding;
+import org.servicemix.components.util.OutBinding;
 
 import javax.jbi.messaging.ExchangeStatus;
 import javax.jbi.messaging.MessageExchange;

Modified: trunk/components/base/src/main/java/org/servicemix/components/jms/JmsSenderComponent.java (684 => 685)

--- trunk/components/base/src/main/java/org/servicemix/components/jms/JmsSenderComponent.java	2005-10-27 08:06:36 UTC (rev 684)
+++ trunk/components/base/src/main/java/org/servicemix/components/jms/JmsSenderComponent.java	2005-10-27 08:08:52 UTC (rev 685)
@@ -19,7 +19,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.servicemix.jbi.binding.OutBinding;
+import org.servicemix.components.util.OutBinding;
 import org.springframework.jms.JmsException;
 import org.springframework.jms.core.JmsTemplate;
 import org.springframework.jms.core.MessageCreator;

Modified: trunk/components/base/src/main/java/org/servicemix/components/mule/JBIMessageReceiverComponent.java (684 => 685)

--- trunk/components/base/src/main/java/org/servicemix/components/mule/JBIMessageReceiverComponent.java	2005-10-27 08:06:36 UTC (rev 684)
+++ trunk/components/base/src/main/java/org/servicemix/components/mule/JBIMessageReceiverComponent.java	2005-10-27 08:08:52 UTC (rev 685)
@@ -19,7 +19,7 @@
 
 import org.mule.umo.UMOException;
 import org.mule.umo.UMOMessage;
-import org.servicemix.jbi.binding.OutBinding;
+import org.servicemix.components.util.OutBinding;
 
 import javax.jbi.JBIException;
 import javax.jbi.messaging.MessageExchange;

Modified: trunk/components/base/src/main/java/org/servicemix/components/net/FTPSender.java (684 => 685)

--- trunk/components/base/src/main/java/org/servicemix/components/net/FTPSender.java	2005-10-27 08:06:36 UTC (rev 684)
+++ trunk/components/base/src/main/java/org/servicemix/components/net/FTPSender.java	2005-10-27 08:08:52 UTC (rev 685)
@@ -23,7 +23,7 @@
 import org.apache.commons.net.ftp.FTPClient;
 import org.servicemix.components.util.DefaultFileMarshaler;
 import org.servicemix.components.util.FileMarshaler;
-import org.servicemix.jbi.binding.OutBinding;
+import org.servicemix.components.util.OutBinding;
 
 import javax.jbi.JBIException;
 import javax.jbi.messaging.MessageExchange;

Modified: trunk/components/base/src/main/java/org/servicemix/components/reflection/ProxyInOnlyBinding.java (684 => 685)

--- trunk/components/base/src/main/java/org/servicemix/components/reflection/ProxyInOnlyBinding.java	2005-10-27 08:06:36 UTC (rev 684)
+++ trunk/components/base/src/main/java/org/servicemix/components/reflection/ProxyInOnlyBinding.java	2005-10-27 08:08:52 UTC (rev 685)
@@ -28,7 +28,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.servicemix.components.util.ComponentSupport;
-import org.servicemix.jbi.binding.RuntimeJBIException;
+import org.servicemix.jbi.RuntimeJBIException;
 
 /**
  * A Proxy factory which sends the method invocations into the JBI container

Modified: trunk/components/base/src/main/java/org/servicemix/components/reflection/ProxyInOutBinding.java (684 => 685)

--- trunk/components/base/src/main/java/org/servicemix/components/reflection/ProxyInOutBinding.java	2005-10-27 08:06:36 UTC (rev 684)
+++ trunk/components/base/src/main/java/org/servicemix/components/reflection/ProxyInOutBinding.java	2005-10-27 08:08:52 UTC (rev 685)
@@ -29,7 +29,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.servicemix.components.util.ComponentSupport;
-import org.servicemix.jbi.binding.RuntimeJBIException;
+import org.servicemix.jbi.RuntimeJBIException;
 
 /**
  * A Proxy factory which sends the method invocations into the JBI container

Modified: trunk/components/base/src/main/java/org/servicemix/components/reflection/ReflectionOutBinding.java (684 => 685)

--- trunk/components/base/src/main/java/org/servicemix/components/reflection/ReflectionOutBinding.java	2005-10-27 08:06:36 UTC (rev 684)
+++ trunk/components/base/src/main/java/org/servicemix/components/reflection/ReflectionOutBinding.java	2005-10-27 08:08:52 UTC (rev 685)
@@ -25,7 +25,7 @@
 import javax.jbi.messaging.MessagingException;
 import javax.jbi.messaging.NormalizedMessage;
 
-import org.servicemix.jbi.binding.OutBinding;
+import org.servicemix.components.util.OutBinding;
 
 /**
  * Consumes normalized method invocation from the JBI container.

Modified: trunk/components/base/src/main/java/org/servicemix/components/rss/FeedWriter.java (684 => 685)

--- trunk/components/base/src/main/java/org/servicemix/components/rss/FeedWriter.java	2005-10-27 08:06:36 UTC (rev 684)
+++ trunk/components/base/src/main/java/org/servicemix/components/rss/FeedWriter.java	2005-10-27 08:08:52 UTC (rev 685)
@@ -28,10 +28,10 @@
 import com.sun.syndication.io.SyndFeedOutput;
 import com.sun.syndication.io.XmlReader;
 
+import org.servicemix.components.util.OutBinding;
 import org.servicemix._expression_.ConstantExpression;
 import org.servicemix._expression_._expression_;
 import org.servicemix._expression_.ExpressionHelper;
-import org.servicemix.jbi.binding.OutBinding;
 import org.servicemix.jbi.jaxp.SourceTransformer;
 
 import javax.jbi.JBIException;

Modified: trunk/components/base/src/main/java/org/servicemix/components/saaj/SaajBinding.java (684 => 685)

--- trunk/components/base/src/main/java/org/servicemix/components/saaj/SaajBinding.java	2005-10-27 08:06:36 UTC (rev 684)
+++ trunk/components/base/src/main/java/org/servicemix/components/saaj/SaajBinding.java	2005-10-27 08:08:52 UTC (rev 685)
@@ -19,9 +19,9 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.servicemix.jbi.binding.OutBinding;
 import org.servicemix.jbi.messaging.MessageExchangeImpl;
 import org.servicemix.components.util.ComponentSupport;
+import org.servicemix.components.util.OutBinding;
 import org.servicemix.MessageExchangeListener;
 
 import javax.jbi.messaging.ExchangeStatus;

Modified: trunk/components/base/src/main/java/org/servicemix/components/saaj/SaajInBinding.java (684 => 685)

--- trunk/components/base/src/main/java/org/servicemix/components/saaj/SaajInBinding.java	2005-10-27 08:06:36 UTC (rev 684)
+++ trunk/components/base/src/main/java/org/servicemix/components/saaj/SaajInBinding.java	2005-10-27 08:08:52 UTC (rev 685)
@@ -17,7 +17,7 @@
  **/
 package org.servicemix.components.saaj;
 
-import org.servicemix.jbi.binding.RuntimeJBIException;
+import org.servicemix.jbi.RuntimeJBIException;
 import org.servicemix.components.util.ComponentSupport;
 
 import javax.jbi.JBIException;

Modified: trunk/components/base/src/main/java/org/servicemix/components/vfs/FileWriter.java (684 => 685)

--- trunk/components/base/src/main/java/org/servicemix/components/vfs/FileWriter.java	2005-10-27 08:06:36 UTC (rev 684)
+++ trunk/components/base/src/main/java/org/servicemix/components/vfs/FileWriter.java	2005-10-27 08:08:52 UTC (rev 685)
@@ -26,7 +26,7 @@
 import org.apache.commons.vfs.FileSystemException;
 import org.servicemix.components.util.DefaultFileMarshaler;
 import org.servicemix.components.util.FileMarshaler;
-import org.servicemix.jbi.binding.OutBinding;
+import org.servicemix.components.util.OutBinding;
 
 import javax.jbi.JBIException;
 import javax.jbi.messaging.MessageExchange;

Modified: trunk/components/base/src/main/java/org/servicemix/components/wsif/WSIFOutBinding.java (684 => 685)

--- trunk/components/base/src/main/java/org/servicemix/components/wsif/WSIFOutBinding.java	2005-10-27 08:06:36 UTC (rev 684)
+++ trunk/components/base/src/main/java/org/servicemix/components/wsif/WSIFOutBinding.java	2005-10-27 08:08:52 UTC (rev 685)
@@ -20,7 +20,7 @@
 import org.apache.wsif.WSIFException;
 import org.apache.wsif.WSIFMessage;
 import org.apache.wsif.WSIFOperation;
-import org.servicemix.jbi.binding.OutBinding;
+import org.servicemix.components.util.OutBinding;
 
 import javax.jbi.messaging.ExchangeStatus;
 import javax.jbi.messaging.MessageExchange;

Modified: trunk/components/base/src/main/java/org/servicemix/components/xfire/XFireBinding.java (684 => 685)

--- trunk/components/base/src/main/java/org/servicemix/components/xfire/XFireBinding.java	2005-10-27 08:06:36 UTC (rev 684)
+++ trunk/components/base/src/main/java/org/servicemix/components/xfire/XFireBinding.java	2005-10-27 08:08:52 UTC (rev 685)
@@ -14,7 +14,7 @@
 import org.codehaus.xfire.transport.Channel;
 import org.codehaus.xfire.transport.Transport;
 import org.codehaus.xfire.transport.local.LocalTransport;
-import org.servicemix.jbi.binding.OutBinding;
+import org.servicemix.components.util.OutBinding;
 import org.servicemix.jbi.messaging.MessageExchangeImpl;
 
 public class XFireBinding extends OutBinding {

Modified: trunk/components/base/src/main/java/org/servicemix/components/xfire/XFireOutBinding.java (684 => 685)

--- trunk/components/base/src/main/java/org/servicemix/components/xfire/XFireOutBinding.java	2005-10-27 08:06:36 UTC (rev 684)
+++ trunk/components/base/src/main/java/org/servicemix/components/xfire/XFireOutBinding.java	2005-10-27 08:08:52 UTC (rev 685)
@@ -12,7 +12,7 @@
 import org.codehaus.xfire.transport.Channel;
 import org.codehaus.xfire.transport.Transport;
 import org.codehaus.xfire.transport.local.LocalTransport;
-import org.servicemix.jbi.binding.OutBinding;
+import org.servicemix.components.util.OutBinding;
 
 public class XFireOutBinding extends OutBinding {
     private XMarshaler marshaller;

Modified: trunk/core/src/main/java/org/servicemix/components/util/ComponentAdaptor.java (684 => 685)

--- trunk/core/src/main/java/org/servicemix/components/util/ComponentAdaptor.java	2005-10-27 08:06:36 UTC (rev 684)
+++ trunk/core/src/main/java/org/servicemix/components/util/ComponentAdaptor.java	2005-10-27 08:08:52 UTC (rev 685)
@@ -17,7 +17,6 @@
  **/
 package org.servicemix.components.util;
 
-import org.servicemix.jbi.component.ServiceUnitManagerSupport;
 import org.w3c.dom.Document;
 import org.w3c.dom.DocumentFragment;
 

Modified: trunk/core/src/main/java/org/servicemix/components/util/ComponentSupport.java (684 => 685)

--- trunk/core/src/main/java/org/servicemix/components/util/ComponentSupport.java	2005-10-27 08:06:36 UTC (rev 684)
+++ trunk/core/src/main/java/org/servicemix/components/util/ComponentSupport.java	2005-10-27 08:08:52 UTC (rev 685)
@@ -20,7 +20,6 @@
 package org.servicemix.components.util;
 
 import org.servicemix.jbi.NoInMessageAvailableException;
-import org.servicemix.jbi.component.ServiceUnitManagerSupport;
 import org.w3c.dom.Document;
 import org.w3c.dom.DocumentFragment;
 

Added: trunk/core/src/main/java/org/servicemix/components/util/OutBinding.java (684 => 685)

--- trunk/core/src/main/java/org/servicemix/components/util/OutBinding.java	2005-10-27 08:06:36 UTC (rev 684)
+++ trunk/core/src/main/java/org/servicemix/components/util/OutBinding.java	2005-10-27 08:08:52 UTC (rev 685)
@@ -0,0 +1,128 @@
+/**
+ * 
+ * Copyright 2005 Protique Ltd
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); 
+ * you may not use this file except in compliance with the License. 
+ * You may obtain a copy of the License at 
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License. 
+ * 
+ **/
+
+package org.servicemix.components.util;
+
+import edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.servicemix.MessageExchangeListener;
+
+import javax.jbi.JBIException;
+import javax.jbi.messaging.DeliveryChannel;
+import javax.jbi.messaging.ExchangeStatus;
+import javax.jbi.messaging.MessageExchange;
+import javax.jbi.messaging.MessagingException;
+import javax.jbi.messaging.NormalizedMessage;
+
+/**
+ * A base class for bindings which process inbound JBI messages
+ *
+ * @version $Revision: 657 $
+ */
+public abstract class OutBinding extends ComponentSupport implements Runnable, MessageExchangeListener {
+    private static final Log log = LogFactory.getLog(OutBinding.class);
+    private AtomicBoolean stop = new AtomicBoolean(false);
+    private Thread runnable;
+
+    public OutBinding() {
+    }
+
+    public void onMessageExchange(MessageExchange exchange) throws MessagingException {
+        if (exchange.getStatus() == ExchangeStatus.ACTIVE) {
+            try {
+                NormalizedMessage message = getInMessage(exchange);
+                process(exchange, message);
+            }
+            catch (Exception e) {
+                fail(exchange, e);
+            }
+        } else if (exchange.getStatus() == ExchangeStatus.ERROR) {
+            done(exchange);
+        }
+    }
+
+    /**
+     * Runnable implementation
+     */
+    public void run() {
+        try {
+            DeliveryChannel deliveryChannel = getDeliveryChannel();
+            while (!stop.get()) {
+                MessageExchange exchange = deliveryChannel.accept();
+                if (exchange != null) {
+                    try {
+                        onMessageExchange(exchange);
+                    } catch (MessagingException e) {
+                        log.error("MessageExchange processing failed", e);
+                    }
+                }
+            }
+        }
+        catch (MessagingException e) {
+            log.error("run failed", e);
+        }
+    }
+
+    /**
+     * shutdown
+     *
+     * @throws JBIException
+     */
+    public void shutDown() throws JBIException {
+    }
+
+    /**
+     * stop
+     *
+     * @throws JBIException
+     */
+    public void stop() throws JBIException {
+        stop.compareAndSet(true, false);
+        if (runnable != null) {
+            runnable.interrupt();
+            try {
+                runnable.join();
+            } catch (InterruptedException e) {
+                log.warn("Unable to stop component polling thread", e);
+            }
+            runnable = null;
+        }
+    }
+
+    /**
+     * start
+     */
+    public void start() throws JBIException {
+        if (stop.compareAndSet(false, true)) {
+            runnable = new Thread(this);
+            runnable.setDaemon(true);
+            runnable.start();
+        }
+    }
+
+    /**
+     * Process incoming
+     *
+     * @param messageExchange
+     * @param message
+     * @throws MessagingException
+     */
+    protected abstract void process(MessageExchange messageExchange, NormalizedMessage message) throws MessagingException;
+}

Copied: trunk/core/src/main/java/org/servicemix/components/util/ServiceUnitManagerSupport.java (from rev 682, trunk/core/src/main/java/org/servicemix/jbi/component/ServiceUnitManagerSupport.java) (682 => 685)

--- trunk/core/src/main/java/org/servicemix/jbi/component/ServiceUnitManagerSupport.java	2005-10-26 23:23:33 UTC (rev 682)
+++ trunk/core/src/main/java/org/servicemix/components/util/ServiceUnitManagerSupport.java	2005-10-27 08:08:52 UTC (rev 685)
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License")
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Copyright 2005 RAJD Consultancy Ltd. All rights reserved.
+ */
+
+package org.servicemix.components.util;
+import javax.jbi.component.ServiceUnitManager;
+import javax.jbi.management.DeploymentException;
+
+/**
+ * component-supplied methods for managing Service Unit deployments
+ * 
+ * @version $Revision$
+ */
+public class ServiceUnitManagerSupport implements ServiceUnitManager {
+    /**
+     * Deploy a Service Unit to the Component
+     * 
+     * @param serviceUnitName
+     * @param serviceUnitRootPath
+     * @return a deployment status message
+     * @throws DeploymentException
+     */
+    public String deploy(String serviceUnitName, String serviceUnitRootPath) throws DeploymentException {
+        return serviceUnitRootPath;
+    }
+
+    /**
+     * Initialize Deployment
+     * 
+     * @param serviceUnitName
+     * @param serviceUnitRootPath
+     * @throws DeploymentException
+     */
+    public void init(String serviceUnitName, String serviceUnitRootPath) throws DeploymentException {
+    }
+
+    /**
+     * shutdown
+     * 
+     * @param saerviceUnitName
+     * @throws DeploymentException
+     */
+    public void shutDown(String saerviceUnitName) throws DeploymentException {
+    }
+
+    /**
+     * start the deployment
+     * 
+     * @param serviceUnitName
+     * @throws DeploymentException
+     */
+    public void start(String serviceUnitName) throws DeploymentException {
+    }
+
+    /**
+     * stop the deployment
+     * 
+     * @param serviceUnitName
+     * @throws DeploymentException
+     */
+    public void stop(String serviceUnitName) throws DeploymentException {
+    }
+
+    /**
+     * Undeploy a Service Unit form the Component
+     * 
+     * @param serviceUnitName
+     * @param serviceUnitRootPath
+     * @return a status message
+     * @throws DeploymentException
+     */
+    public String undeploy(String serviceUnitName, String serviceUnitRootPath) throws DeploymentException {
+        return serviceUnitRootPath;
+    }
+}
\ No newline at end of file

Copied: trunk/core/src/main/java/org/servicemix/components/util/SpringBootstrap.java (from rev 682, trunk/core/src/main/java/org/servicemix/jbi/component/SpringBootstrap.java) (682 => 685)

--- trunk/core/src/main/java/org/servicemix/jbi/component/SpringBootstrap.java	2005-10-26 23:23:33 UTC (rev 682)
+++ trunk/core/src/main/java/org/servicemix/components/util/SpringBootstrap.java	2005-10-27 08:08:52 UTC (rev 685)
@@ -0,0 +1,73 @@
+/** 
+ * 
+ * Copyright 2005 LogicBlaze, Inc. http://www.logicblaze.com
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); 
+ * you may not use this file except in compliance with the License. 
+ * You may obtain a copy of the License at 
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License. 
+ * 
+ **/
+package org.servicemix.components.util;
+
+import org.servicemix.jbi.NotInitialisedYetException;
+import org.servicemix.jbi.container.ActivationSpec;
+import org.springframework.context.ApplicationContext;
+import org.w3c.dom.DocumentFragment;
+
+import javax.jbi.JBIException;
+import javax.jbi.component.Bootstrap;
+import javax.jbi.component.InstallationContext;
+import javax.management.ObjectName;
+
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * A Spring implementation of the [EMAIL PROTECTED] Bootstrap}
+ *
+ * @version $Revision$
+ */
+public class SpringBootstrap implements Bootstrap {
+    private InstallationContext installContext;
+    private ObjectName extensionMBeanName;
+    private ApplicationContext applicationContext;
+
+    public void init(InstallationContext installContext) throws JBIException {
+        this.installContext = installContext;
+    }
+
+    public void cleanUp() throws JBIException {
+    }
+
+    public ObjectName getExtensionMBeanName() {
+        return extensionMBeanName;
+    }
+
+    public void onInstall() throws JBIException {
+        if (installContext == null) {
+            throw new NotInitialisedYetException();
+        }
+        DocumentFragment fragment = installContext.getInstallationDescriptorExtension();
+
+        // lets load this from Spring...
+        Map map = applicationContext.getBeansOfType(ActivationSpec.class, false, false);
+        for (Iterator iter = map.values().iterator(); iter.hasNext(); ) {
+            ActivationSpec spec = (ActivationSpec) iter.next();
+        }
+    }
+
+    public void onUninstall() throws JBIException {
+    }
+
+    public InstallationContext getInstallContext() {
+        return installContext;
+    }
+}

Modified: trunk/core/src/main/java/org/servicemix/components/util/StreamWriterComponent.java (684 => 685)

--- trunk/core/src/main/java/org/servicemix/components/util/StreamWriterComponent.java	2005-10-27 08:06:36 UTC (rev 684)
+++ trunk/core/src/main/java/org/servicemix/components/util/StreamWriterComponent.java	2005-10-27 08:08:52 UTC (rev 685)
@@ -17,7 +17,6 @@
  **/
 package org.servicemix.components.util;
 
-import org.servicemix.jbi.binding.OutBinding;
 import org.servicemix.jbi.jaxp.SourceTransformer;
 import org.w3c.dom.Node;
 

Copied: trunk/core/src/main/java/org/servicemix/jbi/RuntimeJBIException.java (from rev 682, trunk/core/src/main/java/org/servicemix/jbi/binding/RuntimeJBIException.java) (682 => 685)

--- trunk/core/src/main/java/org/servicemix/jbi/binding/RuntimeJBIException.java	2005-10-26 23:23:33 UTC (rev 682)
+++ trunk/core/src/main/java/org/servicemix/jbi/RuntimeJBIException.java	2005-10-27 08:08:52 UTC (rev 685)
@@ -0,0 +1,37 @@
+/** 
+ * 
+ * Copyright 2005 Protique Ltd
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); 
+ * you may not use this file except in compliance with the License. 
+ * You may obtain a copy of the License at 
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License. 
+ * 
+ **/
+package org.servicemix.jbi;
+
+import javax.jbi.JBIException;
+
+/**
+ * A runtime exception caused by some error when
+ * interacting with the JBI container
+ *
+ * @version $Revision$
+ */
+public class RuntimeJBIException extends RuntimeException {
+    private static final long serialVersionUID = -6386553476156600457L;
+
+    /**
+     * @param cause
+     */
+    public RuntimeJBIException(JBIException cause) {
+        super(cause);
+    }
+}

Modified: trunk/core/src/test/java/org/servicemix/client/SimpleClientTest.java (684 => 685)

--- trunk/core/src/test/java/org/servicemix/client/SimpleClientTest.java	2005-10-27 08:06:36 UTC (rev 684)
+++ trunk/core/src/test/java/org/servicemix/client/SimpleClientTest.java	2005-10-27 08:08:52 UTC (rev 685)
@@ -18,7 +18,7 @@
  **/
 
 package org.servicemix.client;
-import org.servicemix.jbi.binding.OutBinding;
+import org.servicemix.components.util.OutBinding;
 import org.servicemix.jbi.container.ActivationSpec;
 import org.servicemix.jbi.container.JBIContainer;
 

Property changes: trunk/jbi

Name: svn:ignore
   - target
.classpath
.project
   + target
.classpath
.project
bin

Reply via email to