You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2008/04/24 09:18:50 UTC

svn commit: r651178 - in /servicemix/smx4/nmr/trunk/jbi: deployer/ deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/ osgi/src/main/resources/META-INF/spring/ runtime/src/main/java/org/apache/servicemix/jbi/runtime/ runtime/src/main/java/o...

Author: gnodet
Date: Thu Apr 24 00:18:48 2008
New Revision: 651178

URL: http://svn.apache.org/viewvc?rev=651178&view=rev
Log:
SMX4NMR-28: Ability for a JBI component to register itself in the registry, bypassing the JBI packaging

Added:
    servicemix/smx4/nmr/trunk/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/ComponentWrapper.java
    servicemix/smx4/nmr/trunk/jbi/runtime/src/test/java/org/apache/servicemix/jbi/runtime/SimpleComponentWrapper.java
Modified:
    servicemix/smx4/nmr/trunk/jbi/deployer/pom.xml
    servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/ComponentImpl.java
    servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/Deployer.java
    servicemix/smx4/nmr/trunk/jbi/osgi/src/main/resources/META-INF/spring/servicemix-jbi.xml
    servicemix/smx4/nmr/trunk/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/ComponentRegistry.java
    servicemix/smx4/nmr/trunk/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/impl/ComponentContextImpl.java
    servicemix/smx4/nmr/trunk/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/impl/ComponentRegistryImpl.java
    servicemix/smx4/nmr/trunk/jbi/runtime/src/test/java/org/apache/servicemix/jbi/runtime/IntegrationTest.java
    servicemix/smx4/nmr/trunk/jbi/runtime/src/test/java/org/apache/servicemix/jbi/runtime/MEPExchangeTest.java

Modified: servicemix/smx4/nmr/trunk/jbi/deployer/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/deployer/pom.xml?rev=651178&r1=651177&r2=651178&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/deployer/pom.xml (original)
+++ servicemix/smx4/nmr/trunk/jbi/deployer/pom.xml Thu Apr 24 00:18:48 2008
@@ -36,7 +36,12 @@
         <dependency>
             <groupId>org.apache.servicemix.jbi</groupId>
             <artifactId>org.apache.servicemix.jbi.api</artifactId>
-	        <version>1.0-m2-SNAPSHOT</version>
+            <version>1.0-m2-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.jbi</groupId>
+            <artifactId>org.apache.servicemix.jbi.runtime</artifactId>
+            <version>1.0-m2-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.apache.servicemix.kernel</groupId>

Modified: servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/ComponentImpl.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/ComponentImpl.java?rev=651178&r1=651177&r2=651178&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/ComponentImpl.java (original)
+++ servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/ComponentImpl.java Thu Apr 24 00:18:48 2008
@@ -38,12 +38,13 @@
 import org.apache.servicemix.jbi.deployer.Component;
 import org.apache.servicemix.jbi.deployer.ServiceUnit;
 import org.apache.servicemix.jbi.deployer.descriptor.ComponentDesc;
+import org.apache.servicemix.jbi.runtime.ComponentWrapper;
 import org.osgi.service.prefs.BackingStoreException;
 import org.osgi.service.prefs.Preferences;
 
 /**
  */
-public class ComponentImpl implements Component {
+public class ComponentImpl implements Component, ComponentWrapper {
 
     private static final Log LOGGER = LogFactory.getLog(ComponentImpl.class);
 

Modified: servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/Deployer.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/Deployer.java?rev=651178&r1=651177&r2=651178&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/Deployer.java (original)
+++ servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/Deployer.java Thu Apr 24 00:18:48 2008
@@ -28,6 +28,7 @@
 import java.util.Hashtable;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 
 import javax.jbi.JBIException;
@@ -46,12 +47,16 @@
 import org.apache.servicemix.jbi.deployer.descriptor.ServiceUnitDesc;
 import org.apache.servicemix.jbi.deployer.descriptor.SharedLibraryDesc;
 import org.apache.servicemix.jbi.deployer.descriptor.SharedLibraryList;
+import org.apache.servicemix.jbi.deployer.descriptor.Identification;
+import org.apache.servicemix.jbi.runtime.ComponentWrapper;
 import org.apache.xbean.classloader.MultiParentClassLoader;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
+import org.osgi.framework.ServiceReference;
 import org.osgi.service.prefs.Preferences;
 import org.osgi.service.prefs.PreferencesService;
+import org.osgi.util.tracker.ServiceTracker;
 import org.springframework.osgi.util.BundleDelegatingClassLoader;
 import org.springframework.osgi.util.OsgiStringUtils;
 
@@ -74,6 +79,8 @@
 
     private Map<String, ComponentImpl> components;
 
+    private Map<String, Boolean> wrappedComponents;
+
     private Map<Bundle, List<ServiceRegistration>> services;
 
     private List<Bundle> pendingBundles;
@@ -84,10 +91,13 @@
 
     private boolean autoStart = true;
 
+    private ServiceTracker tracker;
+
     public Deployer() throws JBIException{
         sharedLibraries = new ConcurrentHashMap<String, SharedLibraryImpl>();
         serviceAssemblies = new ConcurrentHashMap<String, ServiceAssemblyImpl>();
         components = new ConcurrentHashMap<String, ComponentImpl>();
+        wrappedComponents = new ConcurrentHashMap<String, Boolean>();
         services = new ConcurrentHashMap<Bundle, List<ServiceRegistration>>();
         pendingBundles = new ArrayList<Bundle>();
         // TODO: control that using properties
@@ -112,6 +122,30 @@
     }
 
     @Override
+    public void afterPropertiesSet() throws Exception {
+        super.afterPropertiesSet();
+        tracker = new ServiceTracker(getBundleContext(), javax.jbi.component.Component.class.getName(), null) {
+            public Object addingService(ServiceReference serviceReference) {
+                Object o = super.addingService(serviceReference);
+                maybeWrapComponent(serviceReference, (javax.jbi.component.Component) o);
+                return o;
+            }
+
+            public void removedService(ServiceReference serviceReference, Object o) {
+                maybeUnwrapComponent(serviceReference, (javax.jbi.component.Component) o);
+                super.removedService(serviceReference, o);
+            }
+        };
+        tracker.open();
+    }
+
+    @Override
+    public void destroy() throws Exception {
+        tracker.close();
+        super.destroy();
+    }
+
+    @Override
     protected boolean match(Bundle bundle) {
         LOGGER.debug("Checking bundle: '" + OsgiStringUtils.nullSafeNameAndSymName(bundle) + "'");
         URL url = bundle.getResource(JBI_DESCRIPTOR);
@@ -209,7 +243,8 @@
         // register the component in the OSGi registry
         LOGGER.debug("Registering JBI component");
         registerService(bundle, Component.class.getName(), component, props);
-        registerService(bundle, javax.jbi.component.Component.class.getName(), component.getComponent(), props);
+        registerService(bundle, ComponentWrapper.class.getName(), component, props);
+        registerService(bundle, javax.jbi.component.Component.class.getName(), innerComponent, props);
     }
 
     private void extractBundle(File installRoot, Bundle bundle, String path) throws IOException {
@@ -344,7 +379,35 @@
             }
         }
     }
+
     protected void uninstallSharedLibrary(SharedLibraryDesc sharedLibraryDesc, Bundle bundle) throws JBIException {
+    }
+
+    protected void maybeWrapComponent(ServiceReference reference, javax.jbi.component.Component component) {
+        String name = (String) reference.getProperty(NAME);
+        if (name != null && !components.containsKey(name)) {
+            String type = (String) reference.getProperty(TYPE);
+            Preferences prefs = preferencesService.getUserPreferences(name);
+            ComponentDesc componentDesc = new ComponentDesc();
+            componentDesc.setIdentification(new Identification());
+            componentDesc.getIdentification().setName(name);
+            componentDesc.setType(type);
+            ComponentImpl wrapper = new ComponentImpl(componentDesc, component, prefs, autoStart, this);
+            wrappedComponents.put(name, true);
+            components.put(name, wrapper);
+            Dictionary<String, String> props = new Hashtable<String, String>();
+            props.put(NAME, name);
+            props.put(TYPE, componentDesc.getType());
+            registerService(reference.getBundle(), Component.class.getName(), wrapper, props);
+            registerService(reference.getBundle(), ComponentWrapper.class.getName(), wrapper, props);
+        }
+    }
+
+    protected void maybeUnwrapComponent(ServiceReference reference, javax.jbi.component.Component component) {
+        String name = (String) reference.getProperty(NAME);
+        if (name != null && wrappedComponents.remove(name)) {
+            components.remove(name);
+        }
     }
 
     protected void checkPendingBundles() {

Modified: servicemix/smx4/nmr/trunk/jbi/osgi/src/main/resources/META-INF/spring/servicemix-jbi.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/osgi/src/main/resources/META-INF/spring/servicemix-jbi.xml?rev=651178&r1=651177&r2=651178&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/osgi/src/main/resources/META-INF/spring/servicemix-jbi.xml (original)
+++ servicemix/smx4/nmr/trunk/jbi/osgi/src/main/resources/META-INF/spring/servicemix-jbi.xml Thu Apr 24 00:18:48 2008
@@ -60,7 +60,7 @@
 
     <!-- Service tracker for JBI components -->
     <osgi:list id="components"
-               interface="javax.jbi.component.Component"
+               interface="org.apache.servicemix.jbi.runtime.ComponentWrapper"
                cardinality="0..N">
         <osgi:listener ref="componentRegistry" bind-method="register" unbind-method="unregister" />
     </osgi:list>

Modified: servicemix/smx4/nmr/trunk/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/ComponentRegistry.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/ComponentRegistry.java?rev=651178&r1=651177&r2=651178&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/ComponentRegistry.java (original)
+++ servicemix/smx4/nmr/trunk/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/ComponentRegistry.java Thu Apr 24 00:18:48 2008
@@ -26,7 +26,7 @@
  * This registry will usually be populated by an OSGi service listener
  * configured via spring-osgi.
  */
-public interface ComponentRegistry extends ServiceRegistry<Component>  {
+public interface ComponentRegistry extends ServiceRegistry<ComponentWrapper>  {
 
     public static final String NAME = "NAME";
     public static final String TYPE = "TYPE";
@@ -36,6 +36,6 @@
      * @param name the name of the component
      * @return the component, or null if not registered
      */
-    Component getComponent(String name);
+    ComponentWrapper getComponent(String name);
 
 }

Added: servicemix/smx4/nmr/trunk/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/ComponentWrapper.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/ComponentWrapper.java?rev=651178&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/ComponentWrapper.java (added)
+++ servicemix/smx4/nmr/trunk/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/ComponentWrapper.java Thu Apr 24 00:18:48 2008
@@ -0,0 +1,30 @@
+/*
+ * 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 javax.jbi.component.Component;
+
+/**
+ * ComponentWrapper is a simple interface holding a JBI component.
+ * This is used instead of managing directly the component because
+ * there is a need to wrap it to maintain and manage its state.
+ */
+public interface ComponentWrapper {
+
+    Component getComponent();
+
+}

Modified: servicemix/smx4/nmr/trunk/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/impl/ComponentContextImpl.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/impl/ComponentContextImpl.java?rev=651178&r1=651177&r2=651178&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/impl/ComponentContextImpl.java (original)
+++ servicemix/smx4/nmr/trunk/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/impl/ComponentContextImpl.java Thu Apr 24 00:18:48 2008
@@ -53,6 +53,7 @@
 import org.apache.servicemix.jbi.runtime.ComponentRegistry;
 import org.apache.servicemix.jbi.runtime.DocumentRepository;
 import org.apache.servicemix.jbi.runtime.Environment;
+import org.apache.servicemix.jbi.runtime.ComponentWrapper;
 import org.apache.servicemix.jbi.runtime.impl.utils.DOMUtil;
 import org.apache.servicemix.jbi.runtime.impl.utils.URIResolver;
 import org.apache.servicemix.jbi.runtime.impl.utils.WSAddressingConstants;
@@ -78,7 +79,7 @@
     private NMR nmr;
     private ComponentRegistryImpl componentRegistry;
     private DocumentRepository documentRepository;
-    private Component component;
+    private ComponentWrapper component;
     private Map<String,?> properties;
     private BlockingQueue<Exchange> queue;
     private DeliveryChannel dc;
@@ -92,7 +93,7 @@
     public ComponentContextImpl(ComponentRegistryImpl componentRegistry,
                                 Environment environment,
                                 ManagementContext managementContext,
-                                Component component,
+                                ComponentWrapper component,
                                 Map<String,?> properties) {
         this.componentRegistry = componentRegistry;
         this.environment = environment;
@@ -127,7 +128,7 @@
             props.put(Endpoint.NAME, serviceName.toString() + ":" + endpointName);
             props.put(Endpoint.SERVICE_NAME, serviceName);
             props.put(Endpoint.ENDPOINT_NAME, endpointName);
-            Document doc = component.getServiceDescription(endpoint);
+            Document doc = component.getComponent().getServiceDescription(endpoint);
             if (doc != null) {
                 String data = DOMUtil.asXML(doc);
                 String url = documentRepository.register(data.getBytes());
@@ -161,8 +162,8 @@
     }
 
     public ServiceEndpoint resolveEndpointReference(DocumentFragment epr) {
-        for (Component component : componentRegistry.getServices()) {
-            ServiceEndpoint se = component.resolveEndpointReference(epr);
+        for (ComponentWrapper component : componentRegistry.getServices()) {
+            ServiceEndpoint se = component.getComponent().resolveEndpointReference(epr);
             if (se != null) {
                 return se;
             }
@@ -435,7 +436,7 @@
         return null;
     }
 
-    public Component getComponent() {
+    public ComponentWrapper getComponent() {
         return component;
     }
 

Modified: servicemix/smx4/nmr/trunk/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/impl/ComponentRegistryImpl.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/impl/ComponentRegistryImpl.java?rev=651178&r1=651177&r2=651178&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/impl/ComponentRegistryImpl.java (original)
+++ servicemix/smx4/nmr/trunk/jbi/runtime/src/main/java/org/apache/servicemix/jbi/runtime/impl/ComponentRegistryImpl.java Thu Apr 24 00:18:48 2008
@@ -29,13 +29,14 @@
 import org.apache.servicemix.jbi.runtime.ComponentRegistry;
 import org.apache.servicemix.jbi.runtime.DocumentRepository;
 import org.apache.servicemix.jbi.runtime.Environment;
+import org.apache.servicemix.jbi.runtime.ComponentWrapper;
 import org.apache.servicemix.nmr.api.NMR;
 import org.apache.servicemix.nmr.core.ServiceRegistryImpl;
 
 /**
  * Registry of JBI components objects
  */
-public class ComponentRegistryImpl extends ServiceRegistryImpl<Component>  implements ComponentRegistry {
+public class ComponentRegistryImpl extends ServiceRegistryImpl<ComponentWrapper>  implements ComponentRegistry {
 
     private static final Log LOGGER = LogFactory.getLog(ComponentRegistryImpl.class);
 
@@ -88,14 +89,14 @@
      * @param properties the associated metadata
      */
     @Override
-    protected void doRegister(Component component, Map<String, ?> properties) throws JBIException {
+    protected void doRegister(ComponentWrapper component, Map<String, ?> properties) throws JBIException {
         LOGGER.info("JBI component registered with properties: " + properties);
         ClassLoader cl = Thread.currentThread().getContextClassLoader();
         Thread.currentThread().setContextClassLoader(component.getClass().getClassLoader());
         try {
             String name = (String) properties.get(NAME);
             ComponentContextImpl context = new ComponentContextImpl(this, environment, managementContext, component, properties);
-            component.getLifeCycle().init(context);
+            component.getComponent().getLifeCycle().init(context);
             if (name != null) {
                 contexts.put(name, context);
             } else {
@@ -112,7 +113,7 @@
      * @param component the component to unregister
      */
     @Override
-    protected void doUnregister(Component component, Map<String, ?> properties)throws JBIException {
+    protected void doUnregister(ComponentWrapper component, Map<String, ?> properties)throws JBIException {
         LOGGER.info("JBI component unregistered with properties: " + properties);
         String name = properties != null ? (String) properties.get(NAME) : null;
         if (name != null) {
@@ -121,7 +122,7 @@
         }
     }
 
-    public Component getComponent(String name) {
+    public ComponentWrapper getComponent(String name) {
         return contexts.get(name).getComponent();
     }
 

Modified: servicemix/smx4/nmr/trunk/jbi/runtime/src/test/java/org/apache/servicemix/jbi/runtime/IntegrationTest.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/runtime/src/test/java/org/apache/servicemix/jbi/runtime/IntegrationTest.java?rev=651178&r1=651177&r2=651178&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/runtime/src/test/java/org/apache/servicemix/jbi/runtime/IntegrationTest.java (original)
+++ servicemix/smx4/nmr/trunk/jbi/runtime/src/test/java/org/apache/servicemix/jbi/runtime/IntegrationTest.java Thu Apr 24 00:18:48 2008
@@ -18,7 +18,6 @@
 
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Properties;
 
 import javax.xml.namespace.QName;
 
@@ -76,7 +75,7 @@
         ep.setTarget(new ExchangeTarget());
         ep.getTarget().setService(new QName("target"));
         eip.setEndpoints(new EIPEndpoint[] { ep });
-        eip.init(new ComponentContextImpl(reg, null, null, eip, new HashMap()));
+        eip.init(new ComponentContextImpl(reg, null, null, new SimpleComponentWrapper(eip), new HashMap()));
         eip.getLifeCycle().start();
 
         Channel channel = smx.createChannel();
@@ -85,4 +84,5 @@
         e.setTarget(smx.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME, "{uri:foo}bar:ep")));
         channel.sendSync(e);
     }
+
 }

Modified: servicemix/smx4/nmr/trunk/jbi/runtime/src/test/java/org/apache/servicemix/jbi/runtime/MEPExchangeTest.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/runtime/src/test/java/org/apache/servicemix/jbi/runtime/MEPExchangeTest.java?rev=651178&r1=651177&r2=651178&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/runtime/src/test/java/org/apache/servicemix/jbi/runtime/MEPExchangeTest.java (original)
+++ servicemix/smx4/nmr/trunk/jbi/runtime/src/test/java/org/apache/servicemix/jbi/runtime/MEPExchangeTest.java Thu Apr 24 00:18:48 2008
@@ -75,8 +75,8 @@
         provider = new TestComponent(new QName("provider"), "endpoint");
         consumer = new TestComponent(new QName("consumer"), "endpoint");
         // Register components
-        reg.register(provider, ServiceHelper.createMap(ComponentRegistry.NAME, "provider"));
-        reg.register(consumer, ServiceHelper.createMap(ComponentRegistry.NAME, "consumer"));
+        reg.register(new SimpleComponentWrapper(provider), ServiceHelper.createMap(ComponentRegistry.NAME, "provider"));
+        reg.register(new SimpleComponentWrapper(consumer), ServiceHelper.createMap(ComponentRegistry.NAME, "consumer"));
     }
 
     public void tearDown() throws Exception {

Added: servicemix/smx4/nmr/trunk/jbi/runtime/src/test/java/org/apache/servicemix/jbi/runtime/SimpleComponentWrapper.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/runtime/src/test/java/org/apache/servicemix/jbi/runtime/SimpleComponentWrapper.java?rev=651178&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/runtime/src/test/java/org/apache/servicemix/jbi/runtime/SimpleComponentWrapper.java (added)
+++ servicemix/smx4/nmr/trunk/jbi/runtime/src/test/java/org/apache/servicemix/jbi/runtime/SimpleComponentWrapper.java Thu Apr 24 00:18:48 2008
@@ -0,0 +1,32 @@
+/*
+ * 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 javax.jbi.component.Component;
+
+public class SimpleComponentWrapper implements ComponentWrapper {
+
+    private Component component;
+
+    public SimpleComponentWrapper(Component component) {
+        this.component = component;
+    }
+
+    public Component getComponent() {
+        return component;
+    }
+}