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 2009/09/07 18:10:15 UTC

svn commit: r812215 [3/4] - in /servicemix/smx4/nmr/trunk: ./ assembly/ assembly/src/main/descriptors/ assembly/src/main/filtered-resources/ assembly/src/main/filtered-resources/etc/ branding/ document/ examples/interceptors/endpoint/ examples/intercep...

Modified: servicemix/smx4/nmr/trunk/nmr/commands/src/main/java/org/apache/servicemix/nmr/commands/ListCommand.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/nmr/commands/src/main/java/org/apache/servicemix/nmr/commands/ListCommand.java?rev=812215&r1=812214&r2=812215&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/nmr/commands/src/main/java/org/apache/servicemix/nmr/commands/ListCommand.java (original)
+++ servicemix/smx4/nmr/trunk/nmr/commands/src/main/java/org/apache/servicemix/nmr/commands/ListCommand.java Mon Sep  7 16:10:11 2009
@@ -17,24 +17,26 @@
 package org.apache.servicemix.nmr.commands;
 
 import org.apache.servicemix.nmr.api.Endpoint;
+import org.apache.felix.gogo.commands.Command;
 import org.osgi.framework.ServiceReference;
 
 /**
  * Displays the name of existing NMR endpoints
  */
+@Command(scope = "nmr", name = "list", description = "List NMR endpoints")
 public class ListCommand extends NmrCommandSupport {
 
     protected Object doExecute() throws Exception {
-        io.out.println("Endpoints");
-        io.out.println("---------");
+        System.out.println("Endpoints");
+        System.out.println("---------");
         ServiceReference[] references = getBundleContext().getAllServiceReferences(Endpoint.class.getName(), null);
         if (references != null) {
             for (ServiceReference ref : references) {
                 String name = (String) ref.getProperty(Endpoint.NAME);
-                io.out.println(name);
+                System.out.println(name);
             }
         }
-        io.out.println();
+        System.out.println();
         return null;
     }
 }

Modified: servicemix/smx4/nmr/trunk/nmr/commands/src/main/java/org/apache/servicemix/nmr/commands/NmrCommandSupport.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/nmr/commands/src/main/java/org/apache/servicemix/nmr/commands/NmrCommandSupport.java?rev=812215&r1=812214&r2=812215&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/nmr/commands/src/main/java/org/apache/servicemix/nmr/commands/NmrCommandSupport.java (original)
+++ servicemix/smx4/nmr/trunk/nmr/commands/src/main/java/org/apache/servicemix/nmr/commands/NmrCommandSupport.java Mon Sep  7 16:10:11 2009
@@ -18,7 +18,7 @@
 
 import java.util.List;
 import org.apache.servicemix.nmr.api.Endpoint;
-import org.apache.servicemix.kernel.gshell.core.OsgiCommandSupport;
+import org.apache.felix.karaf.gshell.console.OsgiCommandSupport;
 
 /**
  * Base class for NMR related commands

Added: servicemix/smx4/nmr/trunk/nmr/commands/src/main/resources/OSGI-INF/blueprint/servicemix-nmr-commands.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/nmr/commands/src/main/resources/OSGI-INF/blueprint/servicemix-nmr-commands.xml?rev=812215&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/nmr/commands/src/main/resources/OSGI-INF/blueprint/servicemix-nmr-commands.xml (added)
+++ servicemix/smx4/nmr/trunk/nmr/commands/src/main/resources/OSGI-INF/blueprint/servicemix-nmr-commands.xml Mon Sep  7 16:10:11 2009
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+
+    <command-bundle xmlns="http://felix.apache.org/karaf/xmlns/gshell/v1.0.0">
+        <command name="nmr/list">
+            <action class="org.apache.servicemix.nmr.commands.ListCommand"/>
+        </command>
+    </command-bundle>
+
+</blueprint>

Modified: servicemix/smx4/nmr/trunk/nmr/core/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/nmr/core/pom.xml?rev=812215&r1=812214&r2=812215&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/nmr/core/pom.xml (original)
+++ servicemix/smx4/nmr/trunk/nmr/core/pom.xml Mon Sep  7 16:10:11 2009
@@ -33,6 +33,17 @@
 
     <dependencies>
         <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.framework</artifactId>
+            <version>${felix.framework.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.felix</groupId>
+                    <artifactId>org.osgi.compendium</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
             <groupId>org.apache.servicemix.nmr</groupId>
             <artifactId>org.apache.servicemix.nmr.api</artifactId>
         </dependency>
@@ -52,8 +63,8 @@
         <!-- Put this dependency before the following one to avoid a classloader problem
              when running junit tests -->
         <dependency>
-            <groupId>org.apache.servicemix.kernel</groupId>
-            <artifactId>org.apache.servicemix.kernel.main</artifactId>
+            <groupId>org.apache.felix.karaf</groupId>
+            <artifactId>org.apache.felix.karaf.main</artifactId>
             <scope>test</scope>
         </dependency>
         <dependency>
@@ -72,6 +83,11 @@
             <artifactId>easymock</artifactId>
             <scope>test</scope>
         </dependency>
+
+        <dependency>
+            <groupId>org.springframework.osgi</groupId>
+            <artifactId>spring-osgi-test</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.fusesource.commonman</groupId>
             <artifactId>commons-management</artifactId>

Modified: servicemix/smx4/nmr/trunk/nmr/core/src/test/java/org/apache/servicemix/nmr/core/FrameworkUtil.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/nmr/core/src/test/java/org/apache/servicemix/nmr/core/FrameworkUtil.java?rev=812215&r1=812214&r2=812215&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/nmr/core/src/test/java/org/apache/servicemix/nmr/core/FrameworkUtil.java (original)
+++ servicemix/smx4/nmr/trunk/nmr/core/src/test/java/org/apache/servicemix/nmr/core/FrameworkUtil.java Mon Sep  7 16:10:11 2009
@@ -16,7 +16,6 @@
  */
 package org.apache.servicemix.nmr.core;
 
-import org.apache.felix.framework.FilterImpl;
 import org.osgi.framework.Filter;
 import org.osgi.framework.InvalidSyntaxException;
 
@@ -25,7 +24,7 @@
 public class FrameworkUtil {
 
     public static Filter createFilter(String f) throws InvalidSyntaxException {
-        return new FilterImpl(f);
+        return org.osgi.framework.FrameworkUtil.createFilter(f);
     }
 
 }

Modified: servicemix/smx4/nmr/trunk/nmr/management/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/nmr/management/pom.xml?rev=812215&r1=812214&r2=812215&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/nmr/management/pom.xml (original)
+++ servicemix/smx4/nmr/trunk/nmr/management/pom.xml Mon Sep  7 16:10:11 2009
@@ -94,9 +94,11 @@
                 <configuration>
                     <instructions>
                         <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
-                        <Import-Package>*</Import-Package>
+                        <Import-Package>
+                            javax.management.loading,
+                            *
+                        </Import-Package>
                         <Export-Package>${pom.artifactId}*;version=${pom.version}</Export-Package>
-                        <Spring-Context>*;publish-context:=false;create-asynchronously:=true</Spring-Context>
                     </instructions>
                 </configuration>
             </plugin>

Modified: servicemix/smx4/nmr/trunk/nmr/management/src/main/java/org/apache/servicemix/nmr/management/ManagementAgent.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/nmr/management/src/main/java/org/apache/servicemix/nmr/management/ManagementAgent.java?rev=812215&r1=812214&r2=812215&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/nmr/management/src/main/java/org/apache/servicemix/nmr/management/ManagementAgent.java (original)
+++ servicemix/smx4/nmr/trunk/nmr/management/src/main/java/org/apache/servicemix/nmr/management/ManagementAgent.java Mon Sep  7 16:10:11 2009
@@ -69,7 +69,7 @@
     }
     
     /**
-     * @see org.fusesource.commons.management.ManagementStrategy#getObjectName(java.lang.Object)
+     * @see org.fusesource.commons.management.ManagementStrategy#getManagedObjectName(java.lang.Object,java.lang.String,java.lang.Class)
      */
     public <T> T getManagedObjectName(Object managableObject, 
                                       String customName, 
@@ -82,7 +82,7 @@
     }
 
     /**
-     * @see org.fusesource.commons.management.ManagementStrategy#manageNamedObject(java.lang.Object)
+     * @see org.fusesource.commons.management.ManagementStrategy#manageNamedObject(java.lang.Object,java.lang.Object)
      */
     public void manageNamedObject(Object managedObject, Object preferredName) throws Exception {
         managedObject = getTypeSpecificManagedObject(managedObject);
@@ -90,7 +90,7 @@
             try {
                 register(managedObject, (ObjectName)preferredName);
             } catch (Exception ex) {
-                throw new JMException(ex.getMessage());
+                throw (JMException) new JMException(ex.getMessage()).initCause(ex);
             }
         }
     }
@@ -113,7 +113,7 @@
     }
     
     /**
-     * @see org.fusesource.commons.management.ManagementStrategy#isManaged(java.lang.Object)
+     * @see org.fusesource.commons.management.ManagementStrategy#isManaged(java.lang.Object,java.lang.Object)
      */
     public boolean isManaged(Object managableObject, Object name) {
         try {
@@ -129,7 +129,7 @@
     }
 
     /**
-     * @see org.fusesource.commons.management.ManagementStrategy#createStatistic(java.lang.Object)
+     * @see org.fusesource.commons.management.ManagementStrategy#createStatistic(java.lang.String,java.lang.Object,UpdateMode)
      */
     public Statistic createStatistic(String name, Object owner, UpdateMode updateMode) {
         return updateMode == UpdateMode.COUNTER

Modified: servicemix/smx4/nmr/trunk/nmr/management/src/main/java/org/apache/servicemix/nmr/management/ManagementEndpointRegistry.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/nmr/management/src/main/java/org/apache/servicemix/nmr/management/ManagementEndpointRegistry.java?rev=812215&r1=812214&r2=812215&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/nmr/management/src/main/java/org/apache/servicemix/nmr/management/ManagementEndpointRegistry.java (original)
+++ servicemix/smx4/nmr/trunk/nmr/management/src/main/java/org/apache/servicemix/nmr/management/ManagementEndpointRegistry.java Mon Sep  7 16:10:11 2009
@@ -63,6 +63,9 @@
     }
 
     public void unregister(InternalEndpoint endpoint, Map<String, ?> properties) {
+        if (endpoint ==  null) {
+            return;
+        }
         try {
             LOG.info("Unregistering endpoint: " + endpoint + " with properties " + properties);
             ManagedEndpoint ep = endpoints.remove(endpoint.getId());

Added: servicemix/smx4/nmr/trunk/nmr/management/src/main/resources/OSGI-INF/blueprint/servicemix-nmr-management.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/nmr/management/src/main/resources/OSGI-INF/blueprint/servicemix-nmr-management.xml?rev=812215&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/nmr/management/src/main/resources/OSGI-INF/blueprint/servicemix-nmr-management.xml (added)
+++ servicemix/smx4/nmr/trunk/nmr/management/src/main/resources/OSGI-INF/blueprint/servicemix-nmr-management.xml Mon Sep  7 16:10:11 2009
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+           xmlns:cm="http://www.osgi.org/xmlns/blueprint-cm/v1.0.0"
+           xmlns:ext="http://geronimo.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0">
+
+    <!-- MBeanServer -->
+    <reference id="mbeanServer"
+               interface="javax.management.MBeanServer"
+               availability="mandatory"/>
+
+    <!-- Endpoint registry -->
+    <bean id="endpointRegistry" class="org.apache.servicemix.nmr.management.ManagementEndpointRegistry">
+        <property name="managementStrategy" ref="managementStrategy" />
+    </bean>
+
+    <!-- List of endpoints -->
+    <reference-list id="endpoints"
+                    interface="org.apache.servicemix.nmr.api.internal.InternalEndpoint"
+                    availability="optional">
+        <reference-listener ref="endpointRegistry" bind-method="register" unbind-method="unregister" />
+    </reference-list>
+
+    <!-- Exchange listener -->
+    <service ref="endpointRegistry">
+        <interfaces>
+            <value>org.apache.servicemix.nmr.api.event.ExchangeListener</value>
+            <value>org.apache.servicemix.nmr.api.event.Listener</value>
+        </interfaces>
+    </service>
+
+    <!-- ManagementStrategy -->
+    <!-- Replace the following beans and <osgi:service> element with
+         an <osgi:reference> element if plugging in an alternative
+         ManagementStrategy implementation from another bunble -->
+    <bean id="namingStrategy" class="org.apache.servicemix.nmr.management.DefaultNamingStrategy">
+        <property name="jmxDomainName" value="org.apache.servicemix" />
+    </bean>
+
+    <bean id="managementStrategy" class="org.apache.servicemix.nmr.management.ManagementAgent">
+        <property name="namingStrategy" ref="namingStrategy" />
+        <property name="mbeanServer" ref="mbeanServer" />
+    </bean>
+
+    <service ref="managementStrategy">
+        <interfaces>
+            <value>org.fusesource.commons.management.ManagementStrategy</value>
+        </interfaces>
+    </service>
+
+</blueprint>

Modified: servicemix/smx4/nmr/trunk/nmr/osgi/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/nmr/osgi/pom.xml?rev=812215&r1=812214&r2=812215&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/nmr/osgi/pom.xml (original)
+++ servicemix/smx4/nmr/trunk/nmr/osgi/pom.xml Mon Sep  7 16:10:11 2009
@@ -45,8 +45,9 @@
             <artifactId>org.apache.servicemix.nmr.spring</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.springframework.osgi</groupId>
-            <artifactId>spring-osgi-core</artifactId>
+            <groupId>org.apache.geronimo</groupId>
+            <artifactId>blueprint-bundle</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.apache.felix</groupId>
@@ -84,8 +85,6 @@
                     <instructions>
                         <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
                         <Import-Package>
-                            org.springframework.osgi*;version="[1.2.0,2.0.0)",
-                            org.springframework*;version="[2.5.6,3.0.0)",
                             org.apache.servicemix.document,
                             org.apache.servicemix.executors,
                             org.apache.servicemix.executors.impl,
@@ -96,10 +95,9 @@
                             org.apache.servicemix.nmr.core,
                             org.apache.servicemix.nmr.core.security,
                             org.apache.servicemix.nmr.osgi,
-                            org.fusesource.commons.management,
+                            javax.xml.namespace,
                             *
                         </Import-Package>
-
                     </instructions>
                 </configuration>
             </plugin>

Modified: servicemix/smx4/nmr/trunk/nmr/osgi/src/main/java/org/apache/servicemix/nmr/osgi/OsgiServiceRegistryTracker.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/nmr/osgi/src/main/java/org/apache/servicemix/nmr/osgi/OsgiServiceRegistryTracker.java?rev=812215&r1=812214&r2=812215&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/nmr/osgi/src/main/java/org/apache/servicemix/nmr/osgi/OsgiServiceRegistryTracker.java (original)
+++ servicemix/smx4/nmr/trunk/nmr/osgi/src/main/java/org/apache/servicemix/nmr/osgi/OsgiServiceRegistryTracker.java Mon Sep  7 16:10:11 2009
@@ -33,7 +33,7 @@
  * when services are registered / unregistered in the OSGi registry.  This avoid using spring proxies which are
  * not always needed especially in our case.
  */
-public class OsgiServiceRegistryTracker<T> implements BundleContextAware, InitializingBean, DisposableBean, ServiceTrackerCustomizer {
+public class OsgiServiceRegistryTracker<T> implements ServiceTrackerCustomizer {
 
     private BundleContext bundleContext;
     private ServiceRegistry<T> registry;
@@ -64,7 +64,7 @@
         this.registry = registry;
     }
 
-    public void afterPropertiesSet() throws Exception {
+    public void init() throws Exception {
         tracker = new ServiceTracker(bundleContext, clazz.getName(), this);
         tracker.open();
     }

Added: servicemix/smx4/nmr/trunk/nmr/osgi/src/main/java/org/apache/servicemix/nmr/osgi/PassThroughConverter.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/nmr/osgi/src/main/java/org/apache/servicemix/nmr/osgi/PassThroughConverter.java?rev=812215&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/nmr/osgi/src/main/java/org/apache/servicemix/nmr/osgi/PassThroughConverter.java (added)
+++ servicemix/smx4/nmr/trunk/nmr/osgi/src/main/java/org/apache/servicemix/nmr/osgi/PassThroughConverter.java Mon Sep  7 16:10:11 2009
@@ -0,0 +1,41 @@
+/*
+ * 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.nmr.osgi;
+
+import org.osgi.service.blueprint.container.Converter;
+import org.osgi.service.blueprint.container.ReifiedType;
+
+/**
+ * A simple converter to convert generics
+ */
+public class PassThroughConverter implements Converter {
+
+    private Class target;
+
+    public void setTarget(Class target) {
+        this.target = target;
+    }
+
+    public boolean canConvert(Object sourceObject, ReifiedType targetType) {
+        return target.isInstance(sourceObject) &&
+               targetType.getRawClass().equals(target);
+    }
+
+    public Object convert(Object sourceObject, ReifiedType targetType) throws Exception {
+        return sourceObject;
+    }
+}

Added: servicemix/smx4/nmr/trunk/nmr/osgi/src/main/resources/OSGI-INF/blueprint/servicemix-nmr.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/nmr/osgi/src/main/resources/OSGI-INF/blueprint/servicemix-nmr.xml?rev=812215&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/nmr/osgi/src/main/resources/OSGI-INF/blueprint/servicemix-nmr.xml (added)
+++ servicemix/smx4/nmr/trunk/nmr/osgi/src/main/resources/OSGI-INF/blueprint/servicemix-nmr.xml Mon Sep  7 16:10:11 2009
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+           xmlns:cm="http://www.osgi.org/xmlns/blueprint-cm/v1.0.0">
+
+    <type-converters>
+        <bean class="org.apache.servicemix.nmr.osgi.PassThroughConverter">
+            <property name="target" value="org.apache.servicemix.nmr.api.service.ServiceRegistry"/>
+        </bean>
+    </type-converters>
+
+    <!-- ServiceMix NMR -->
+    <bean id="servicemix" class="org.apache.servicemix.nmr.core.ServiceMix" init-method="init">
+        <property name="endpointRegistry" ref="endpointRegistry" />
+        <property name="listenerRegistry" ref="listenerRegistry" />
+        <property name="flowRegistry" ref="flowRegistry" />
+        <property name="wireRegistry" ref="wireRegistry" />
+        <property name="executorFactory" ref="executorFactory" />
+    </bean>
+    <service ref="servicemix" interface="org.apache.servicemix.nmr.api.NMR"/>
+
+    <!-- Flow registry and service tracker -->
+    <bean id="flowRegistry" class="org.apache.servicemix.nmr.core.FlowRegistryImpl">
+        <property name="registry" ref="endpointRegistry" />
+        <property name="authorizationService" ref="authorizationService" />
+        <property name="nonOsgiFlows">
+            <list>
+                <bean class="org.apache.servicemix.nmr.core.StraightThroughFlow" />
+            </list>
+        </property>
+    </bean>
+    <bean id="endpointTracker" class="org.apache.servicemix.nmr.osgi.OsgiServiceRegistryTracker" init-method="init" destroy-method="destroy">
+        <property name="interface" value="org.apache.servicemix.nmr.api.internal.Flow" />
+        <property name="registry" ref="listenerRegistry" />
+        <property name="bundleContext" ref="blueprintBundleContext" />
+    </bean>
+
+    <!-- Listener registry and service tracker -->
+    <bean id="listenerRegistry" class="org.apache.servicemix.nmr.core.ListenerRegistryImpl" />
+    <bean class="org.apache.servicemix.nmr.osgi.OsgiServiceRegistryTracker" init-method="init" destroy-method="destroy">
+        <property name="interface" value="org.apache.servicemix.nmr.api.event.Listener" />
+        <property name="registry" ref="listenerRegistry" />
+        <property name="bundleContext" ref="blueprintBundleContext" />
+    </bean>
+
+    <!-- Endpoint registry and service tracker -->
+    <bean id="endpointRegistry" class="org.apache.servicemix.nmr.core.EndpointRegistryImpl">
+        <property name="nmr" ref="servicemix" />
+        <property name="registry" ref="internalEndpointRegistry" />
+        <property name="executorFactory" ref="executorFactory" />
+    </bean>
+    <bean id="internalEndpointRegistry" class="org.apache.servicemix.nmr.osgi.InternalRegistryWrapper">
+        <property name="bundleContext" ref="blueprintBundleContext"/>
+    </bean>
+    <bean class="org.apache.servicemix.nmr.osgi.OsgiServiceRegistryTracker" init-method="init" destroy-method="destroy">
+        <property name="interface" value="org.apache.servicemix.nmr.api.Endpoint" />
+        <property name="registry" ref="endpointRegistry" />
+        <property name="bundleContext" ref="blueprintBundleContext"/>
+    </bean>
+
+    <!-- Wire registry and service tracker -->
+    <bean id="wireRegistry" class="org.apache.servicemix.nmr.core.WireRegistryImpl"/>
+    <bean class="org.apache.servicemix.nmr.osgi.OsgiServiceRegistryTracker" init-method="init" destroy-method="destroy">
+        <property name="interface" value="org.apache.servicemix.nmr.api.Wire" />
+        <property name="registry" ref="wireRegistry" />
+        <property name="bundleContext" ref="blueprintBundleContext"/>
+    </bean>
+
+    <!-- AuthorizationService -->
+    <bean id="authorizationService" class="org.apache.servicemix.nmr.core.security.DefaultAuthorizationService" />
+    <service ref="authorizationService" interface="org.apache.servicemix.nmr.api.security.AuthorizationService" />
+
+    <!-- AuthorizationEntries -->
+    <reference-list id="authorizationEntries"
+                    interface="org.apache.servicemix.nmr.api.security.AuthorizationEntry"
+                    availability="optional">
+        <reference-listener ref="authorizationService" bind-method="register" unbind-method="unregister" />
+    </reference-list>
+
+    <!-- Default authorization entry -->
+    <service interface="org.apache.servicemix.nmr.api.security.AuthorizationEntry">
+        <bean class="org.apache.servicemix.nmr.core.security.DefaultAuthorizationEntry">
+            <property name="endpoint" value="*" />
+            <property name="rank" value="-2147483648" />
+            <property name="roles" value="*" />
+            <property name="type" value="Set" />
+        </bean>
+    </service>
+
+    <!-- AuthenticationService -->
+    <bean id="authenticationService" class="org.apache.servicemix.nmr.core.security.JaasAuthenticationService" />
+    <service ref="authenticationService" interface="org.apache.servicemix.nmr.api.security.AuthenticationService" />
+
+    <!-- ExecutorFactory -->
+    <bean id="executorFactory" class="org.apache.servicemix.executors.impl.ExecutorFactoryImpl">
+        <property name="defaultConfig">
+            <bean class="org.apache.servicemix.executors.impl.ExecutorConfig">
+                <property name="allowCoreThreadsTimeout" value="${allowCoreThreadsTimeout}" />
+                <property name="corePoolSize" value="${threadPoolCorePoolSize}"/>
+                <property name="maximumPoolSize" value="${threadPoolMaximumPoolSize}"/>
+                <property name="queueSize" value="${threadPoolQueueSize}"/>
+                <property name="bypassIfSynchronous" value="${bypassIfSynchronous}" />
+            </bean>
+        </property>
+    </bean>
+
+    <!-- Property place holder -->
+    <cm:property-placeholder persistent-id="org.apache.servicemix.nmr">
+        <cm:default-properties>
+            <cm:property name="allowCoreThreadsTimeout" value="true"/>
+            <cm:property name="threadPoolCorePoolSize" value="1"/>
+            <cm:property name="threadPoolMaximumPoolSize" value="16"/>
+            <cm:property name="threadPoolQueueSize" value="256"/>
+            <cm:property name="bypassIfSynchronous" value="true"/>
+        </cm:default-properties>
+    </cm:property-placeholder>
+
+</blueprint>

Modified: servicemix/smx4/nmr/trunk/nmr/spring/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/nmr/spring/pom.xml?rev=812215&r1=812214&r2=812215&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/nmr/spring/pom.xml (original)
+++ servicemix/smx4/nmr/trunk/nmr/spring/pom.xml Mon Sep  7 16:10:11 2009
@@ -65,11 +65,6 @@
                 <configuration>
                     <instructions>
                         <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
-                        <Import-Package>
-                            org.springframework.osgi*;version="[1.2.0,2.0.0)",
-                            org.springframework*;version="[2.5.6,3.0.0)",
-                            *
-                        </Import-Package>
                         <Export-Package>${pom.artifactId}</Export-Package>
                     </instructions>
                 </configuration>

Modified: servicemix/smx4/nmr/trunk/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/pom.xml?rev=812215&r1=812214&r2=812215&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/pom.xml (original)
+++ servicemix/smx4/nmr/trunk/pom.xml Mon Sep  7 16:10:11 2009
@@ -38,6 +38,7 @@
       <module>naming</module>
       <module>transaction</module>
       <module>nmr</module>
+      <module>testing</module>
       <module>jbi</module>
       <module>bundle</module>
       <module>assembly</module>
@@ -64,20 +65,24 @@
       <ant.version>1.7.0_1</ant.version>
       <aopalliance.version>1.0_1</aopalliance.version>
       <asm.version>2.2.3_1</asm.version>
-      <cglib.version>2.1_3</cglib.version>
+      <cglib.version>2.1_3_2</cglib.version>
       <camel.version>1.6.0</camel.version>
       <commons.io.version>1.3.2_1</commons.io.version>
       <commons.logging.version>1.1.1</commons.logging.version>
       <derby.version>10.4.2.0</derby.version>
       <depends.maven.plugin.version>1.0</depends.maven.plugin.version>
       <easymock.version>2.4</easymock.version>
+      <equinox.version>3.5.0.v20090520</equinox.version>
       <felix.configadmin.version>1.0.4</felix.configadmin.version>
       <felix.plugin.version>1.4.3</felix.plugin.version>
-      <felix.framework.version>1.5.0-r752991</felix.framework.version>
+      <felix.framework.version>1.9.0-SNAPSHOT</felix.framework.version>
       <felix.osgi.version>1.2.0</felix.osgi.version>
       <felix.compendium.version>1.2.0</felix.compendium.version>
       <felix.bundlerepository.version>1.2.0</felix.bundlerepository.version>
       <felix.prefs.version>1.0.2</felix.prefs.version>
+      <felix.karaf.version>0.9.0-SNAPSHOT</felix.karaf.version>
+      <felix.fileinstall.version>1.3.0-SNAPSHOT</felix.fileinstall.version>
+      <felix.gogo.version>0.9.0-SNAPSHOT</felix.gogo.version>
       <geronimo.j2ee.connector.version>2.0.0</geronimo.j2ee.connector.version>
       <geronimo.jms.version>1.1.1</geronimo.jms.version>
       <geronimo.jta.version>1.1.1</geronimo.jta.version>
@@ -92,18 +97,21 @@
       <junit.version>3.8.2_1</junit.version>
       <log4j.version>1.2.14</log4j.version>
       <lucene.version>2.4.1</lucene.version>
-      <pax.logging.version>1.1.1</pax.logging.version>
+      <mina.version>2.0.0-M6</mina.version>
+      <pax.exam.version>1.0.0</pax.exam.version>
+      <pax.logging.version>1.4</pax.logging.version>
+      <pax.runner.version>1.1.1</pax.runner.version>
       <servicemix3.version>3.3</servicemix3.version>
       <servicemix.eip.version>2008.01</servicemix.eip.version>
       <servicemix.http.version>2008.01</servicemix.http.version>
       <servicemix.jsr181.version>2008.01</servicemix.jsr181.version>
       <servicemix.shared.version>2008.01</servicemix.shared.version>
-      <servicemix.kernel.version>1.1.0</servicemix.kernel.version>
       <servicemix.legal.version>1.0</servicemix.legal.version>
       <servicemix.specs.version>1.3.0</servicemix.specs.version>
       <servicemix.utils.version>1.1.0</servicemix.utils.version>
-      <spring.osgi.version>1.2.0-rc1</spring.osgi.version>
-      <spring.version>2.5.6</spring.version>
+      <sshd.version>0.2.0</sshd.version>
+      <spring.osgi.version>1.2.0</spring.osgi.version>
+      <spring.version>2.5.6.SEC01</spring.version>
       <woodstox.version>3.2.7_1</woodstox.version>
       <wsdl4j.version>1.6.1_1</wsdl4j.version>
       <xbean.version>3.5</xbean.version>
@@ -184,6 +192,11 @@
       </dependency>
       <dependency>
           <groupId>org.springframework</groupId>
+          <artifactId>spring-context-support</artifactId>
+          <version>${spring.version}</version>
+      </dependency>
+      <dependency>
+          <groupId>org.springframework</groupId>
           <artifactId>spring-jms</artifactId>
           <version>${spring.version}</version>
       </dependency>
@@ -376,6 +389,16 @@
       </dependency>
       <dependency>
           <groupId>org.apache.servicemix.bundles</groupId>
+          <artifactId>org.apache.servicemix.bundles.aopalliance</artifactId>
+          <version>${aopalliance.version}</version>
+      </dependency>
+      <dependency>
+          <groupId>org.apache.servicemix.bundles</groupId>
+          <artifactId>org.apache.servicemix.bundles.cglib</artifactId>
+          <version>${cglib.version}</version>
+      </dependency>
+      <dependency>
+          <groupId>org.apache.servicemix.bundles</groupId>
           <artifactId>org.apache.servicemix.bundles.wsdl4j</artifactId>
           <version>${wsdl4j.version}</version>
       </dependency>
@@ -386,6 +409,11 @@
       </dependency>
       <dependency>
           <groupId>org.apache.felix</groupId>
+          <artifactId>org.apache.felix.fileinstall</artifactId>
+          <version>${felix.fileinstall.version}</version>
+      </dependency>
+      <dependency>
+          <groupId>org.apache.felix</groupId>
           <artifactId>org.apache.felix.framework</artifactId>
           <version>${felix.framework.version}</version>
       </dependency>
@@ -435,6 +463,21 @@
           <version>${spring.osgi.version}</version>
       </dependency>
       <dependency>
+          <groupId>org.springframework.osgi</groupId>
+          <artifactId>spring-osgi-io</artifactId>
+          <version>${spring.osgi.version}</version>
+      </dependency>
+      <dependency>
+          <groupId>org.springframework.osgi</groupId>
+          <artifactId>spring-osgi-extender</artifactId>
+          <version>${spring.osgi.version}</version>
+      </dependency>
+      <dependency>
+          <groupId>org.springframework.osgi</groupId>
+          <artifactId>spring-osgi-annotation</artifactId>
+          <version>${spring.osgi.version}</version>
+      </dependency>
+      <dependency>
           <groupId>org.apache.felix</groupId>
           <artifactId>org.osgi.core</artifactId>
           <version>${felix.osgi.version}</version>
@@ -455,14 +498,14 @@
           <version>${junit.version}</version>
       </dependency>
       <dependency>
-          <groupId>org.apache.servicemix.kernel.gshell</groupId>
-          <artifactId>org.apache.servicemix.kernel.gshell.core</artifactId>
-          <version>${servicemix.kernel.version}</version>
+          <groupId>org.apache.felix.karaf.gshell</groupId>
+          <artifactId>org.apache.felix.karaf.gshell.core</artifactId>
+          <version>${felix.karaf.version}</version>
       </dependency>
       <dependency>
-          <groupId>org.apache.servicemix.kernel</groupId>
-          <artifactId>org.apache.servicemix.kernel.filemonitor</artifactId>
-          <version>${servicemix.kernel.version}</version>
+          <groupId>org.apache.felix.karaf</groupId>
+          <artifactId>org.apache.felix.karaf.filemonitor</artifactId>
+          <version>${felix.karaf.version}</version>
           <exclusions>
               <exclusion>
                   <groupId>org.apache.felix</groupId>
@@ -471,14 +514,14 @@
           </exclusions>
       </dependency>
       <dependency>
-          <groupId>org.apache.servicemix.kernel</groupId>
-          <artifactId>org.apache.servicemix.kernel.management</artifactId>
-          <version>${servicemix.kernel.version}</version>
+          <groupId>org.apache.felix.karaf</groupId>
+          <artifactId>org.apache.felix.karaf.management</artifactId>
+          <version>${felix.karaf.version}</version>
       </dependency>
       <dependency>
-          <groupId>org.apache.servicemix.kernel.testing</groupId>
-          <artifactId>org.apache.servicemix.kernel.testing.support</artifactId>
-          <version>${servicemix.kernel.version}</version>
+          <groupId>org.apache.felix.karaf.testing</groupId>
+          <artifactId>org.apache.felix.karaf.testing.support</artifactId>
+          <version>${felix.karaf.version}</version>
           <exclusions>
               <exclusion>
                   <groupId>org.apache.felix</groupId>
@@ -589,9 +632,9 @@
           </exclusions>
       </dependency>
       <dependency>
-          <groupId>org.apache.servicemix.kernel</groupId>
-          <artifactId>org.apache.servicemix.kernel.main</artifactId>
-          <version>${servicemix.kernel.version}</version>
+          <groupId>org.apache.felix.karaf</groupId>
+          <artifactId>org.apache.felix.karaf.main</artifactId>
+          <version>${felix.karaf.version}</version>
           <exclusions>
               <exclusion>
                   <groupId>org.apache.felix</groupId>
@@ -606,15 +649,15 @@
           <type>xml</type>
       </dependency>
       <dependency>
-          <groupId>org.apache.servicemix.kernel</groupId>
-          <artifactId>apache-servicemix-kernel</artifactId>
-          <version>${servicemix.kernel.version}</version>
+          <groupId>org.apache.felix.karaf</groupId>
+          <artifactId>apache-felix-karaf</artifactId>
+          <version>${felix.karaf.version}</version>
           <type>zip</type>
       </dependency>
       <dependency>
-          <groupId>org.apache.servicemix.kernel</groupId>
-          <artifactId>apache-servicemix-kernel</artifactId>
-          <version>${servicemix.kernel.version}</version>
+          <groupId>org.apache.felix.karaf</groupId>
+          <artifactId>apache-felix-karaf</artifactId>
+          <version>${felix.karaf.version}</version>
           <type>tar.gz</type>
       </dependency>
       <dependency>
@@ -691,6 +734,31 @@
           <artifactId>servicemix-utils</artifactId>
           <version>${servicemix.utils.version}</version>
       </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam</artifactId>
+            <version>${pax.exam.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-junit</artifactId>
+            <version>${pax.exam.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-container-default</artifactId>
+            <version>${pax.exam.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-junit-extender-impl</artifactId>
+            <version>${pax.exam.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.runner</groupId>
+            <artifactId>pax-runner-no-jcl</artifactId>
+            <version>${pax.runner.version}</version>
+        </dependency>
     </dependencies>
   </dependencyManagement>
 

Added: servicemix/smx4/nmr/trunk/testing/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/testing/pom.xml?rev=812215&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/testing/pom.xml (added)
+++ servicemix/smx4/nmr/trunk/testing/pom.xml Mon Sep  7 16:10:11 2009
@@ -0,0 +1,38 @@
+<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.nmr</groupId>
+        <artifactId>nmr-parent</artifactId>
+        <version>1.1.0-SNAPSHOT</version>
+    </parent>
+
+    <groupId>org.apache.servicemix.testing</groupId>
+    <artifactId>testing</artifactId>
+    <packaging>pom</packaging>
+    <name>Apache ServiceMix Testing</name>
+
+    <modules>
+        <module>support</module>
+    </modules>
+
+</project>

Added: servicemix/smx4/nmr/trunk/testing/support/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/testing/support/pom.xml?rev=812215&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/testing/support/pom.xml (added)
+++ servicemix/smx4/nmr/trunk/testing/support/pom.xml Mon Sep  7 16:10:11 2009
@@ -0,0 +1,159 @@
+<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.testing</groupId>
+        <artifactId>testing</artifactId>
+        <version>1.1.0-SNAPSHOT</version>
+    </parent>
+
+    <groupId>org.apache.servicemix.platform.testing</groupId>
+    <artifactId>org.apache.servicemix.platform.testing.support</artifactId>
+    <packaging>bundle</packaging>
+    <version>1.1.0-SNAPSHOT</version>
+    <name>Apache ServiceMix :: Testing - Support</name>
+
+    <properties>
+        <aopalliance.version>1.0_1</aopalliance.version>
+        <asm.version>2.2.3_1</asm.version>
+        <jaxp.ri.version>1.4.2_1</jaxp.ri.version>
+        <pax.url.version>0.3.3</pax.url.version>
+        <felix.configadmin.version>1.0.4</felix.configadmin.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.framework</artifactId>
+            <version>${felix.framework.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.felix</groupId>
+                    <artifactId>org.osgi.compendium</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.configadmin</artifactId>
+            <version>${felix.configadmin.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.logging</groupId>
+            <artifactId>pax-logging-api</artifactId>
+            <version>${pax.logging.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.logging</groupId>
+            <artifactId>pax-logging-service</artifactId>
+            <version>${pax.logging.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>log4j</groupId>
+                    <artifactId>log4j</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.osgi</groupId>
+            <artifactId>spring-osgi-test</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.osgi</groupId>
+            <artifactId>spring-osgi-extender</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.osgi</groupId>
+            <artifactId>spring-osgi-annotation</artifactId>
+            <version>${spring.osgi.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-servlet_2.5_spec</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.specs</groupId>
+            <artifactId>org.apache.servicemix.specs.jaxp-api-1.4</artifactId>
+            <version>${servicemix.specs.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.aopalliance</artifactId>
+            <version>${aopalliance.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.asm</artifactId>
+            <version>${asm.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.junit</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.woodstox</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.jaxp-ri</artifactId>
+            <version>${jaxp.ri.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.url</groupId>
+            <artifactId>pax-url-mvn</artifactId>
+            <version>${pax.url.version}</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <configuration>
+                    <instructions>
+                        <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
+                        <Import-Package>
+                            javax.management,
+                            org.springframework.jmx.support,
+                            org.apache.felix*;resolution:=optional,
+                            org.apache.servicemix.platform.main;resolution:=optional,
+                            org.apache.servicemix.platform.main.spi;resolution:=optional;version="1.0.0",
+                            *
+                        </Import-Package>
+                        <Export-Package>
+                            org.apache.servicemix.platform.testing.support,
+                            org.apache.servicemix.platform.main.spi
+                        </Export-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

Added: servicemix/smx4/nmr/trunk/testing/support/src/main/java/org/apache/servicemix/platform/main/spi/MainService.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/testing/support/src/main/java/org/apache/servicemix/platform/main/spi/MainService.java?rev=812215&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/testing/support/src/main/java/org/apache/servicemix/platform/main/spi/MainService.java (added)
+++ servicemix/smx4/nmr/trunk/testing/support/src/main/java/org/apache/servicemix/platform/main/spi/MainService.java Mon Sep  7 16:10:11 2009
@@ -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.platform.main.spi;
+
+public interface MainService {
+    public abstract String[] getArgs();
+    public int getExitCode();
+    public void setExitCode(int exitCode);
+}

Added: servicemix/smx4/nmr/trunk/testing/support/src/main/java/org/apache/servicemix/platform/testing/support/AbstractIntegrationTest.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/testing/support/src/main/java/org/apache/servicemix/platform/testing/support/AbstractIntegrationTest.java?rev=812215&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/testing/support/src/main/java/org/apache/servicemix/platform/testing/support/AbstractIntegrationTest.java (added)
+++ servicemix/smx4/nmr/trunk/testing/support/src/main/java/org/apache/servicemix/platform/testing/support/AbstractIntegrationTest.java Mon Sep  7 16:10:11 2009
@@ -0,0 +1,246 @@
+/*
+ * 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.platform.testing.support;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.apache.log4j.PropertyConfigurator;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.ServiceEvent;
+import org.osgi.framework.ServiceListener;
+import org.springframework.core.io.FileSystemResource;
+import org.springframework.core.io.Resource;
+import org.springframework.osgi.test.AbstractConfigurableBundleCreatorTests;
+import org.springframework.osgi.test.provisioning.ArtifactLocator;
+import org.springframework.osgi.util.OsgiFilterUtils;
+import org.springframework.osgi.util.OsgiListenerUtils;
+import org.springframework.util.Assert;
+import org.springframework.util.StringUtils;
+
+
+public class AbstractIntegrationTest extends AbstractConfigurableBundleCreatorTests {
+
+    static {
+        try {
+            File f = new File("target/smx4");
+            f.mkdirs();
+            System.setProperty("karaf.name", "root");
+            System.setProperty("karaf.home", f.getAbsolutePath());
+            System.setProperty("karaf.base", f.getAbsolutePath());
+            System.setProperty("felix.fileinstall.dir", new File(f, "etc").getAbsolutePath());
+//            System.setProperty("org.apache.servicemix.filemonitor.monitorDir", new File(f, "deploy").getAbsolutePath());
+//            System.setProperty("org.apache.servicemix.filemonitor.generatedJarDir", new File(f, "data/generate-bundles").getAbsolutePath());
+            System.setProperty("bundles.configuration.location", new File("src/test/conf").getAbsolutePath());
+            System.setProperty("org.osgi.vendor.framework", "org.apache.servicemix.platform.testing.support");
+            PropertyConfigurator.configure("target/test-classes/log4j.properties");
+        } catch (Throwable t) {}
+    }
+
+    private Properties dependencies;
+
+    @Override
+    protected String getPlatformName() {
+        String systemProperty = System.getProperty(OSGI_FRAMEWORK_SELECTOR);
+        if (logger.isTraceEnabled())
+            logger.trace("system property [" + OSGI_FRAMEWORK_SELECTOR + "] has value=" + systemProperty);
+
+        return (systemProperty == null ? SmxPlatform.class.getName() : systemProperty);
+    }
+
+    protected String getBundle(String groupId, String artifactId) {
+        return groupId + "," + artifactId + "," + getBundleVersion(groupId, artifactId);
+    }
+
+    protected String getBundleVersion(String groupId, String artifactId) {
+        if (dependencies == null) {
+            try {
+                File f = new File(System.getProperty("basedir"), "target/classes/META-INF/maven/dependencies.properties");
+                Properties prop = new Properties();
+                prop.load(new FileInputStream(f));
+                dependencies = prop;
+            } catch (IOException e) {
+                throw new IllegalStateException("Unable to load dependencies informations", e);
+            }
+        }
+        String version = dependencies.getProperty(groupId + "/" + artifactId + "/version");
+        if (version == null) {
+            throw new IllegalStateException("Unable to find dependency information for: " + groupId + "/" + artifactId + "/version");
+        }
+        return version;
+    }
+
+    protected String[] getTestFrameworkBundlesNames() {
+        return new String[] {
+            getBundle("org.apache.geronimo.specs", "geronimo-servlet_2.5_spec"),
+            getBundle("org.apache.servicemix.specs", "org.apache.servicemix.specs.jaxp-api-1.4"),
+            getBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.jaxp-ri"),
+            getBundle("org.apache.felix", "org.osgi.compendium"),
+            getBundle("org.apache.felix", "org.apache.felix.configadmin"),
+            getBundle("org.ops4j.pax.logging", "pax-logging-api"),
+            getBundle("org.ops4j.pax.logging", "pax-logging-service"),
+            getBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.aopalliance"),
+            getBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.asm"),
+            getBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.junit"),
+            getBundle("org.springframework", "spring-beans"),
+            getBundle("org.springframework", "spring-core"),
+            getBundle("org.springframework", "spring-context"),
+            getBundle("org.springframework", "spring-aop"),
+            getBundle("org.springframework", "spring-test"),
+            getBundle("org.springframework.osgi", "spring-osgi-core"),
+            getBundle("org.springframework.osgi", "spring-osgi-io"),
+            getBundle("org.springframework.osgi", "spring-osgi-extender"),
+            getBundle("org.springframework.osgi", "spring-osgi-test"),
+            getBundle("org.springframework.osgi", "spring-osgi-annotation"),
+            getBundle("org.ops4j.pax.url", "pax-url-mvn"),
+            getBundle("org.apache.servicemix.platform.testing", "org.apache.servicemix.platform.testing.support"),
+        };
+    }
+
+    protected Bundle installBundle(String groupId, String artifactId, String classifier, String type) throws Exception {
+        String version = getBundleVersion(groupId, artifactId);
+        File loc = localMavenBundle(groupId, artifactId, version, classifier, type);
+        Bundle bundle = bundleContext.installBundle(loc.toURI().toString());
+        bundle.start();
+        return bundle;
+    }
+    
+    protected Resource locateBundle(String bundleId) {
+        Assert.hasText(bundleId, "bundleId should not be empty");
+
+        // parse the String
+        String[] artifactId = StringUtils.commaDelimitedListToStringArray(bundleId);
+
+        Assert.isTrue(artifactId.length >= 3, "the CSV string " + bundleId + " contains too few values");
+        // TODO: add a smarter mechanism which can handle 1 or 2 values CSVs
+        for (int i = 0; i < artifactId.length; i++) {
+            artifactId[i] = StringUtils.trimWhitespace(artifactId[i]);
+        }
+
+        File f;
+        if (artifactId.length == 3) {
+            f = localMavenBundle(artifactId[0], artifactId[1], artifactId[2], null, ArtifactLocator.DEFAULT_ARTIFACT_TYPE);
+        } else {
+            f = localMavenBundle(artifactId[0], artifactId[1], artifactId[2], null, artifactId[3]);
+        }
+        return new FileSystemResource(f);
+    }
+
+
+    protected File localMavenBundle(String groupId, String artifact, String version, String classifier, String type) {
+        String defaultHome = new File(new File(System.getProperty("user.home")), ".m2/repository").getAbsolutePath();
+        File repositoryHome = new File(System.getProperty("localRepository", defaultHome));
+
+        StringBuffer location = new StringBuffer(groupId.replace('.', '/'));
+        location.append('/');
+        location.append(artifact);
+        location.append('/');
+        location.append(getSnapshot(version));
+        location.append('/');
+        location.append(artifact);
+        location.append('-');
+        location.append(version);
+        if (classifier != null) {
+            location.append('-');
+            location.append(classifier);
+        }
+        location.append(".");
+        location.append(type);
+
+        return new File(repositoryHome, location.toString());
+    }
+
+    protected static String getSnapshot(String version) {
+        if (isTimestamped(version)) {
+            return version.substring(0, version.lastIndexOf('-', version.lastIndexOf('-') - 1)) + "-SNAPSHOT";
+        }
+        return version;
+    }
+
+    protected static boolean isTimestamped(String version) {
+        return version.matches(".+-\\d\\d\\d\\d\\d\\d\\d\\d\\.\\d\\d\\d\\d\\d\\d-\\d+");
+    }
+
+    protected static boolean isSnapshot(String version) {
+        return version.matches(".+-SNAPSHOT");
+    }
+
+    public <T> T getOsgiService(Class<T> type) {
+        return getOsgiService(type, DEFAULT_WAIT_TIME);
+    }
+
+    public <T> T getOsgiService(Class<T> type, long timeout) {
+        // translate from seconds to miliseconds
+        long time = timeout * 1000;
+
+        // use the counter to make sure the threads block
+        final Counter counter = new Counter("waitForOsgiService on bnd=" + type.getName());
+
+        counter.increment();
+
+        final List<T> services = new ArrayList<T>();
+
+        ServiceListener listener = new ServiceListener() {
+            public void serviceChanged(ServiceEvent event) {
+                if (event.getType() == ServiceEvent.REGISTERED) {
+                    services.add((T) bundleContext.getService(event.getServiceReference()));
+                    counter.decrement();
+                }
+            }
+        };
+
+        String filter = OsgiFilterUtils.unifyFilter(type.getName(), null);
+        OsgiListenerUtils.addServiceListener(bundleContext, listener, filter);
+
+        if (logger.isDebugEnabled())
+            logger.debug("start waiting for OSGi service=" + type.getName());
+
+        try {
+            if (counter.waitForZero(time)) {
+                logger.warn("waiting for OSGi service=" + type.getName() + " timed out");
+                throw new RuntimeException("Gave up waiting for OSGi service '" + type.getName() + "' to be created");
+            }
+            else if (logger.isDebugEnabled()) {
+                logger.debug("found OSGi service=" + type.getName());
+            }
+            return services.get(0);
+        }
+        finally {
+            // inform waiting thread
+            bundleContext.removeServiceListener(listener);
+        }
+    }
+
+    protected void checkBundleStarted(String name) {
+        assertNotNull(bundleContext);
+        for (int i = 0; i < bundleContext.getBundles().length; i++) {
+            Bundle b = bundleContext.getBundles()[i];
+            if (b.getSymbolicName().equals(name)) {
+                assertEquals("Bundle '" + name + "' is not active", Bundle.ACTIVE, b.getState());
+                return;
+            }
+        }
+        fail("Bundle '" + name + "' not found");
+    }
+
+
+}

Added: servicemix/smx4/nmr/trunk/testing/support/src/main/java/org/apache/servicemix/platform/testing/support/Counter.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/testing/support/src/main/java/org/apache/servicemix/platform/testing/support/Counter.java?rev=812215&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/testing/support/src/main/java/org/apache/servicemix/platform/testing/support/Counter.java (added)
+++ servicemix/smx4/nmr/trunk/testing/support/src/main/java/org/apache/servicemix/platform/testing/support/Counter.java Mon Sep  7 16:10:11 2009
@@ -0,0 +1,172 @@
+/*
+ * Copyright 2002-2007 the original author or authors.
+ *
+ * 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.apache.servicemix.platform.testing.support;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Simple counting class which can be incremented or decremented in a
+ * synchronized manner. This class can be used as a synchronization mechanism
+ * between threads mainly though {@link #waitForZero(long)} method.
+ *
+ * The main usage of the class is to allow a master thread, to know when other
+ * threads (slaves) have passed a certain point in execution.
+ *
+ * <p/> As opposed to a Barrier or a Semaphore, this class should be used only
+ * with 1 waiting thread (a master) and any number of slave threads.
+ *
+ * <pre style="code">
+ * Thread 1:
+ *  synchronized(counter) {
+ *    counter.increment();
+ *    thread2.start();
+ *    counter.increment();
+ *    thread3.start();
+ *
+ *    // wait 1 second for other threads to complete
+ *    counter.waitForZero(1000);
+ * }
+ *
+ * Thread 2:
+ *  // do some work
+ *  counter.decrement();
+ *
+ * Thread 3:
+ *  // do some work
+ *  counter.decrement();
+ *
+ * </pre>
+ *
+ * <p/> Mainly for usage inside the framework. All methods are thread-safe
+ * however for the master/slave pattern, synchronized blocks are recommended as
+ * multiple operations have to be executed at once.
+ *
+ * @author Costin Leau
+ *
+ */
+public class Counter {
+
+	private int counter = 0;
+
+	private static final Log log = LogFactory.getLog(Counter.class);
+
+	private final String name;
+
+	/**
+	 * Create counter with a given name.
+	 * @param name counter name
+	 */
+	public Counter(String name) {
+		this.name = name;
+	}
+
+	/**
+	 * Increment the counter value.
+	 */
+	public synchronized void increment() {
+		counter++;
+		if (log.isTraceEnabled())
+			log.trace("counter [" + name + "] incremented to " + counter);
+	}
+
+	/**
+	 * Decrement the counter value.
+	 */
+	public synchronized void decrement() {
+		counter--;
+		if (log.isTraceEnabled())
+			log.trace("counter [" + name + "] decremented to " + counter);
+		notifyAll();
+	}
+
+	public synchronized boolean decrementAndWait(long timeToWait) {
+		decrement();
+		if (counter > 0)
+			return waitForZero(timeToWait);
+		return true;
+	}
+
+	/**
+	 * Check if the counter value is zero.
+	 * @return true if value is equal or below zero, false otherwise.
+	 */
+	public synchronized boolean isZero() {
+		return is(0);
+	}
+
+	public synchronized boolean is(int value) {
+		return counter == value;
+	}
+
+	/**
+	 * Return the counter value.
+	 *
+	 * @return the counter value.
+	 */
+	public synchronized int getValue() {
+		return counter;
+	}
+
+	public synchronized String toString() {
+		return "" + counter;
+	}
+
+	/**
+	 * Specialized method which waits for 0. Identical to waitFor(0, waitTime).
+	 *
+	 * @see #waitFor(int, long)
+	 * @param waitTime
+	 * @return true if the waiting timed out, false otherwise
+	 */
+	public synchronized boolean waitForZero(long waitTime) {
+		return waitFor(0, waitTime);
+	}
+
+	/**
+	 * Wait maximum the givem amount of time, for the counter to reach the given
+	 * value.. This mechanism relies on {@link Object#wait(long)} and
+	 * {@link Object#notify()} mechanism to work appropriately. Please see the
+	 * class javadoc for more info.
+	 *
+	 * <p/> This method will stop waiting and return true if the thread
+	 * is interrupted.
+	 *
+	 * @param value the value to wait for
+	 * @param waitTime the time (in miliseconds) to wait for zero value
+	 * @return true if the waiting timed out, false otherwise
+	 */
+	public synchronized boolean waitFor(int value, long waitTime) {
+		boolean timedout = false;
+		long remainingTime = waitTime;
+		long startTime = System.currentTimeMillis();
+
+		while (counter > value && !timedout) {
+			// start waiting
+			try {
+				this.wait(remainingTime);
+				// compute the remaining time
+				remainingTime = waitTime - (System.currentTimeMillis() - startTime);
+				timedout = remainingTime <= 0;
+			}
+			catch (InterruptedException ex) {
+				timedout = true;
+			}
+		}
+
+		return timedout;
+	}
+}

Added: servicemix/smx4/nmr/trunk/testing/support/src/main/java/org/apache/servicemix/platform/testing/support/FrameworkUtil.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/testing/support/src/main/java/org/apache/servicemix/platform/testing/support/FrameworkUtil.java?rev=812215&view=auto
==============================================================================
--- servicemix/smx4/nmr/trunk/testing/support/src/main/java/org/apache/servicemix/platform/testing/support/FrameworkUtil.java (added)
+++ servicemix/smx4/nmr/trunk/testing/support/src/main/java/org/apache/servicemix/platform/testing/support/FrameworkUtil.java Mon Sep  7 16:10:11 2009
@@ -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.platform.testing.support;
+
+import org.osgi.framework.Filter;
+import org.osgi.framework.InvalidSyntaxException;
+
+/**
+ */
+public class FrameworkUtil {
+
+    public static Filter createFilter(String f) throws InvalidSyntaxException {
+        return org.osgi.framework.FrameworkUtil.createFilter(f);
+    }
+
+}