servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pdo...@apache.org
Subject svn commit: r429888 - in /incubator/servicemix/trunk/servicemix-jms: pom.xml src/main/java/org/apache/servicemix/jms/packaging/ src/main/java/org/apache/servicemix/jms/packaging/JmsServiceUnitAnalyzer.java
Date Tue, 08 Aug 2006 23:43:42 GMT
Author: pdodds
Date: Tue Aug  8 16:43:42 2006
New Revision: 429888

URL: http://svn.apache.org/viewvc?rev=429888&view=rev
Log:
Added service unit analyzer to the JMS engine as part of the new tooling

Added:
    incubator/servicemix/trunk/servicemix-jms/src/main/java/org/apache/servicemix/jms/packaging/
    incubator/servicemix/trunk/servicemix-jms/src/main/java/org/apache/servicemix/jms/packaging/JmsServiceUnitAnalyzer.java
Modified:
    incubator/servicemix/trunk/servicemix-jms/pom.xml

Modified: incubator/servicemix/trunk/servicemix-jms/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-jms/pom.xml?rev=429888&r1=429887&r2=429888&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-jms/pom.xml (original)
+++ incubator/servicemix/trunk/servicemix-jms/pom.xml Tue Aug  8 16:43:42 2006
@@ -81,6 +81,7 @@
           <type>binding-component</type>
           <bootstrap>org.apache.servicemix.jms.JmsBootstrap</bootstrap>
           <component>org.apache.servicemix.jms.JmsComponent</component>
+          <serviceUnitAnalyzer>org.apache.servicemix.jms.packaging.JmsServiceUnitAnalyzer</serviceUnitAnalyzer>
         </configuration>
       </plugin>
       <plugin>

Added: incubator/servicemix/trunk/servicemix-jms/src/main/java/org/apache/servicemix/jms/packaging/JmsServiceUnitAnalyzer.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-jms/src/main/java/org/apache/servicemix/jms/packaging/JmsServiceUnitAnalyzer.java?rev=429888&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-jms/src/main/java/org/apache/servicemix/jms/packaging/JmsServiceUnitAnalyzer.java
(added)
+++ incubator/servicemix/trunk/servicemix-jms/src/main/java/org/apache/servicemix/jms/packaging/JmsServiceUnitAnalyzer.java
Tue Aug  8 16:43:42 2006
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.servicemix.jms.packaging;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.jbi.messaging.MessageExchange;
+
+import org.apache.servicemix.common.Endpoint;
+import org.apache.servicemix.common.packaging.Consumes;
+import org.apache.servicemix.common.xbean.AbstractXBeanServiceUnitAnalyzer;
+import org.apache.servicemix.jms.JmsEndpoint;
+
+public class JmsServiceUnitAnalyzer extends AbstractXBeanServiceUnitAnalyzer {
+
+	protected List getConsumes(Endpoint endpoint) {
+		List consumesList = new ArrayList();
+		Consumes consumes;
+		if (endpoint.getRole().equals(MessageExchange.Role.CONSUMER)) {
+			consumes = new Consumes();
+			JmsEndpoint httpEndpoint = (JmsEndpoint) endpoint;
+			consumes.setEndpointName(httpEndpoint.getTargetEndpoint());
+			consumes.setInterfaceName(httpEndpoint.getTargetInterfaceName());
+			consumes.setServiceName(httpEndpoint.getTargetService());
+			if (consumes.isValid())
+				consumesList.add(consumes);
+			else {
+				consumes = new Consumes();
+				consumes.setEndpointName(endpoint.getEndpoint());
+				consumes.setInterfaceName(endpoint.getInterfaceName());
+				consumes.setServiceName(endpoint.getService());
+				consumesList.add(consumes);
+			}
+		}		
+
+		return consumesList;
+	}
+
+	protected String getXBeanFile() {
+		return "xbean.xml";
+	}
+
+	protected boolean isValidEndpoint(Object bean) {
+		return (bean instanceof JmsEndpoint);
+	}
+
+}



Mime
View raw message