servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r582004 - in /incubator/servicemix/branches/servicemix-4.0: ./ jbi/ jbi/depoyer/ jbi/offline/ jbi/runtime/ jbi/runtime/src/ jbi/runtime/src/main/ jbi/runtime/src/main/java/ jbi/runtime/src/main/java/org/ jbi/runtime/src/main/java/org/apache...
Date Thu, 04 Oct 2007 20:41:39 GMT
Author: gnodet
Date: Thu Oct  4 13:41:38 2007
New Revision: 582004

URL: http://svn.apache.org/viewvc?rev=582004&view=rev
Log:
JBI 1.0 compatibility layer (runtime)

Added:
    incubator/servicemix/branches/servicemix-4.0/jbi/
    incubator/servicemix/branches/servicemix-4.0/jbi/depoyer/
    incubator/servicemix/branches/servicemix-4.0/jbi/offline/
    incubator/servicemix/branches/servicemix-4.0/jbi/pom.xml
    incubator/servicemix/branches/servicemix-4.0/jbi/runtime/
    incubator/servicemix/branches/servicemix-4.0/jbi/runtime/pom.xml
    incubator/servicemix/branches/servicemix-4.0/jbi/runtime/src/
    incubator/servicemix/branches/servicemix-4.0/jbi/runtime/src/main/
    incubator/servicemix/branches/servicemix-4.0/jbi/runtime/src/main/java/
    incubator/servicemix/branches/servicemix-4.0/jbi/runtime/src/main/java/org/
    incubator/servicemix/branches/servicemix-4.0/jbi/runtime/src/main/java/org/apache/
    incubator/servicemix/branches/servicemix-4.0/jbi/runtime/src/main/java/org/apache/servicemix/
    incubator/servicemix/branches/servicemix-4.0/jbi/runtime/src/main/java/org/apache/servicemix/jbi/
    incubator/servicemix/branches/servicemix-4.0/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/
    incubator/servicemix/branches/servicemix-4.0/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/ComponentRegistry.java
    incubator/servicemix/branches/servicemix-4.0/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/impl/
    incubator/servicemix/branches/servicemix-4.0/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/impl/ComponentContextImpl.java
    incubator/servicemix/branches/servicemix-4.0/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/impl/ComponentRegistryImpl.java
Modified:
    incubator/servicemix/branches/servicemix-4.0/pom.xml

Added: incubator/servicemix/branches/servicemix-4.0/jbi/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/servicemix-4.0/jbi/pom.xml?rev=582004&view=auto
==============================================================================
--- incubator/servicemix/branches/servicemix-4.0/jbi/pom.xml (added)
+++ incubator/servicemix/branches/servicemix-4.0/jbi/pom.xml Thu Oct  4 13:41:38 2007
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+<!--
+
+    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.
+-->
+
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.servicemix</groupId>
+    <artifactId>servicemix</artifactId>
+    <version>4.0-SNAPSHOT</version>
+  </parent>
+
+  <groupId>org.apache.servicemix</groupId>
+  <artifactId>jbi</artifactId>
+  <packaging>pom</packaging>
+  <version>4.0-SNAPSHOT</version>
+  <name>ServiceMix JBI</name>
+
+  <modules>
+    <module>runtime</module>
+  </modules>
+
+</project>

Added: incubator/servicemix/branches/servicemix-4.0/jbi/runtime/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/servicemix-4.0/jbi/runtime/pom.xml?rev=582004&view=auto
==============================================================================
--- incubator/servicemix/branches/servicemix-4.0/jbi/runtime/pom.xml (added)
+++ incubator/servicemix/branches/servicemix-4.0/jbi/runtime/pom.xml Thu Oct  4 13:41:38 2007
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+<!--
+
+    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.
+-->
+
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.servicemix</groupId>
+    <artifactId>jbi</artifactId>
+    <version>4.0-SNAPSHOT</version>
+  </parent>
+
+  <groupId>org.apache.servicemix.jbi</groupId>
+  <artifactId>org.apache.servicemix.jbi.runtime</artifactId>
+  <packaging>bundle</packaging>
+  <version>4.0-SNAPSHOT</version>
+  <name>ServiceMix JBI Runtime</name>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.servicemix</groupId>
+      <artifactId>org.apache.servicemix.core</artifactId>
+      <version>4.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.servicemix</groupId>
+      <artifactId>servicemix-jbi</artifactId>
+      <version>3.1.2</version>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <configuration>
+          <instructions>
+            <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
+            <Export-Package>${pom.artifactId}</Export-Package>
+            <DynamicImport-Package>*</DynamicImport-Package>
+          </instructions>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>

Added: incubator/servicemix/branches/servicemix-4.0/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/ComponentRegistry.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/servicemix-4.0/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/ComponentRegistry.java?rev=582004&view=auto
==============================================================================
--- incubator/servicemix/branches/servicemix-4.0/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/ComponentRegistry.java
(added)
+++ incubator/servicemix/branches/servicemix-4.0/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/ComponentRegistry.java
Thu Oct  4 13:41:38 2007
@@ -0,0 +1,25 @@
+/*
+ * 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.jbi.runtime;
+
+import org.apache.servicemix.api.service.ServiceRegistry;
+
+import javax.jbi.component.Component;
+
+public interface ComponentRegistry extends ServiceRegistry<Component>  {
+
+}
\ No newline at end of file

Added: incubator/servicemix/branches/servicemix-4.0/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/impl/ComponentContextImpl.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/servicemix-4.0/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/impl/ComponentContextImpl.java?rev=582004&view=auto
==============================================================================
--- incubator/servicemix/branches/servicemix-4.0/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/impl/ComponentContextImpl.java
(added)
+++ incubator/servicemix/branches/servicemix-4.0/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/impl/ComponentContextImpl.java
Thu Oct  4 13:41:38 2007
@@ -0,0 +1,135 @@
+/*
+ * 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.jbi.runtime.impl;
+
+import org.apache.servicemix.api.NMR;
+import org.w3c.dom.DocumentFragment;
+import org.w3c.dom.Document;
+
+import javax.jbi.component.ComponentContext;
+import javax.jbi.component.Component;
+import javax.jbi.servicedesc.ServiceEndpoint;
+import javax.jbi.JBIException;
+import javax.jbi.management.MBeanNames;
+import javax.jbi.messaging.DeliveryChannel;
+import javax.jbi.messaging.MessagingException;
+import javax.xml.namespace.QName;
+import javax.management.MBeanServer;
+import javax.naming.InitialContext;
+import java.util.Map;
+import java.util.MissingResourceException;
+import java.util.logging.Logger;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: gnodet
+ * Date: Oct 4, 2007
+ * Time: 10:36:40 PM
+ * To change this template use File | Settings | File Templates.
+ */
+public class ComponentContextImpl implements ComponentContext {
+
+    private NMR nmr;
+    private Component component;
+    private Map<String,?> properties;
+
+    public ComponentContextImpl(NMR nmr, Component component, Map<String,?> properties)
{
+        this.nmr = nmr;
+        this.component = component;
+        this.properties = properties;
+    }
+
+    public ServiceEndpoint activateEndpoint(QName serviceName, String endpointName) throws
JBIException {
+        return null;  //To change body of implemented methods use File | Settings | File
Templates.
+    }
+
+    public void deactivateEndpoint(ServiceEndpoint endpoint) throws JBIException {
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public void registerExternalEndpoint(ServiceEndpoint externalEndpoint) throws JBIException
{
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public void deregisterExternalEndpoint(ServiceEndpoint externalEndpoint) throws JBIException
{
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public ServiceEndpoint resolveEndpointReference(DocumentFragment epr) {
+        return null;  //To change body of implemented methods use File | Settings | File
Templates.
+    }
+
+    public String getComponentName() {
+        return null;  //To change body of implemented methods use File | Settings | File
Templates.
+    }
+
+    public DeliveryChannel getDeliveryChannel() throws MessagingException {
+        return null;  //To change body of implemented methods use File | Settings | File
Templates.
+    }
+
+    public ServiceEndpoint getEndpoint(QName service, String name) {
+        return null;  //To change body of implemented methods use File | Settings | File
Templates.
+    }
+
+    public Document getEndpointDescriptor(ServiceEndpoint endpoint) throws JBIException {
+        return null;  //To change body of implemented methods use File | Settings | File
Templates.
+    }
+
+    public ServiceEndpoint[] getEndpoints(QName interfaceName) {
+        return new ServiceEndpoint[0];  //To change body of implemented methods use File
| Settings | File Templates.
+    }
+
+    public ServiceEndpoint[] getEndpointsForService(QName serviceName) {
+        return new ServiceEndpoint[0];  //To change body of implemented methods use File
| Settings | File Templates.
+    }
+
+    public ServiceEndpoint[] getExternalEndpoints(QName interfaceName) {
+        return new ServiceEndpoint[0];  //To change body of implemented methods use File
| Settings | File Templates.
+    }
+
+    public ServiceEndpoint[] getExternalEndpointsForService(QName serviceName) {
+        return new ServiceEndpoint[0];  //To change body of implemented methods use File
| Settings | File Templates.
+    }
+
+    public String getInstallRoot() {
+        return null;  //To change body of implemented methods use File | Settings | File
Templates.
+    }
+
+    public Logger getLogger(String suffix, String resourceBundleName) throws MissingResourceException,
JBIException {
+        return null;  //To change body of implemented methods use File | Settings | File
Templates.
+    }
+
+    public MBeanNames getMBeanNames() {
+        return null;  //To change body of implemented methods use File | Settings | File
Templates.
+    }
+
+    public MBeanServer getMBeanServer() {
+        return null;  //To change body of implemented methods use File | Settings | File
Templates.
+    }
+
+    public InitialContext getNamingContext() {
+        return null;  //To change body of implemented methods use File | Settings | File
Templates.
+    }
+
+    public Object getTransactionManager() {
+        return null;  //To change body of implemented methods use File | Settings | File
Templates.
+    }
+
+    public String getWorkspaceRoot() {
+        return null;  //To change body of implemented methods use File | Settings | File
Templates.
+    }
+}

Added: incubator/servicemix/branches/servicemix-4.0/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/impl/ComponentRegistryImpl.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/servicemix-4.0/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/impl/ComponentRegistryImpl.java?rev=582004&view=auto
==============================================================================
--- incubator/servicemix/branches/servicemix-4.0/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/impl/ComponentRegistryImpl.java
(added)
+++ incubator/servicemix/branches/servicemix-4.0/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/impl/ComponentRegistryImpl.java
Thu Oct  4 13:41:38 2007
@@ -0,0 +1,70 @@
+/*
+ * 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.jbi.runtime.impl;
+
+import org.apache.servicemix.api.NMR;
+import org.apache.servicemix.api.ServiceMixException;
+import org.apache.servicemix.core.ServiceRegistryImpl;
+import org.apache.servicemix.jbi.runtime.ComponentRegistry;
+
+import javax.jbi.JBIException;
+import javax.jbi.component.Component;
+import javax.jbi.component.ComponentContext;
+import java.util.Map;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: gnodet
+ * Date: Oct 4, 2007
+ * Time: 10:30:30 PM
+ * To change this template use File | Settings | File Templates.
+ */
+public class ComponentRegistryImpl extends ServiceRegistryImpl<Component>  implements
ComponentRegistry {
+
+    private NMR nmr;
+
+    /**
+     * Register a service with the given metadata.
+     *
+     * @param component the component to register
+     * @param properties the associated metadata
+     */
+    public void register(Component component, Map<String, ?> properties) {
+        try {
+            ComponentContext context = new ComponentContextImpl(nmr, component, properties);
+            component.getLifeCycle().init(context);
+            component.getLifeCycle().start();
+        } catch (JBIException e) {
+            throw new ServiceMixException(e);
+        }
+    }
+
+    /**
+     * Unregister a previously registered component.
+     *
+     * @param component the component to unregister
+     */
+    public void unregister(Component component, Map<String, ?> properties) {
+        try {
+            component.getLifeCycle().stop();
+            component.getLifeCycle().shutDown();
+        } catch (JBIException e) {
+            throw new ServiceMixException(e);
+        }
+    }
+
+}

Modified: incubator/servicemix/branches/servicemix-4.0/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/servicemix-4.0/pom.xml?rev=582004&r1=582003&r2=582004&view=diff
==============================================================================
--- incubator/servicemix/branches/servicemix-4.0/pom.xml (original)
+++ incubator/servicemix/branches/servicemix-4.0/pom.xml Thu Oct  4 13:41:38 2007
@@ -34,6 +34,7 @@
 	<module>nmr</module>
 	<module>camel</module>
 	<module>bundles</module>
+	<module>jbi</module>
 	<module>examples</module>
 	<module>itests</module>
 	<module>main</module>



Mime
View raw message