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/01/18 10:28:43 UTC

svn commit: r613113 [1/3] - in /servicemix/smx4: kernel/ kernel/tags/runtime-1.0-m1/ kernel/trunk/ kernel/trunk/assembly/ kernel/trunk/assembly/src/main/descriptors/ kernel/trunk/assembly/src/main/distribution/text/etc/ kernel/trunk/assembly/src/main/f...

Author: gnodet
Date: Fri Jan 18 01:28:33 2008
New Revision: 613113

URL: http://svn.apache.org/viewvc?rev=613113&view=rev
Log:
Rename runtime to kernel

Added:
    servicemix/smx4/kernel/
      - copied from r611441, servicemix/smx4/runtime/
    servicemix/smx4/kernel/trunk/
      - copied from r611587, servicemix/smx4/runtime/trunk/
    servicemix/smx4/kernel/trunk/filemonitor/pom.xml
      - copied, changed from r611598, servicemix/smx4/runtime/trunk/filemonitor/pom.xml
    servicemix/smx4/kernel/trunk/filemonitor/src/main/java/org/apache/servicemix/kernel/
    servicemix/smx4/kernel/trunk/filemonitor/src/main/java/org/apache/servicemix/kernel/filemonitor/
    servicemix/smx4/kernel/trunk/filemonitor/src/main/java/org/apache/servicemix/kernel/filemonitor/DeploymentListener.java
    servicemix/smx4/kernel/trunk/filemonitor/src/main/java/org/apache/servicemix/kernel/filemonitor/FileMonitor.java
    servicemix/smx4/kernel/trunk/filemonitor/src/main/java/org/apache/servicemix/kernel/filemonitor/FileMonitorActivator.java
    servicemix/smx4/kernel/trunk/filemonitor/src/main/java/org/apache/servicemix/kernel/filemonitor/Scanner.java
    servicemix/smx4/kernel/trunk/filemonitor/src/test/java/org/apache/servicemix/kernel/
    servicemix/smx4/kernel/trunk/filemonitor/src/test/java/org/apache/servicemix/kernel/filemonitor/
    servicemix/smx4/kernel/trunk/filemonitor/src/test/java/org/apache/servicemix/kernel/filemonitor/BundlePackerTest.java
    servicemix/smx4/kernel/trunk/gshell/gshell-wrapper/src/main/java/org/apache/servicemix/kernel/
    servicemix/smx4/kernel/trunk/gshell/gshell-wrapper/src/main/java/org/apache/servicemix/kernel/gshell/
    servicemix/smx4/kernel/trunk/gshell/gshell-wrapper/src/main/java/org/apache/servicemix/kernel/gshell/wrapper/
    servicemix/smx4/kernel/trunk/gshell/gshell-wrapper/src/main/java/org/apache/servicemix/kernel/gshell/wrapper/InstallCommand.java
    servicemix/smx4/kernel/trunk/gshell/gshell-wrapper/src/main/resources/org/apache/servicemix/kernel/
    servicemix/smx4/kernel/trunk/gshell/gshell-wrapper/src/main/resources/org/apache/servicemix/kernel/gshell/
    servicemix/smx4/kernel/trunk/gshell/gshell-wrapper/src/main/resources/org/apache/servicemix/kernel/gshell/wrapper/
    servicemix/smx4/kernel/trunk/gshell/gshell-wrapper/src/main/resources/org/apache/servicemix/kernel/gshell/wrapper/all/
    servicemix/smx4/kernel/trunk/gshell/gshell-wrapper/src/main/resources/org/apache/servicemix/kernel/gshell/wrapper/all/servicemix-wrapper.conf
    servicemix/smx4/kernel/trunk/gshell/gshell-wrapper/src/main/resources/org/apache/servicemix/kernel/gshell/wrapper/all/servicemix-wrapper.jar   (with props)
    servicemix/smx4/kernel/trunk/gshell/gshell-wrapper/src/main/resources/org/apache/servicemix/kernel/gshell/wrapper/linux/
    servicemix/smx4/kernel/trunk/gshell/gshell-wrapper/src/main/resources/org/apache/servicemix/kernel/gshell/wrapper/linux/libwrapper.so   (with props)
    servicemix/smx4/kernel/trunk/gshell/gshell-wrapper/src/main/resources/org/apache/servicemix/kernel/gshell/wrapper/linux/servicemix-wrapper   (with props)
    servicemix/smx4/kernel/trunk/gshell/gshell-wrapper/src/main/resources/org/apache/servicemix/kernel/gshell/wrapper/macosx/
    servicemix/smx4/kernel/trunk/gshell/gshell-wrapper/src/main/resources/org/apache/servicemix/kernel/gshell/wrapper/macosx/libwrapper.jnilib   (with props)
    servicemix/smx4/kernel/trunk/gshell/gshell-wrapper/src/main/resources/org/apache/servicemix/kernel/gshell/wrapper/macosx/servicemix-wrapper   (with props)
    servicemix/smx4/kernel/trunk/gshell/gshell-wrapper/src/main/resources/org/apache/servicemix/kernel/gshell/wrapper/unix/
    servicemix/smx4/kernel/trunk/gshell/gshell-wrapper/src/main/resources/org/apache/servicemix/kernel/gshell/wrapper/unix/servicemix-service   (with props)
    servicemix/smx4/kernel/trunk/gshell/gshell-wrapper/src/main/resources/org/apache/servicemix/kernel/gshell/wrapper/windows/
    servicemix/smx4/kernel/trunk/gshell/gshell-wrapper/src/main/resources/org/apache/servicemix/kernel/gshell/wrapper/windows/servicemix-service.bat
    servicemix/smx4/kernel/trunk/gshell/gshell-wrapper/src/main/resources/org/apache/servicemix/kernel/gshell/wrapper/windows/servicemix-wrapper.exe   (with props)
    servicemix/smx4/kernel/trunk/gshell/gshell-wrapper/src/main/resources/org/apache/servicemix/kernel/gshell/wrapper/windows/wrapper.dll   (with props)
    servicemix/smx4/kernel/trunk/main/pom.xml
      - copied, changed from r611617, servicemix/smx4/runtime/trunk/main/pom.xml
    servicemix/smx4/kernel/trunk/main/src/main/java/org/apache/servicemix/kernel/
    servicemix/smx4/kernel/trunk/main/src/main/java/org/apache/servicemix/kernel/main/
    servicemix/smx4/kernel/trunk/main/src/main/java/org/apache/servicemix/kernel/main/Main.java
    servicemix/smx4/kernel/trunk/main/src/main/java/org/apache/servicemix/kernel/main/spi/
    servicemix/smx4/kernel/trunk/main/src/main/java/org/apache/servicemix/kernel/main/spi/MainService.java
    servicemix/smx4/kernel/trunk/testing/support/src/main/java/org/apache/servicemix/kernel/
    servicemix/smx4/kernel/trunk/testing/support/src/main/java/org/apache/servicemix/kernel/testing/
    servicemix/smx4/kernel/trunk/testing/support/src/main/java/org/apache/servicemix/kernel/testing/support/
    servicemix/smx4/kernel/trunk/testing/support/src/main/java/org/apache/servicemix/kernel/testing/support/AbstractIntegrationTest.java
    servicemix/smx4/kernel/trunk/testing/support/src/main/java/org/apache/servicemix/kernel/testing/support/Counter.java
    servicemix/smx4/kernel/trunk/testing/support/src/test/java/org/apache/servicemix/kernel/
    servicemix/smx4/kernel/trunk/testing/support/src/test/java/org/apache/servicemix/kernel/testing/
    servicemix/smx4/kernel/trunk/testing/support/src/test/java/org/apache/servicemix/kernel/testing/support/
    servicemix/smx4/kernel/trunk/testing/support/src/test/java/org/apache/servicemix/kernel/testing/support/AbstractIntegrationTestTest.java
Removed:
    servicemix/smx4/kernel/tags/runtime-1.0-m1/
    servicemix/smx4/kernel/trunk/assembly/expand-camel-example
    servicemix/smx4/kernel/trunk/assembly/install-camel
    servicemix/smx4/kernel/trunk/assembly/install-camel-example
    servicemix/smx4/kernel/trunk/assembly/rebuild
    servicemix/smx4/kernel/trunk/filemonitor/src/main/java/org/apache/servicemix/runtime/
    servicemix/smx4/kernel/trunk/filemonitor/src/test/java/org/apache/servicemix/runtime/
    servicemix/smx4/kernel/trunk/gshell/gshell-wrapper/src/main/java/org/apache/servicemix/runtime/
    servicemix/smx4/kernel/trunk/gshell/gshell-wrapper/src/main/resources/org/apache/servicemix/runtime/
    servicemix/smx4/kernel/trunk/main/src/main/java/org/apache/servicemix/runtime/
    servicemix/smx4/kernel/trunk/testing/support/src/main/java/org/apache/servicemix/runtime/
    servicemix/smx4/kernel/trunk/testing/support/src/test/java/org/apache/servicemix/runtime/
    servicemix/smx4/runtime/
Modified:
    servicemix/smx4/kernel/trunk/BUILDING.txt
    servicemix/smx4/kernel/trunk/README.txt
    servicemix/smx4/kernel/trunk/RELEASE-NOTES.txt
    servicemix/smx4/kernel/trunk/assembly/pom.xml
    servicemix/smx4/kernel/trunk/assembly/src/main/descriptors/unix-bin.xml
    servicemix/smx4/kernel/trunk/assembly/src/main/descriptors/windows-bin.xml
    servicemix/smx4/kernel/trunk/assembly/src/main/distribution/text/etc/config.properties
    servicemix/smx4/kernel/trunk/assembly/src/main/filtered-resources/etc/startup.properties
    servicemix/smx4/kernel/trunk/bundles/ant/pom.xml
    servicemix/smx4/kernel/trunk/bundles/aopalliance/pom.xml
    servicemix/smx4/kernel/trunk/bundles/asm/pom.xml
    servicemix/smx4/kernel/trunk/bundles/cglib/pom.xml
    servicemix/smx4/kernel/trunk/bundles/junit/pom.xml
    servicemix/smx4/kernel/trunk/bundles/mina/pom.xml
    servicemix/smx4/kernel/trunk/bundles/pom.xml
    servicemix/smx4/kernel/trunk/bundles/xstream/pom.xml
    servicemix/smx4/kernel/trunk/gshell/gshell-core/pom.xml
    servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/GShell.java
    servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/resources/META-INF/spring/gshell-local.xml
    servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/resources/org/apache/geronimo/gshell/spring/etc/config.properties
    servicemix/smx4/kernel/trunk/gshell/gshell-features/pom.xml
    servicemix/smx4/kernel/trunk/gshell/gshell-obr/pom.xml
    servicemix/smx4/kernel/trunk/gshell/gshell-osgi/pom.xml
    servicemix/smx4/kernel/trunk/gshell/gshell-wrapper/pom.xml
    servicemix/smx4/kernel/trunk/gshell/gshell-wrapper/src/main/resources/META-INF/spring/gshell-osgi.xml
    servicemix/smx4/kernel/trunk/gshell/pom.xml
    servicemix/smx4/kernel/trunk/pom.xml
    servicemix/smx4/kernel/trunk/testing/depends-maven-plugin/pom.xml
    servicemix/smx4/kernel/trunk/testing/pom.xml
    servicemix/smx4/kernel/trunk/testing/support/pom.xml

Modified: servicemix/smx4/kernel/trunk/BUILDING.txt
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/BUILDING.txt?rev=613113&r1=611587&r2=613113&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/BUILDING.txt (original)
+++ servicemix/smx4/kernel/trunk/BUILDING.txt Fri Jan 18 01:28:33 2008
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-Building Apache ServiceMix Runtime
+Building Apache ServiceMix Kernel
 ===================================
 
 Initial Setup
@@ -36,13 +36,13 @@
 Building
 --------
 
-1) Change to the top level directory of Apache ServiceMix Runtime source distribution.
+1) Change to the top level directory of Apache ServiceMix Kernel source distribution.
 2) Run
 	$> mvn.
-   This will compile Apache ServiceMix Runtime and run all of the tests in the 
-   Apache ServiceMix Runtime source distribution. Alternatively, you can run
+   This will compile Apache ServiceMix Kernel and run all of the tests in the 
+   Apache ServiceMix Kernel source distribution. Alternatively, you can run
          $> mvn -Pfastinstall.
-   This will compile Apache ServiceMix Runtime without running the tests and takes less
+   This will compile Apache ServiceMix Kernel without running the tests and takes less
    time to build.
    Depending on the load of remote Maven 2.0 repositories, you may have 
    to run "mvn" several times until the required dependencies are 

Modified: servicemix/smx4/kernel/trunk/README.txt
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/README.txt?rev=613113&r1=611587&r2=613113&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/README.txt (original)
+++ servicemix/smx4/kernel/trunk/README.txt Fri Jan 18 01:28:33 2008
@@ -15,9 +15,9 @@
  * limitations under the License.
  */
 
-Welcome to Apache ServiceMix Runtime 
+Welcome to Apache ServiceMix Kernel 
 ====================================
-Apache ServiceMix Runtime is a small OSGi based runtime which provides a 
+Apache ServiceMix Kernel is a small OSGi based kernel which provides a 
 lightweight container onto which various bundles can be deployed.
 
 The following features are included:
@@ -31,15 +31,15 @@
 
 Getting Started
 ===============
-For an Apache ServiceMix Runtime source distribution, please read 
-BUILDING.txt for instructions on building Apache ServiceMix Runtime. 
+For an Apache ServiceMix Kernel source distribution, please read 
+BUILDING.txt for instructions on building Apache ServiceMix Kernel. 
 
-For an Apache ServiceMix Runtime binary distribution, please read 
+For an Apache ServiceMix Kernel binary distribution, please read 
 RELEASE-NOTES.txt for installation instructions and list of supported 
 and unsupported features.
 
 Alternatively, you can also find out how to get started here:
-    http://servicemix.apache.org/runtime/home.html
+    http://servicemix.apache.org/kernel/home.html
 
 If you need more help try talking to us on our mailing lists
     http://servicemix.apache.org/mailing-lists.html

Modified: servicemix/smx4/kernel/trunk/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/RELEASE-NOTES.txt?rev=613113&r1=611587&r2=613113&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/RELEASE-NOTES.txt (original)
+++ servicemix/smx4/kernel/trunk/RELEASE-NOTES.txt Fri Jan 18 01:28:33 2008
@@ -15,12 +15,12 @@
  * limitations under the License.
  */
 
-                  Apache ServiceMix Runtime 1.0-m2
+                  Apache ServiceMix Kernel 1.0-m2
                   ================================
 
-See the README.txt file for more general informations about ServiceMix Runtime.
+See the README.txt file for more general informations about ServiceMix Kernel.
 
-This is the second milestone of ServiceMix Runtime.  All the features are not 
+This is the second milestone of ServiceMix Kernel.  All the features are not 
 implemented yet and things may be changed until the final 1.0 release.
 Please refer to the web site for more informations and feel free to ask any
 questions on the ServiceMix mailing lists or simply to provide feedback 
@@ -31,7 +31,7 @@
   *
 
 
-Thanks you for downloading ServiceMix Runtime.  Enjoy !
+Thanks you for downloading ServiceMix Kernel.  Enjoy !
 
 The ServiceMix Team
 http://servicemix.apache.org/team.html

Modified: servicemix/smx4/kernel/trunk/assembly/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/assembly/pom.xml?rev=613113&r1=611587&r2=613113&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/assembly/pom.xml (original)
+++ servicemix/smx4/kernel/trunk/assembly/pom.xml Fri Jan 18 01:28:33 2008
@@ -22,27 +22,27 @@
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
-        <groupId>org.apache.servicemix.runtime</groupId>
-        <artifactId>runtime</artifactId>
-        <version>1.0-m2-SNAPSHOT</version>
+        <groupId>org.apache.servicemix.kernel</groupId>
+        <artifactId>kernel</artifactId>
+        <version>1.0-m1-SNAPSHOT</version>
     </parent>
 
-    <groupId>org.apache.servicemix.runtime</groupId>
-    <artifactId>apache-servicemix-runtime</artifactId>
+    <groupId>org.apache.servicemix.kernel</groupId>
+    <artifactId>apache-servicemix-kernel</artifactId>
     <packaging>pom</packaging>
-    <version>1.0-m2-SNAPSHOT</version>
-    <name>ServiceMix Runtime :: Assembly</name>
+    <version>1.0-m1-SNAPSHOT</version>
+    <name>ServiceMix Kernel :: Assembly</name>
 
     <dependencies>
         <dependency>
-            <groupId>org.apache.servicemix.runtime</groupId>
-            <artifactId>org.apache.servicemix.runtime.main</artifactId>
-            <version>1.0-m2-SNAPSHOT</version>
+            <groupId>org.apache.servicemix.kernel</groupId>
+            <artifactId>org.apache.servicemix.kernel.main</artifactId>
+            <version>1.0-m1-SNAPSHOT</version>
         </dependency>
         <dependency>
-            <groupId>org.apache.servicemix.runtime</groupId>
-            <artifactId>org.apache.servicemix.runtime.filemonitor</artifactId>
-            <version>1.0-m2-SNAPSHOT</version>
+            <groupId>org.apache.servicemix.kernel</groupId>
+            <artifactId>org.apache.servicemix.kernel.filemonitor</artifactId>
+            <version>1.0-m1-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.springframework.osgi</groupId>
@@ -90,49 +90,49 @@
           <version>${felix.bundlerepository.version}</version>
       </dependency>
       <dependency>
-          <groupId>org.apache.servicemix.runtime.gshell</groupId>
-          <artifactId>org.apache.servicemix.runtime.gshell.core</artifactId>
-          <version>1.0-m2-SNAPSHOT</version>
+          <groupId>org.apache.servicemix.kernel.gshell</groupId>
+          <artifactId>org.apache.servicemix.kernel.gshell.core</artifactId>
+          <version>1.0-m1-SNAPSHOT</version>
       </dependency>
       <dependency>
-          <groupId>org.apache.servicemix.runtime.gshell</groupId>
-          <artifactId>org.apache.servicemix.runtime.gshell.obr</artifactId>
-          <version>1.0-m2-SNAPSHOT</version>
+          <groupId>org.apache.servicemix.kernel.gshell</groupId>
+          <artifactId>org.apache.servicemix.kernel.gshell.obr</artifactId>
+          <version>1.0-m1-SNAPSHOT</version>
       </dependency>
       <dependency>
-          <groupId>org.apache.servicemix.runtime.gshell</groupId>
-          <artifactId>org.apache.servicemix.runtime.gshell.osgi</artifactId>
-          <version>1.0-m2-SNAPSHOT</version>
+          <groupId>org.apache.servicemix.kernel.gshell</groupId>
+          <artifactId>org.apache.servicemix.kernel.gshell.osgi</artifactId>
+          <version>1.0-m1-SNAPSHOT</version>
       </dependency>
         <dependency>
-            <groupId>org.apache.servicemix.runtime.gshell</groupId>
-            <artifactId>org.apache.servicemix.runtime.gshell.features</artifactId>
-            <version>1.0-m2-SNAPSHOT</version>
+            <groupId>org.apache.servicemix.kernel.gshell</groupId>
+            <artifactId>org.apache.servicemix.kernel.gshell.features</artifactId>
+            <version>1.0-m1-SNAPSHOT</version>
         </dependency>
       <dependency>
           <groupId>org.apache.servicemix.bundles</groupId>
           <artifactId>org.apache.servicemix.bundles.mina-${mina.version}</artifactId>
-          <version>1.0-m2-SNAPSHOT</version>
+          <version>1.0-m1-SNAPSHOT</version>
       </dependency>
       <dependency>
           <groupId>org.apache.servicemix.bundles</groupId>
           <artifactId>org.apache.servicemix.bundles.xstream-${xstream.version}</artifactId>
-          <version>1.0-m2-SNAPSHOT</version>
+          <version>1.0-m1-SNAPSHOT</version>
       </dependency>
       <dependency>
           <groupId>org.apache.servicemix.bundles</groupId>
           <artifactId>org.apache.servicemix.bundles.aopalliance-${aopalliance.version}</artifactId>
-          <version>1.0-m2-SNAPSHOT</version>
+          <version>1.0-m1-SNAPSHOT</version>
       </dependency>
       <dependency>
           <groupId>org.apache.servicemix.bundles</groupId>
           <artifactId>org.apache.servicemix.bundles.asm-${asm.version}</artifactId>
-          <version>1.0-m2-SNAPSHOT</version>
+          <version>1.0-m1-SNAPSHOT</version>
       </dependency>
       <dependency>
           <groupId>org.apache.servicemix.bundles</groupId>
           <artifactId>org.apache.servicemix.bundles.cglib-${cglib.version}</artifactId>
-          <version>1.0-m2-SNAPSHOT</version>
+          <version>1.0-m1-SNAPSHOT</version>
       </dependency>
       <dependency>
           <groupId>org.apache.felix</groupId>
@@ -217,8 +217,8 @@
                         <configuration>
                             <artifactItems>
                                 <artifactItem>
-                                    <groupId>org.apache.servicemix.runtime</groupId>
-                                    <artifactId>org.apache.servicemix.runtime.main</artifactId>
+                                    <groupId>org.apache.servicemix.kernel</groupId>
+                                    <artifactId>org.apache.servicemix.kernel.main</artifactId>
                                     <version>${pom.version}</version>
                                     <outputDirectory>target/dependencies</outputDirectory>
                                     <destFileName>servicemix.jar</destFileName>

Modified: servicemix/smx4/kernel/trunk/assembly/src/main/descriptors/unix-bin.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/assembly/src/main/descriptors/unix-bin.xml?rev=613113&r1=611587&r2=613113&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/assembly/src/main/descriptors/unix-bin.xml (original)
+++ servicemix/smx4/kernel/trunk/assembly/src/main/descriptors/unix-bin.xml Fri Jan 18 01:28:33 2008
@@ -114,7 +114,7 @@
 
                 <!-- PAX config -->
                 <include>org.apache.felix:org.apache.felix.configadmin</include>
-                <include>org.apache.servicemix.runtime:org.apache.servicemix.runtime.filemonitor</include>
+                <include>org.apache.servicemix.kernel:org.apache.servicemix.kernel.filemonitor</include>
                 <include>org.apache.servicemix.bundles:org.apache.servicemix.bundles.ant-${ant.version}</include>
 
                 <!-- Spring OSGi -->
@@ -132,14 +132,14 @@
                 <include>org.apache.geronimo.specs:geronimo-stax-api_1.0_spec</include>
                 <include>org.apache.servicemix.bundles:org.apache.servicemix.bundles.mina-${mina.version}</include>
                 <include>org.apache.servicemix.bundles:org.apache.servicemix.bundles.xstream-${xstream.version}</include>
-                <include>org.apache.servicemix.runtime.gshell:org.apache.servicemix.runtime.gshell.core</include>
-                <include>org.apache.servicemix.runtime.gshell:org.apache.servicemix.runtime.gshell.osgi</include>
+                <include>org.apache.servicemix.kernel.gshell:org.apache.servicemix.kernel.gshell.core</include>
+                <include>org.apache.servicemix.kernel.gshell:org.apache.servicemix.kernel.gshell.osgi</include>
 
 		        <!-- OBR + GShell command -->
                 <include>org.apache.felix:org.apache.felix.bundlerepository</include>
                 <include>org.ops4j.pax.runner:pax-runner-handler-mvn</include>
-                <include>org.apache.servicemix.runtime.gshell:org.apache.servicemix.runtime.gshell.obr</include>
-                <include>org.apache.servicemix.runtime.gshell:org.apache.servicemix.runtime.gshell.features</include>
+                <include>org.apache.servicemix.kernel.gshell:org.apache.servicemix.kernel.gshell.obr</include>
+                <include>org.apache.servicemix.kernel.gshell:org.apache.servicemix.kernel.gshell.features</include>
 
             </includes>
         </dependencySet>

Modified: servicemix/smx4/kernel/trunk/assembly/src/main/descriptors/windows-bin.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/assembly/src/main/descriptors/windows-bin.xml?rev=613113&r1=611587&r2=613113&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/assembly/src/main/descriptors/windows-bin.xml (original)
+++ servicemix/smx4/kernel/trunk/assembly/src/main/descriptors/windows-bin.xml Fri Jan 18 01:28:33 2008
@@ -106,7 +106,7 @@
 
                 <!-- PAX config -->
                 <include>org.apache.felix:org.apache.felix.configadmin</include>
-                <include>org.apache.servicemix.runtime:org.apache.servicemix.runtime.filemonitor</include>
+                <include>org.apache.servicemix.kernel:org.apache.servicemix.kernel.filemonitor</include>
                 <include>org.apache.servicemix.bundles:org.apache.servicemix.bundles.ant-${ant.version}</include>
 
                 <!-- Spring OSGi -->
@@ -124,14 +124,14 @@
                 <include>org.apache.geronimo.specs:geronimo-stax-api_1.0_spec</include>
                 <include>org.apache.servicemix.bundles:org.apache.servicemix.bundles.mina-${mina.version}</include>
                 <include>org.apache.servicemix.bundles:org.apache.servicemix.bundles.xstream-${xstream.version}</include>
-                <include>org.apache.servicemix.runtime.gshell:org.apache.servicemix.runtime.gshell.core</include>
-                <include>org.apache.servicemix.runtime.gshell:org.apache.servicemix.runtime.gshell.osgi</include>
+                <include>org.apache.servicemix.kernel.gshell:org.apache.servicemix.kernel.gshell.core</include>
+                <include>org.apache.servicemix.kernel.gshell:org.apache.servicemix.kernel.gshell.osgi</include>
 
 		        <!-- OBR + GShell command -->
                 <include>org.apache.felix:org.apache.felix.bundlerepository</include>
                 <include>org.ops4j.pax.runner:pax-runner-handler-mvn</include>
-                <include>org.apache.servicemix.runtime.gshell:org.apache.servicemix.runtime.gshell.obr</include>
-                <include>org.apache.servicemix.runtime.gshell:org.apache.servicemix.runtime.gshell.features</include>
+                <include>org.apache.servicemix.kernel.gshell:org.apache.servicemix.kernel.gshell.obr</include>
+                <include>org.apache.servicemix.kernel.gshell:org.apache.servicemix.kernel.gshell.features</include>
 
             </includes>
         </dependencySet>

Modified: servicemix/smx4/kernel/trunk/assembly/src/main/distribution/text/etc/config.properties
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/assembly/src/main/distribution/text/etc/config.properties?rev=613113&r1=611587&r2=613113&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/assembly/src/main/distribution/text/etc/config.properties (original)
+++ servicemix/smx4/kernel/trunk/assembly/src/main/distribution/text/etc/config.properties Fri Jan 18 01:28:33 2008
@@ -24,7 +24,7 @@
  org.osgi.service.packageadmin; version=1.2.0, \
  org.osgi.service.startlevel; version=1.0.0, \
  org.osgi.service.url; version=1.0.0, \
- org.apache.servicemix.runtime.main.spi, \
+ org.apache.servicemix.kernel.main.spi, \
  com.sun.management, \
  ${jre-${java.specification.version}}
 #org.osgi.framework.bootdelegation=sun.*,com.sun.*

Modified: servicemix/smx4/kernel/trunk/assembly/src/main/filtered-resources/etc/startup.properties
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/assembly/src/main/filtered-resources/etc/startup.properties?rev=613113&r1=611587&r2=613113&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/assembly/src/main/filtered-resources/etc/startup.properties (original)
+++ servicemix/smx4/kernel/trunk/assembly/src/main/filtered-resources/etc/startup.properties Fri Jan 18 01:28:33 2008
@@ -26,7 +26,7 @@
 geronimo-servlet_2.5_spec-${geronimo.servlet.version}.jar=10
 org.osgi.compendium-${felix.compendium.version}.jar=10
 org.apache.felix.configadmin-${felix.configadmin.version}.jar=10
-org.apache.servicemix.runtime.filemonitor-${version}.jar=15
+org.apache.servicemix.kernel.filemonitor-${version}.jar=15
 pax-logging-api-${pax.logging.version}.jar=20
 pax-logging-service-${pax.logging.version}.jar=20
 
@@ -48,12 +48,12 @@
 spring-osgi-io-${spring.osgi.version}.jar=50
 org.apache.felix.bundlerepository-${felix.bundlerepository.version}.jar=50
 pax-runner-handler-mvn-${pax.runner.version}.jar=50
-org.apache.servicemix.runtime.gshell.obr-${version}.jar=50
-org.apache.servicemix.runtime.gshell.osgi-${version}.jar=50
-org.apache.servicemix.runtime.gshell.features-${version}.jar=50
+org.apache.servicemix.kernel.gshell.obr-${version}.jar=50
+org.apache.servicemix.kernel.gshell.osgi-${version}.jar=50
+org.apache.servicemix.kernel.gshell.features-${version}.jar=50
 
 #
 # Start console last
 #
-org.apache.servicemix.runtime.gshell.core-${version}.jar=100
+org.apache.servicemix.kernel.gshell.core-${version}.jar=100
 

Modified: servicemix/smx4/kernel/trunk/bundles/ant/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/bundles/ant/pom.xml?rev=613113&r1=611587&r2=613113&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/bundles/ant/pom.xml (original)
+++ servicemix/smx4/kernel/trunk/bundles/ant/pom.xml Fri Jan 18 01:28:33 2008
@@ -22,15 +22,15 @@
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
-        <groupId>org.apache.servicemix.runtime.bundles</groupId>
+        <groupId>org.apache.servicemix.kernel.bundles</groupId>
         <artifactId>bundles</artifactId>
-        <version>1.0-m2-SNAPSHOT</version>
+        <version>1.0-m1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.servicemix.bundles</groupId>
     <artifactId>${pom.groupId}.${pkgArtifactId}-${pkgVersion}</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0-m2-SNAPSHOT</version>
+    <version>1.0-m1-SNAPSHOT</version>
     <name>ServiceMix OSGI Common Bundles: ${pkgArtifactId}-${pkgVersion}</name>
     <description>
         This bundle simply wraps ${pkgArtifactId}-${pkgVersion}.jar.

Modified: servicemix/smx4/kernel/trunk/bundles/aopalliance/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/bundles/aopalliance/pom.xml?rev=613113&r1=611587&r2=613113&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/bundles/aopalliance/pom.xml (original)
+++ servicemix/smx4/kernel/trunk/bundles/aopalliance/pom.xml Fri Jan 18 01:28:33 2008
@@ -22,15 +22,15 @@
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
-        <groupId>org.apache.servicemix.runtime.bundles</groupId>
+        <groupId>org.apache.servicemix.kernel.bundles</groupId>
         <artifactId>bundles</artifactId>
-        <version>1.0-m2-SNAPSHOT</version>
+        <version>1.0-m1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.servicemix.bundles</groupId>
     <artifactId>${pom.groupId}.${pkgArtifactId}-${pkgVersion}</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0-m2-SNAPSHOT</version>
+    <version>1.0-m1-SNAPSHOT</version>
     <name>ServiceMix OSGI Common Bundles: ${pkgArtifactId}-${pkgVersion}</name>
     <description>
         This bundle simply wraps ${pkgArtifactId}-${pkgVersion}.jar.

Modified: servicemix/smx4/kernel/trunk/bundles/asm/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/bundles/asm/pom.xml?rev=613113&r1=611587&r2=613113&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/bundles/asm/pom.xml (original)
+++ servicemix/smx4/kernel/trunk/bundles/asm/pom.xml Fri Jan 18 01:28:33 2008
@@ -22,15 +22,15 @@
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
-        <groupId>org.apache.servicemix.runtime.bundles</groupId>
+        <groupId>org.apache.servicemix.kernel.bundles</groupId>
         <artifactId>bundles</artifactId>
-        <version>1.0-m2-SNAPSHOT</version>
+        <version>1.0-m1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.servicemix.bundles</groupId>
     <artifactId>${pom.groupId}.${pkgArtifactId}-${pkgVersion}</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0-m2-SNAPSHOT</version>
+    <version>1.0-m1-SNAPSHOT</version>
     <name>ServiceMix OSGI Common Bundles: ${pkgArtifactId}-${pkgVersion}</name>
     <description>
         This bundle simply wraps ${pkgArtifactId}-${pkgVersion}.jar.

Modified: servicemix/smx4/kernel/trunk/bundles/cglib/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/bundles/cglib/pom.xml?rev=613113&r1=611587&r2=613113&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/bundles/cglib/pom.xml (original)
+++ servicemix/smx4/kernel/trunk/bundles/cglib/pom.xml Fri Jan 18 01:28:33 2008
@@ -22,15 +22,15 @@
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
-        <groupId>org.apache.servicemix.runtime.bundles</groupId>
+        <groupId>org.apache.servicemix.kernel.bundles</groupId>
         <artifactId>bundles</artifactId>
-        <version>1.0-m2-SNAPSHOT</version>
+        <version>1.0-m1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.servicemix.bundles</groupId>
     <artifactId>${pom.groupId}.${pkgArtifactId}-${pkgVersion}</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0-m2-SNAPSHOT</version>
+    <version>1.0-m1-SNAPSHOT</version>
     <name>ServiceMix OSGI Common Bundles: ${pkgArtifactId}-${pkgVersion}</name>
     <description>
         This bundle simply wraps ${pkgArtifactId}-${pkgVersion}.jar.

Modified: servicemix/smx4/kernel/trunk/bundles/junit/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/bundles/junit/pom.xml?rev=613113&r1=611587&r2=613113&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/bundles/junit/pom.xml (original)
+++ servicemix/smx4/kernel/trunk/bundles/junit/pom.xml Fri Jan 18 01:28:33 2008
@@ -22,15 +22,15 @@
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
-        <groupId>org.apache.servicemix.runtime.bundles</groupId>
+        <groupId>org.apache.servicemix.kernel.bundles</groupId>
         <artifactId>bundles</artifactId>
-        <version>1.0-m2-SNAPSHOT</version>
+        <version>1.0-m1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.servicemix.bundles</groupId>
     <artifactId>${pom.groupId}.${pkgArtifactId}-${pkgVersion}</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0-m2-SNAPSHOT</version>
+    <version>1.0-m1-SNAPSHOT</version>
     <name>ServiceMix OSGI Common Bundles: ${pkgArtifactId}-${pkgVersion}</name>
     <description>
         This bundle simply wraps ${pkgArtifactId}-${pkgVersion}.jar.

Modified: servicemix/smx4/kernel/trunk/bundles/mina/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/bundles/mina/pom.xml?rev=613113&r1=611587&r2=613113&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/bundles/mina/pom.xml (original)
+++ servicemix/smx4/kernel/trunk/bundles/mina/pom.xml Fri Jan 18 01:28:33 2008
@@ -22,15 +22,15 @@
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
-        <groupId>org.apache.servicemix.runtime.bundles</groupId>
+        <groupId>org.apache.servicemix.kernel.bundles</groupId>
         <artifactId>bundles</artifactId>
-        <version>1.0-m2-SNAPSHOT</version>
+        <version>1.0-m1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.servicemix.bundles</groupId>
     <artifactId>${pom.groupId}.${pkgArtifactId}-${pkgVersion}</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0-m2-SNAPSHOT</version>
+    <version>1.0-m1-SNAPSHOT</version>
     <name>ServiceMix OSGI Common Bundles: ${pkgArtifactId}-${pkgVersion}</name>
     <description>
         This bundle simply wraps ${pkgArtifactId}-${pkgVersion}.jar.

Modified: servicemix/smx4/kernel/trunk/bundles/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/bundles/pom.xml?rev=613113&r1=611587&r2=613113&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/bundles/pom.xml (original)
+++ servicemix/smx4/kernel/trunk/bundles/pom.xml Fri Jan 18 01:28:33 2008
@@ -21,15 +21,15 @@
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
-        <groupId>org.apache.servicemix.runtime</groupId>
-        <artifactId>runtime</artifactId>
-        <version>1.0-m2-SNAPSHOT</version>
+        <groupId>org.apache.servicemix.kernel</groupId>
+        <artifactId>kernel</artifactId>
+        <version>1.0-m1-SNAPSHOT</version>
     </parent>
 
-    <groupId>org.apache.servicemix.runtime.bundles</groupId>
+    <groupId>org.apache.servicemix.kernel.bundles</groupId>
     <artifactId>bundles</artifactId>
     <packaging>pom</packaging>
-    <version>1.0-m2-SNAPSHOT</version>
+    <version>1.0-m1-SNAPSHOT</version>
     <name>ServiceMix OSGI Common Bundles</name>
 
     <modules>
@@ -74,4 +74,4 @@
         </plugins>
     </build>
 
-</project>
\ No newline at end of file
+</project>

Modified: servicemix/smx4/kernel/trunk/bundles/xstream/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/bundles/xstream/pom.xml?rev=613113&r1=611587&r2=613113&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/bundles/xstream/pom.xml (original)
+++ servicemix/smx4/kernel/trunk/bundles/xstream/pom.xml Fri Jan 18 01:28:33 2008
@@ -22,15 +22,15 @@
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
-        <groupId>org.apache.servicemix.runtime.bundles</groupId>
+        <groupId>org.apache.servicemix.kernel.bundles</groupId>
         <artifactId>bundles</artifactId>
-        <version>1.0-m2-SNAPSHOT</version>
+        <version>1.0-m1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.servicemix.bundles</groupId>
     <artifactId>${pom.groupId}.${pkgArtifactId}-${pkgVersion}</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0-m2-SNAPSHOT</version>
+    <version>1.0-m1-SNAPSHOT</version>
     <name>ServiceMix OSGI Common Bundles: ${pkgArtifactId}-${pkgVersion}</name>
     <description>
         This bundle simply wraps ${pkgArtifactId}-${pkgVersion}.jar.

Copied: servicemix/smx4/kernel/trunk/filemonitor/pom.xml (from r611598, servicemix/smx4/runtime/trunk/filemonitor/pom.xml)
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/filemonitor/pom.xml?p2=servicemix/smx4/kernel/trunk/filemonitor/pom.xml&p1=servicemix/smx4/runtime/trunk/filemonitor/pom.xml&r1=611598&r2=613113&rev=613113&view=diff
==============================================================================
--- servicemix/smx4/runtime/trunk/filemonitor/pom.xml (original)
+++ servicemix/smx4/kernel/trunk/filemonitor/pom.xml Fri Jan 18 01:28:33 2008
@@ -22,15 +22,15 @@
   <modelVersion>4.0.0</modelVersion>
 
   <parent>
-      <groupId>org.apache.servicemix.runtime</groupId>
-      <artifactId>runtime</artifactId>
-      <version>1.0-m2-SNAPSHOT</version>
+      <groupId>org.apache.servicemix.kernel</groupId>
+      <artifactId>kernel</artifactId>
+      <version>1.0-m1-SNAPSHOT</version>
   </parent>
 
-  <artifactId>org.apache.servicemix.runtime.filemonitor</artifactId>
+  <artifactId>org.apache.servicemix.kernel.filemonitor</artifactId>
   <packaging>bundle</packaging>
-  <version>1.0-m2-SNAPSHOT</version>
-  <name>ServiceMix Runtime :: File Monitor</name>
+  <version>1.0-m1-SNAPSHOT</version>
+  <name>ServiceMix Kernel :: File Monitor</name>
 
   <description>This bundle monitors the deploy directory for new OSGi bundles in jar form, expanded form or for configuration file changes and undeploys/redeploys them</description>
 
@@ -108,7 +108,7 @@
             <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
             <Export-Package>${pom.artifactId}</Export-Package>
             <DynamicImport-Package>*</DynamicImport-Package>
-            <Bundle-Activator>org.apache.servicemix.runtime.filemonitor.FileMonitorActivator</Bundle-Activator>
+            <Bundle-Activator>org.apache.servicemix.kernel.filemonitor.FileMonitorActivator</Bundle-Activator>
           </instructions>
         </configuration>
       </plugin>

Added: servicemix/smx4/kernel/trunk/filemonitor/src/main/java/org/apache/servicemix/kernel/filemonitor/DeploymentListener.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/filemonitor/src/main/java/org/apache/servicemix/kernel/filemonitor/DeploymentListener.java?rev=613113&view=auto
==============================================================================
--- servicemix/smx4/kernel/trunk/filemonitor/src/main/java/org/apache/servicemix/kernel/filemonitor/DeploymentListener.java (added)
+++ servicemix/smx4/kernel/trunk/filemonitor/src/main/java/org/apache/servicemix/kernel/filemonitor/DeploymentListener.java Fri Jan 18 01:28:33 2008
@@ -0,0 +1,36 @@
+/**
+ *
+ * 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.kernel.filemonitor;
+
+import java.io.File;
+
+
+public interface DeploymentListener {
+	
+    /**
+     * Returns true if the listener can process the given file
+     */
+    boolean canHandle(File artifact);
+
+   /**
+    * Process the given file (canHandle returned true previously)
+    * Can return <null> or a pointer to a transformed file.
+    */
+    File handle(File artifact, File tmpDir);
+   
+}

Added: servicemix/smx4/kernel/trunk/filemonitor/src/main/java/org/apache/servicemix/kernel/filemonitor/FileMonitor.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/filemonitor/src/main/java/org/apache/servicemix/kernel/filemonitor/FileMonitor.java?rev=613113&view=auto
==============================================================================
--- servicemix/smx4/kernel/trunk/filemonitor/src/main/java/org/apache/servicemix/kernel/filemonitor/FileMonitor.java (added)
+++ servicemix/smx4/kernel/trunk/filemonitor/src/main/java/org/apache/servicemix/kernel/filemonitor/FileMonitor.java Fri Jan 18 01:28:33 2008
@@ -0,0 +1,596 @@
+/**
+ *
+ * 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.kernel.filemonitor;
+
+import java.io.Closeable;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Dictionary;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.jar.JarFile;
+import java.util.jar.Manifest;
+import java.util.jar.Attributes;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.taskdefs.Jar;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.cm.Configuration;
+import org.osgi.service.cm.ConfigurationAdmin;
+import org.osgi.service.packageadmin.PackageAdmin;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ * Watches a deploy directory for files that are added, updated or removed then processing them.
+ * Currently we support OSGi bundles, OSGi configuration files and expanded directories of OSGi bundles.
+ *
+ * @version $Revision: 1.1 $
+ */
+public class FileMonitor {
+	
+    public final static String CONFIG_DIR = "org.apache.servicemix.filemonitor.configDir";
+    public final static String DEPLOY_DIR = "org.apache.servicemix.filemonitor.monitorDir";
+    public final static String GENERATED_JAR_DIR = "org.apache.servicemix.filemonitor.generatedJarDir";
+    public final static String SCAN_INTERVAL = "org.apache.servicemix.filemonitor.scanInterval";
+    protected static final String ALIAS_KEY = "_alias_factory_pid";
+    private static Log logger = LogFactory.getLog(FileMonitor.class);
+    private FileMonitorActivator activator;
+    private File configDir = new File("./etc");
+    private File deployDir = new File("./deploy");
+    private File generateDir = new File("./data/generated-bundles");
+    private Scanner scanner = new Scanner();
+    private Project project = new Project();
+    private long scanInterval = 500L;
+    private boolean loggedConfigAdminWarning;
+    private List<Bundle> changedBundles = new ArrayList<Bundle>();
+    private List<Bundle> bundlesToStart = new ArrayList<Bundle>();
+    private List<Bundle> bundlesToUpdate = new ArrayList<Bundle>();
+    private Map<String, String> artifactToBundle = new HashMap<String, String>();
+
+    public FileMonitor() {
+    }
+
+    public FileMonitor(FileMonitorActivator activator, Dictionary properties) {
+        this.activator = activator;
+
+        File value = getFileValue(properties, CONFIG_DIR);
+        if (value != null) {
+            configDir = value;
+        }
+        value = getFileValue(properties, DEPLOY_DIR);
+        if (value != null) {
+            deployDir = value;
+        }
+        value = getFileValue(properties, GENERATED_JAR_DIR);
+        if (value != null) {
+            generateDir = value;
+        }
+        Long i = getLongValue(properties, SCAN_INTERVAL);
+        if (i != null) {
+            scanInterval = i;
+        }
+    }
+
+    public void start() {
+        if (configDir != null) {
+            configDir.mkdirs();
+        }
+        deployDir.mkdirs();
+        generateDir.mkdirs();
+
+        List<File> dirs = new ArrayList<File>();
+        if (configDir != null) {
+            dirs.add(configDir);
+        }
+        dirs.add(deployDir);
+        scanner.setScanDirs(dirs);
+        scanner.setScanInterval(scanInterval);
+
+        scanner.addListener(new Scanner.BulkListener() {
+            public void filesChanged(List<String> filenames) throws Exception {
+                onFilesChanged(filenames);
+            }
+        });
+
+        logger.info("Starting to monitor the deploy directory: " + deployDir + " every " + scanInterval + " millis");
+        if (configDir != null) {
+            logger.info("Config directory is at: " + configDir);
+        }
+        logger.info("Will generate bundles from expanded source directories to: " + generateDir);
+
+        scanner.start();
+    }
+
+    public void stop() {
+        scanner.stop();
+    }
+
+    // Properties
+    //-------------------------------------------------------------------------
+
+    public BundleContext getContext() {
+        return activator.getContext();
+    }
+
+    public FileMonitorActivator getActivator() {
+        return activator;
+    }
+
+    public void setActivator(FileMonitorActivator activator) {
+        this.activator = activator;
+    }
+
+    public File getConfigDir() {
+        return configDir;
+    }
+
+    public void setConfigDir(File configDir) {
+        this.configDir = configDir;
+    }
+
+    public File getDeployDir() {
+        return deployDir;
+    }
+
+    public void setDeployDir(File deployDir) {
+        this.deployDir = deployDir;
+    }
+
+    public File getGenerateDir() {
+        return generateDir;
+    }
+
+    public void setGenerateDir(File generateDir) {
+        this.generateDir = generateDir;
+    }
+
+    public Project getProject() {
+        return project;
+    }
+
+    public void setProject(Project project) {
+        this.project = project;
+    }
+
+    public long getScanInterval() {
+        return scanInterval;
+    }
+
+    public void setScanInterval(long scanInterval) {
+        this.scanInterval = scanInterval;
+    }
+
+    // Implementation methods
+    //-------------------------------------------------------------------------
+
+    protected void onFilesChanged(List<String> filenames) {
+        changedBundles.clear();
+        bundlesToStart.clear();
+        bundlesToUpdate.clear();
+        Set<File> bundleJarsCreated = new HashSet<File>();
+
+        for (Object filename : filenames) {
+            String name = filename.toString();
+            boolean added = true;
+            
+            File file = new File(name);
+            try {
+                logger.debug("File changed: " + filename + " with type: " + filename.getClass().getName());
+
+                // Handle config files
+                if (isValidConfigFile(file)) {
+                    if (added) {
+                        updateConfiguration(file);
+                    }
+                    else {
+                        deleteConfiguration(file);
+                    }
+                    continue;
+                }
+
+                if (file.exists()) {
+                    file = transformArtifact(file);
+                    if (file == null) {
+                        logger.warn("Unsupported deployment: " + name);
+                        continue;
+                    }
+                } else {
+                	added = false;
+                	String transformedFile = artifactToBundle.get(name);
+                	if (transformedFile != null) {
+                		file = new File(transformedFile);
+                		if (file.exists()) {
+                			file.delete();
+                		}
+                	}
+                }
+
+                // Check artifacts
+                // now lets iterate to find the parent directory
+                File jardir = getExpandedBundleRootDirectory(file);
+                if (jardir != null) {
+                    if (file.exists() && !bundleJarsCreated.contains(jardir)) {
+                        bundleJarsCreated.add(jardir);
+                        File newBundle = createBundleJar(jardir);
+                        deployBundle(newBundle);
+                    }
+                }
+                else if (isValidArtifactFile(file)) {
+                    if (added) {
+                        deployBundle(file);
+                    }
+                    else {
+                        undeployBundle(file);
+                    }
+                }
+                else if (file.getName().equals("MANIFEST.MF")) {
+                    File parentFile = file.getParentFile();
+                    if (parentFile.getName().equals("META-INF")) {
+                        File bundleDir = parentFile.getParentFile();
+                        if (isValidBundleSourceDirectory(bundleDir)) {
+                            undeployBundle(bundleDir);
+                        }
+                    }
+                }
+            }
+            catch (Exception e) {
+                logger.warn("Failed to process: " + file + ". Reason: " + e, e);
+            }
+        }
+        refreshPackagesAndStartOrUpdateBundles();
+    }
+    
+    
+	private File transformArtifact(File file) throws Exception {
+        // Handle OSGi bundles with the default deployer
+        JarFile jar = new JarFile(file);
+        Manifest m = jar.getManifest();
+        if (m.getMainAttributes().getValue(new Attributes.Name("Bundle-SymbolicName")) != null &&
+            m.getMainAttributes().getValue(new Attributes.Name("Bundle-Version")) != null) {
+            return file;
+        }
+        jar.close();
+        // Else delegate to registered deployers
+        ServiceReference[] srvRefs = getContext().getAllServiceReferences(DeploymentListener.class.getName(), null);
+		if(srvRefs != null) {
+		    for(ServiceReference sr : srvRefs) {
+		    	try {
+		    		DeploymentListener deploymentListener = (DeploymentListener)getContext().getService(sr);
+		    		if (deploymentListener.canHandle(file)) {
+		    			File transformedFile =  deploymentListener.handle(file, getGenerateDir());
+		    			artifactToBundle.put(file.getAbsolutePath(), transformedFile.getAbsolutePath());
+		    			return transformedFile;
+		    		}
+		    	} finally {
+		    		getContext().ungetService(sr);
+		    	}
+		    }
+		}
+		return null;
+	}
+
+    protected void deployBundle(File file) throws IOException, BundleException {
+        logger.info("Deloying: " + file.getCanonicalPath());
+
+        InputStream in = new FileInputStream(file);
+
+        try {
+            Bundle bundle = getBundleForJarFile(file);
+            if (bundle != null) {
+                changedBundles.add(bundle);
+                bundlesToUpdate.add(bundle);
+            }
+            else {
+                bundle = getContext().installBundle(file.getCanonicalFile().toURI().toString(), in);
+                if (!isBundleFragment(bundle)) {
+                    bundlesToStart.add(bundle);
+                }
+            }
+        }
+        finally {
+            closeQuietly(in);
+        }
+    }
+
+    protected void undeployBundle(File file) throws BundleException, IOException {
+        logger.info("Undeploying: " + file.getCanonicalPath());
+        Bundle bundle = getBundleForJarFile(file);
+
+        if (bundle == null) {
+            logger.warn("Could not find Bundle for file: " + file.getCanonicalPath());
+        }
+        else {
+            changedBundles.add(bundle);
+            bundle.stop();
+            bundle.uninstall();
+        }
+    }
+
+    protected Bundle getBundleForJarFile(File file) throws IOException {
+        String absoluteFilePath = file.getAbsolutePath();
+        Bundle bundles[] = getContext().getBundles();
+        for (int i = 0; i < bundles.length; i++) {
+            Bundle bundle = bundles[i];
+            String location = bundle.getLocation();
+            if (location.endsWith(absoluteFilePath)) {
+                return bundle;
+            }
+        }
+        return null;
+    }
+
+    protected void updateConfiguration(File file) throws IOException, InvalidSyntaxException {
+        ConfigurationAdmin configurationAdmin = activator.getConfigurationAdmin();
+        if (configurationAdmin == null) {
+            if (!loggedConfigAdminWarning) {
+                logger.warn("No ConfigurationAdmin so cannot deploy configurations");
+                loggedConfigAdminWarning = true;
+            }
+        }
+        else {
+            Properties properties = new Properties();
+            InputStream in = new FileInputStream(file);
+            try {
+                properties.load(in);
+                closeQuietly(in);
+                String[] pid = parsePid(file);
+                Hashtable<Object, Object> hashtable = new Hashtable<Object, Object>();
+                hashtable.putAll(properties);
+                if (pid[1] != null) {
+                    hashtable.put(ALIAS_KEY, pid[1]);
+                }
+
+                Configuration config = getConfiguration(pid[0], pid[1]);
+                if (config.getBundleLocation() != null) {
+                    config.setBundleLocation(null);
+                }
+                config.update(hashtable);
+            }
+            finally {
+                closeQuietly(in);
+            }
+        }
+    }
+
+    protected void deleteConfiguration(File file) throws IOException, InvalidSyntaxException {
+        String[] pid = parsePid(file);
+        Configuration config = getConfiguration(pid[0], pid[1]);
+        config.delete();
+    }
+
+    protected Configuration getConfiguration(String pid, String factoryPid) throws IOException, InvalidSyntaxException {
+        ConfigurationAdmin configurationAdmin = activator.getConfigurationAdmin();
+        if (factoryPid != null) {
+            Configuration[] configs = configurationAdmin.listConfigurations("(|(" + ALIAS_KEY + "=" + pid + ")(.alias_factory_pid=" + factoryPid + "))");
+            if (configs == null || configs.length == 0) {
+                return configurationAdmin.createFactoryConfiguration(pid, null);
+            }
+            else {
+                return configs[0];
+            }
+        }
+        else {
+            return configurationAdmin.getConfiguration(pid, null);
+        }
+    }
+
+    protected String[] parsePid(File file) {
+        String path = file.getName();
+        String pid = path.substring(0, path.length() - 4);
+        int n = pid.indexOf('-');
+        if (n > 0) {
+            String factoryPid = pid.substring(n + 1);
+            pid = pid.substring(0, n);
+            return new String[]{pid, factoryPid};
+        }
+        else {
+            return new String[]{pid, null};
+        }
+    }
+
+    protected PackageAdmin getPackageAdmin() {
+        ServiceTracker packageAdminTracker = activator.getPackageAdminTracker();
+        if (packageAdminTracker != null) {
+            try {
+                return (PackageAdmin) packageAdminTracker.waitForService(5000L);
+            }
+            catch (InterruptedException e) {
+                // ignore
+            }
+        }
+        return null;
+    }
+
+    protected boolean isBundleFragment(Bundle bundle) {
+        PackageAdmin packageAdmin = getPackageAdmin();
+        if (packageAdmin != null) {
+            return packageAdmin.getBundleType(bundle) == PackageAdmin.BUNDLE_TYPE_FRAGMENT;
+        }
+        return false;
+    }
+
+    protected void refreshPackagesAndStartOrUpdateBundles() {
+        PackageAdmin packageAdmin = getPackageAdmin();
+        if (packageAdmin != null) {
+            Bundle[] bundles = new Bundle[changedBundles.size()];
+            changedBundles.toArray(bundles);
+            packageAdmin.refreshPackages(bundles);
+        }
+        changedBundles.clear();
+
+        for (Bundle bundle : bundlesToUpdate) {
+            try {
+                bundle.update();
+                logger.info("Updated: " + bundle);
+
+            }
+            catch (BundleException e) {
+                logger.warn("Failed to update bundle: " + bundle + ". Reason: " + e, e);
+            }
+        }
+        for (Bundle bundle : bundlesToStart) {
+            try {
+                bundle.start();
+                logger.info("Started: " + bundle);
+            }
+            catch (BundleException e) {
+                logger.warn("Failed to start bundle: " + bundle + ". Reason: " + e, e);
+            }
+        }
+    }
+
+    protected File createBundleJar(File dir) throws BundleException, IOException {
+        Jar jar = new Jar();
+        jar.setProject(project);
+        File destFile = new File(generateDir, dir.getName() + ".jar");
+        if (destFile.exists()) {
+            undeployBundle(destFile);
+            destFile.delete();
+        }
+        logger.info("Creating jar:  " + destFile + " from dir: " + dir);
+        jar.setDestFile(destFile);
+        jar.setManifest(new File(new File(dir, "META-INF"), "MANIFEST.MF"));
+        jar.setBasedir(dir);
+
+        jar.init();
+        jar.perform();
+        return destFile;
+    }
+
+    /**
+     * Returns the root directory of the expanded OSGi bundle if the file is part of an expanded OSGi bundle
+     * or null if it is not
+     */
+    protected File getExpandedBundleRootDirectory(File file) throws IOException {
+        File parent = file.getParentFile();
+        if (file.isDirectory()) {
+            String rootPath = deployDir.getCanonicalPath();
+            if (file.getCanonicalPath().equals(rootPath)) {
+                return null;
+            }
+            if (containsManifest(file)) {
+                return file;
+            }
+        }
+        if (isValidBundleSourceDirectory(parent)) {
+            return getExpandedBundleRootDirectory(parent);
+        }
+        return null;
+    }
+
+    /**
+     * Returns true if the given directory is a valid child directory within the {@link #deployDir}
+     */
+    protected boolean isValidBundleSourceDirectory(File dir) throws IOException {
+        if (dir != null) {
+            String parentPath = dir.getCanonicalPath();
+            String rootPath = deployDir.getCanonicalPath();
+            return !parentPath.equals(rootPath) && parentPath.startsWith(rootPath);
+        }
+        else {
+            return false;
+        }
+    }
+
+    /**
+     * Returns true if the given directory is a valid child file within the {@link #deployDir} or a child of {@link #generateDir}
+     */
+    protected boolean isValidArtifactFile(File file) throws IOException {
+        if (file != null) {
+            String filePath = file.getParentFile().getCanonicalPath();
+            String deployPath = deployDir.getCanonicalPath();
+            String generatePath = generateDir.getCanonicalPath();
+            return filePath.equals(deployPath) || filePath.startsWith(generatePath);
+        }
+        else {
+            return false;
+        }
+    }
+
+    /**
+     * Returns true if the given directory is a valid child file within the {@link #configDir}
+     */
+    protected boolean isValidConfigFile(File file) throws IOException {
+        if (file != null && file.getName().endsWith(".cfg")) {
+            String filePath = file.getParentFile().getCanonicalPath();
+            String configPath = configDir.getCanonicalPath();
+            return filePath.equals(configPath);
+        }
+        else {
+            return false;
+        }
+    }
+
+    /**
+     * Returns true if the given directory contains a valid manifest file
+     */
+    protected boolean containsManifest(File dir) {
+        File metaInfDir = new File(dir, "META-INF");
+        if (metaInfDir.exists() && metaInfDir.isDirectory()) {
+            File manifest = new File(metaInfDir, "MANIFEST.MF");
+            return manifest.exists() && !manifest.isDirectory();
+        }
+        return false;
+    }
+
+    protected File getFileValue(Dictionary properties, String key) {
+        Object value = properties.get(key);
+        if (value instanceof File) {
+            return (File) value;
+        }
+        else if (value != null) {
+            return new File(value.toString());
+        }
+        return null;
+    }
+
+    protected Long getLongValue(Dictionary properties, String key) {
+        Object value = properties.get(key);
+        if (value instanceof Long) {
+            return (Long) value;
+        }
+        else if (value != null) {
+            return Long.parseLong(value.toString());
+        }
+        return null;
+    }
+
+    protected void closeQuietly(Closeable in) {
+        try {
+            in.close();
+        }
+        catch (IOException e) {
+            logger.warn("Failed to close stream. " + e, e);
+        }
+    }
+
+}

Added: servicemix/smx4/kernel/trunk/filemonitor/src/main/java/org/apache/servicemix/kernel/filemonitor/FileMonitorActivator.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/filemonitor/src/main/java/org/apache/servicemix/kernel/filemonitor/FileMonitorActivator.java?rev=613113&view=auto
==============================================================================
--- servicemix/smx4/kernel/trunk/filemonitor/src/main/java/org/apache/servicemix/kernel/filemonitor/FileMonitorActivator.java (added)
+++ servicemix/smx4/kernel/trunk/filemonitor/src/main/java/org/apache/servicemix/kernel/filemonitor/FileMonitorActivator.java Fri Jan 18 01:28:33 2008
@@ -0,0 +1,135 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.kernel.filemonitor;
+
+import java.util.Collection;
+import java.util.Dictionary;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Map;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.service.cm.ConfigurationAdmin;
+import org.osgi.service.cm.ConfigurationException;
+import org.osgi.service.cm.ManagedServiceFactory;
+import org.osgi.service.packageadmin.PackageAdmin;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ * Inspired by <a href="http://www.aqute.biz/Code/FileInstall">FileInstall</a> by Peter Kriens.
+ * 
+ * @version $Revision: 1.1 $
+ */
+public class FileMonitorActivator implements BundleActivator, ManagedServiceFactory {
+    private BundleContext context;
+    private ServiceTracker packageAdminTracker;
+    private ServiceTracker configurationAdminTracker;
+    private Map<String, FileMonitor> fileMonitors = new HashMap<String, FileMonitor>();
+
+    // BundleActivator interface
+    //-------------------------------------------------------------------------
+    public void start(BundleContext context) throws Exception {
+        this.context = context;
+
+        Hashtable properties = new Hashtable();
+        properties.put(Constants.SERVICE_PID, getName());
+        context.registerService(ManagedServiceFactory.class.getName(), this, properties);
+
+        packageAdminTracker = new ServiceTracker(context, PackageAdmin.class.getName(), null);
+        packageAdminTracker.open();
+
+        configurationAdminTracker = new ServiceTracker(context, ConfigurationAdmin.class.getName(), null);
+        configurationAdminTracker.open();
+
+        Hashtable initialProperties = new Hashtable();
+        setPropertiesFromContext(initialProperties,
+                FileMonitor.CONFIG_DIR,
+                FileMonitor.DEPLOY_DIR,
+                FileMonitor.GENERATED_JAR_DIR,
+                FileMonitor.SCAN_INTERVAL
+        );
+        updated("initialPid", initialProperties);
+    }
+
+    public void stop(BundleContext context) throws Exception {
+        Collection<FileMonitor> fileMonitors = this.fileMonitors.values();
+        for (FileMonitor monitor : fileMonitors) {
+            try {
+                monitor.stop();
+            }
+            catch (Exception e) {
+                // Ignore
+            }
+        }
+        this.fileMonitors.clear();
+
+        configurationAdminTracker.close();
+        packageAdminTracker.close();
+    }
+
+    // ManagedServiceFactory interface
+    //-------------------------------------------------------------------------
+    public String getName() {
+        return "org.apache.servicemix.kernel.filemonitor.FileMonitor";
+    }
+
+    public void updated(String pid, Dictionary properties) throws ConfigurationException {
+        deleted(pid);
+        FileMonitor monitor = new FileMonitor(this, properties);
+        fileMonitors.put(pid, monitor);
+        monitor.start();
+    }
+
+    public void deleted(String pid) {
+        FileMonitor monitor = fileMonitors.remove(pid);
+        if (monitor != null) {
+            monitor.stop();
+        }
+    }
+
+    // Properties
+    //-------------------------------------------------------------------------
+    public BundleContext getContext() {
+        return context;
+    }
+
+    public ServiceTracker getConfigurationAdminTracker() {
+        return configurationAdminTracker;
+    }
+
+    public ServiceTracker getPackageAdminTracker() {
+        return packageAdminTracker;
+    }
+
+    public ConfigurationAdmin getConfigurationAdmin() {
+        return (ConfigurationAdmin) getConfigurationAdminTracker().getService();
+    }
+
+    // Implementation methods
+    //-------------------------------------------------------------------------
+    protected void setPropertiesFromContext(Hashtable properties, String... keys) {
+        for (String key : keys) {
+            Object value = context.getProperty(key);
+            if (value != null) {
+                properties.put(key, value);
+            }
+        }
+    }
+}

Added: servicemix/smx4/kernel/trunk/filemonitor/src/main/java/org/apache/servicemix/kernel/filemonitor/Scanner.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/filemonitor/src/main/java/org/apache/servicemix/kernel/filemonitor/Scanner.java?rev=613113&view=auto
==============================================================================
--- servicemix/smx4/kernel/trunk/filemonitor/src/main/java/org/apache/servicemix/kernel/filemonitor/Scanner.java (added)
+++ servicemix/smx4/kernel/trunk/filemonitor/src/main/java/org/apache/servicemix/kernel/filemonitor/Scanner.java Fri Jan 18 01:28:33 2008
@@ -0,0 +1,445 @@
+//========================================================================
+//$Id: Scanner.java 2180 2007-10-31 04:01:26Z janb $
+//Copyright 2006 Mort Bay Consulting Pty. Ltd.
+//------------------------------------------------------------------------
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//http://www.apache.org/licenses/LICENSE-2.0
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//========================================================================
+package org.apache.servicemix.kernel.filemonitor;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.util.*;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Scanner
+ * <p/>
+ * Utility for scanning a directory for added, removed and changed
+ * files and reporting these events via registered Listeners.
+ * <p/>
+ * From the <a href="http://jetty.codehaus.org/">Jetty Util project</a>
+ *
+ * @version $Revision: 1.1 $
+ */
+public class Scanner {
+    
+    private static Log logger = LogFactory.getLog(Scanner.class);
+    private long _scanInterval;
+    private List<Listener> _listeners = Collections.synchronizedList(new ArrayList<Listener>());
+    private Map<String, Long> _prevScan = Collections.emptyMap();
+    private FilenameFilter _filter;
+    private List<File> _scanDirs;
+    private volatile boolean _running = false;
+    private boolean _reportExisting = true;
+    private Timer _timer;
+    private TimerTask _task;
+
+    /**
+     * Listener
+     * <p/>
+     * Marker for notifications re file changes.
+     */
+    public interface Listener {
+    }
+
+    public interface DiscreteListener extends Listener {
+        public void fileChanged(String filename) throws Exception;
+
+        public void fileAdded(String filename) throws Exception;
+
+        public void fileRemoved(String filename) throws Exception;
+    }
+
+    public interface BulkListener extends Listener {
+        public void filesChanged(List<String> filenames) throws Exception;
+    }
+
+    /**
+     *
+     */
+    public Scanner() {
+    }
+
+    /**
+     * Get the scan interval
+     *
+     * @return interval between scans in millis
+     */
+    public long getScanInterval() {
+        return _scanInterval;
+    }
+
+    /**
+     * Set the scan interval
+     *
+     * @param scanInterval pause between scans in millis
+     */
+    public synchronized void setScanInterval(long scanInterval) {
+        this._scanInterval = scanInterval;
+
+        if (_running) {
+            stop();
+
+            _timer = newTimer();
+            _task = newTimerTask();
+
+            schedule(_timer, _task);
+            _running = true;
+        }
+    }
+
+    /**
+     * Set the location of the directory to scan.
+     *
+     * @param dir
+     * @deprecated use setScanDirs(List dirs) instead
+     */
+    public void setScanDir(File dir) {
+        _scanDirs = new ArrayList<File>();
+        _scanDirs.add(dir);
+    }
+
+    /**
+     * Get the location of the directory to scan
+     *
+     * @return
+     * @deprecated use getScanDirs() instead
+     */
+    public File getScanDir() {
+        return (_scanDirs == null ? null : (File) _scanDirs.get(0));
+    }
+
+    public void setScanDirs(List<File> dirs) {
+        _scanDirs = dirs;
+    }
+
+    public List<File> getScanDirs() {
+        return _scanDirs;
+    }
+
+    /**
+     * Apply a filter to files found in the scan directory.
+     * Only files matching the filter will be reported as added/changed/removed.
+     *
+     * @param filter
+     */
+    public void setFilenameFilter(FilenameFilter filter) {
+        this._filter = filter;
+    }
+
+    /**
+     * Get any filter applied to files in the scan dir.
+     *
+     * @return
+     */
+    public FilenameFilter getFilenameFilter() {
+        return _filter;
+    }
+
+    /**
+     * Whether or not an initial scan will report all files as being
+     * added.
+     *
+     * @param reportExisting if true, all files found on initial scan will be
+     *                       reported as being added, otherwise not
+     */
+    public void setReportExistingFilesOnStartup(boolean reportExisting) {
+        this._reportExisting = reportExisting;
+    }
+
+    /**
+     * Add an added/removed/changed listener
+     *
+     * @param listener
+     */
+    public synchronized void addListener(Listener listener) {
+        if (listener == null) {
+            return;
+        }
+
+        _listeners.add(listener);
+    }
+
+    /**
+     * Remove a registered listener
+     *
+     * @param listener the Listener to be removed
+     */
+    public synchronized void removeListener(Listener listener) {
+        if (listener == null) {
+            return;
+        }
+        _listeners.remove(listener);
+    }
+
+    /**
+     * Start the scanning action.
+     */
+    public synchronized void start() {
+        if (_running) {
+            return;
+        }
+
+        _running = true;
+
+        if (_reportExisting) {
+            // if files exist at startup, report them
+            scan();
+        }
+        else {
+            //just register the list of existing files and only report changes
+            _prevScan = scanFiles();
+        }
+
+        _timer = newTimer();
+        _task = newTimerTask();
+
+        schedule(_timer, _task);
+    }
+
+    public TimerTask newTimerTask() {
+        return new TimerTask() {
+            public void run() {
+                scan();
+            }
+        };
+    }
+
+    public Timer newTimer() {
+        return new Timer(true);
+    }
+
+    public void schedule(Timer timer, TimerTask task) {
+        if (timer == null) {
+            throw new IllegalArgumentException("Timer is null");
+        }
+        if (task == null) {
+            throw new IllegalArgumentException("TimerTask is null");
+        }
+
+        if (getScanInterval() > 0) {
+            timer.scheduleAtFixedRate(task, getScanInterval(), getScanInterval());
+        }
+    }
+
+    /**
+     * Stop the scanning.
+     */
+    public synchronized void stop() {
+        if (_running) {
+            _running = false;
+            _timer.cancel();
+            _task.cancel();
+            _task = null;
+            _timer = null;
+        }
+    }
+
+    /**
+     * Perform a pass of the scanner and report changes
+     */
+    public void scan() {
+        Map<String, Long> currentScan = scanFiles();
+        reportDifferences(currentScan, _prevScan);
+        _prevScan = currentScan;
+    }
+
+    /**
+     * Recursively scan all files in the designated directories.
+     *
+     * @return Map of name of file to last modified time
+     */
+    public Map<String, Long> scanFiles() {
+        if (_scanDirs == null) {
+            return Collections.emptyMap();
+        }
+
+        HashMap<String, Long> scanInfo = new HashMap<String, Long>();
+        Iterator<File> itor = _scanDirs.iterator();
+        while (itor.hasNext()) {
+            File dir = (File) itor.next();
+
+            if ((dir != null) && (dir.exists())) {
+                scanFile(dir, scanInfo);
+            }
+        }
+
+        return scanInfo;
+    }
+
+    /**
+     * Report the adds/changes/removes to the registered listeners
+     *
+     * @param currentScan the info from the most recent pass
+     * @param oldScan     info from the previous pass
+     */
+    public void reportDifferences(Map<String, Long> currentScan, Map<String, Long> oldScan) {
+        List<String> bulkChanges = new ArrayList<String>();
+
+        Set<String> oldScanKeys = new HashSet<String>(oldScan.keySet());
+        Iterator<Map.Entry<String, Long>> itor = currentScan.entrySet().iterator();
+        while (itor.hasNext()) {
+            Map.Entry<String, Long> entry = itor.next();
+            if (!oldScanKeys.contains(entry.getKey())) {
+                logger.debug("File added: " + entry.getKey());
+                reportAddition(entry.getKey());
+                bulkChanges.add(entry.getKey());
+            }
+            else if (!oldScan.get(entry.getKey()).equals(entry.getValue())) {
+                logger.debug("File changed: " + entry.getKey());
+                reportChange(entry.getKey());
+                oldScanKeys.remove(entry.getKey());
+                bulkChanges.add(entry.getKey());
+            }
+            else {
+                oldScanKeys.remove(entry.getKey());
+            }
+        }
+
+        if (!oldScanKeys.isEmpty()) {
+
+            Iterator<String> keyItor = oldScanKeys.iterator();
+            while (keyItor.hasNext()) {
+                String filename = keyItor.next();
+                logger.debug("File removed: " + filename);
+                reportRemoval(filename);
+                bulkChanges.add(filename);
+            }
+        }
+
+        if (!bulkChanges.isEmpty()) {
+            reportBulkChanges(bulkChanges);
+        }
+    }
+
+    /**
+     * Get last modified time on a single file or recurse if
+     * the file is a directory.
+     *
+     * @param f           file or directory
+     * @param scanInfoMap map of filenames to last modified times
+     */
+    private void scanFile(File f, Map<String, Long> scanInfoMap) {
+        try {
+            if (!f.exists()) {
+                return;
+            }
+
+            if (f.isFile()) {
+                if ((_filter == null) || ((_filter != null) && _filter.accept(f.getParentFile(), f.getName()))) {
+                    String name = f.getCanonicalPath();
+                    long lastModified = f.lastModified();
+                    scanInfoMap.put(name, new Long(lastModified));
+                }
+            }
+            else if (f.isDirectory()) {
+                File[] files = f.listFiles();
+                for (int i = 0; i < files.length; i++) {
+                    scanFile(files[i], scanInfoMap);
+                }
+            }
+        }
+        catch (IOException e) {
+            logger.warn("Error scanning watched files", e);
+        }
+    }
+
+    /**
+     * Report a file addition to the registered FileAddedListeners
+     *
+     * @param filename
+     */
+    private void reportAddition(String filename) {
+        Iterator<Listener> itor = _listeners.iterator();
+        while (itor.hasNext()) {
+            try {
+                Listener l = itor.next();
+                if (l instanceof DiscreteListener) {
+                    ((DiscreteListener) l).fileAdded(filename);
+                }
+            }
+            catch (Exception e) {
+                logger.warn(e);
+            }
+            catch (Error e) {
+                logger.warn(e);
+            }
+        }
+    }
+
+    /**
+     * Report a file removal to the FileRemovedListeners
+     *
+     * @param filename
+     */
+    private void reportRemoval(String filename) {
+        Iterator<Listener> itor = _listeners.iterator();
+        while (itor.hasNext()) {
+            try {
+                Listener l = itor.next();
+                if (l instanceof DiscreteListener) {
+                    ((DiscreteListener) l).fileRemoved(filename);
+                }
+            }
+            catch (Exception e) {
+                logger.warn(e);
+            }
+            catch (Error e) {
+                logger.warn(e);
+            }
+        }
+    }
+
+    /**
+     * Report a file change to the FileChangedListeners
+     *
+     * @param filename
+     */
+    private void reportChange(String filename) {
+        Iterator<Listener> itor = _listeners.iterator();
+        while (itor.hasNext()) {
+            try {
+                Listener l = itor.next();
+                if (l instanceof DiscreteListener) {
+                    ((DiscreteListener) l).fileChanged(filename);
+                }
+            }
+            catch (Exception e) {
+                logger.warn(e);
+            }
+            catch (Error e) {
+                logger.warn(e);
+            }
+        }
+    }
+
+    private void reportBulkChanges(List<String> filenames) {
+        Iterator<Listener> itor = _listeners.iterator();
+        while (itor.hasNext()) {
+            try {
+                Listener l = itor.next();
+                if (l instanceof BulkListener) {
+                    ((BulkListener) l).filesChanged(filenames);
+                }
+            }
+            catch (Exception e) {
+                logger.warn(e);
+            }
+            catch (Error e) {
+                logger.warn(e);
+            }
+        }
+    }
+    
+}

Added: servicemix/smx4/kernel/trunk/filemonitor/src/test/java/org/apache/servicemix/kernel/filemonitor/BundlePackerTest.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/filemonitor/src/test/java/org/apache/servicemix/kernel/filemonitor/BundlePackerTest.java?rev=613113&view=auto
==============================================================================
--- servicemix/smx4/kernel/trunk/filemonitor/src/test/java/org/apache/servicemix/kernel/filemonitor/BundlePackerTest.java (added)
+++ servicemix/smx4/kernel/trunk/filemonitor/src/test/java/org/apache/servicemix/kernel/filemonitor/BundlePackerTest.java Fri Jan 18 01:28:33 2008
@@ -0,0 +1,45 @@
+/**
+ *
+ * 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.kernel.filemonitor;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+import org.apache.commons.io.FileUtils;
+
+/**
+ * @version $Revision: 1.1 $
+ */
+public class BundlePackerTest extends TestCase {
+    public void testFiles() throws Exception {
+        File bundleDir = new File("target/deploy");
+        File unpackDir = new File("target/data");
+        FileUtils.deleteDirectory(unpackDir);
+
+        bundleDir.mkdirs();
+        unpackDir.mkdirs();
+
+        FileUtils.copyDirectory(new File("src/test/data"), unpackDir);
+
+/*
+        FileMonitor packer = new FileMonitor(bundleDir, unpackDir);
+        packer.scan();
+*/
+    }
+
+}

Modified: servicemix/smx4/kernel/trunk/gshell/gshell-core/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/gshell/gshell-core/pom.xml?rev=613113&r1=611587&r2=613113&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/gshell/gshell-core/pom.xml (original)
+++ servicemix/smx4/kernel/trunk/gshell/gshell-core/pom.xml Fri Jan 18 01:28:33 2008
@@ -22,16 +22,16 @@
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
-        <groupId>org.apache.servicemix.runtime.gshell</groupId>
+        <groupId>org.apache.servicemix.kernel.gshell</groupId>
         <artifactId>gshell</artifactId>
-        <version>1.0-m2-SNAPSHOT</version>
+        <version>1.0-m1-SNAPSHOT</version>
     </parent>
 
-    <groupId>org.apache.servicemix.runtime.gshell</groupId>
-    <artifactId>org.apache.servicemix.runtime.gshell.core</artifactId>
+    <groupId>org.apache.servicemix.kernel.gshell</groupId>
+    <artifactId>org.apache.servicemix.kernel.gshell.core</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0-m2-SNAPSHOT</version>
-    <name>ServiceMix Runtime :: GShell Core</name>
+    <version>1.0-m1-SNAPSHOT</version>
+    <name>ServiceMix Kernel :: GShell Core</name>
 
     <description>
         Provides the OSGi GShell integration
@@ -39,7 +39,7 @@
 
     <properties>
         <gshell.osgi.import>
-            org.apache.servicemix.runtime.main.spi.*;resolution:=optional,
+            org.apache.servicemix.kernel.main.spi.*;resolution:=optional,
             com.thoughtworks.xstream*;resolution:=optional,
             javax.xml.stream*;resolution:=optional,
             junit.framework*;resolution:=optional,
@@ -68,14 +68,14 @@
 
     <dependencies>
         <dependency>
-            <groupId>org.apache.servicemix.runtime</groupId>
-            <artifactId>org.apache.servicemix.runtime.main</artifactId>
-            <version>1.0-m2-SNAPSHOT</version>
+            <groupId>org.apache.servicemix.kernel</groupId>
+            <artifactId>org.apache.servicemix.kernel.main</artifactId>
+            <version>1.0-m1-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.apache.servicemix.bundles</groupId>
             <artifactId>org.apache.servicemix.bundles.cglib-${cglib.version}</artifactId>
-            <version>1.0-m2-SNAPSHOT</version>
+            <version>1.0-m1-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.springframework.osgi</groupId>

Modified: servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/GShell.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/GShell.java?rev=613113&r1=611587&r2=613113&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/GShell.java (original)
+++ servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/GShell.java Fri Jan 18 01:28:33 2008
@@ -25,7 +25,7 @@
 import org.apache.geronimo.gshell.common.Arguments;
 import org.apache.geronimo.gshell.shell.Environment;
 import org.apache.geronimo.gshell.shell.InteractiveShell;
-import org.apache.servicemix.runtime.main.spi.MainService;
+import org.apache.servicemix.kernel.main.spi.MainService;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.BundleException;
 import org.osgi.framework.FrameworkEvent;

Modified: servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/resources/META-INF/spring/gshell-local.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/resources/META-INF/spring/gshell-local.xml?rev=613113&r1=611587&r2=613113&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/resources/META-INF/spring/gshell-local.xml (original)
+++ servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/resources/META-INF/spring/gshell-local.xml Fri Jan 18 01:28:33 2008
@@ -30,7 +30,7 @@
   http://www.springframework.org/schema/osgi/spring-osgi.xsd">
 
 
-    <osgi:reference id="mainService" interface="org.apache.servicemix.runtime.main.spi.MainService" />
+    <osgi:reference id="mainService" interface="org.apache.servicemix.kernel.main.spi.MainService" />
 
     <bean id="gshell" class="org.apache.geronimo.gshell.spring.GShell"
                       init-method="start" destroy-method="stop">

Modified: servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/resources/org/apache/geronimo/gshell/spring/etc/config.properties
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/resources/org/apache/geronimo/gshell/spring/etc/config.properties?rev=613113&r1=611587&r2=613113&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/resources/org/apache/geronimo/gshell/spring/etc/config.properties (original)
+++ servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/resources/org/apache/geronimo/gshell/spring/etc/config.properties Fri Jan 18 01:28:33 2008
@@ -24,7 +24,7 @@
  org.osgi.service.packageadmin; version=1.2.0, \
  org.osgi.service.startlevel; version=1.0.0, \
  org.osgi.service.url; version=1.0.0, \
- org.apache.servicemix.runtime.main.spi, \
+ org.apache.servicemix.kernel.main.spi, \
  ${jre-${java.specification.version}}
 #org.osgi.framework.bootdelegation=sun.*,com.sun.*