[jboss-osgi-commits] JBoss-OSGI SVN: r89670 - in projects/jboss-osgi/trunk: bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal and 6 other directories.

jboss-osgi-commits at lists.jboss.org jboss-osgi-commits at lists.jboss.org
Tue Jun 2 10:40:33 EDT 2009


Author: thomas.diesler at jboss.com
Date: 2009-06-02 10:40:32 -0400 (Tue, 02 Jun 2009)
New Revision: 89670

Added:
   projects/jboss-osgi/trunk/docbook/en/images/izpack-packs.png
   projects/jboss-osgi/trunk/docbook/en/images/izpack-target-container.png
   projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/DeploymentScannerService.java
Removed:
   projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/DeploymentScannerService.java
   projects/jboss-osgi/trunk/docbook/en/images/izpack-packs.jpg
   projects/jboss-osgi/trunk/docbook/en/images/izpack-target-server.png
Modified:
   projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerActivator.java
   projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java
   projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/ScannerThread.java
   projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/JMXConnectorService.java
   projects/jboss-osgi/trunk/distribution/src/main/resources/installer/user-input-spec.xml
   projects/jboss-osgi/trunk/docbook/en/images/izpack-done.png
   projects/jboss-osgi/trunk/docbook/en/images/izpack-installpath.png
   projects/jboss-osgi/trunk/docbook/en/images/izpack-structure.jpg
   projects/jboss-osgi/trunk/docbook/en/images/izpack-verify.png
   projects/jboss-osgi/trunk/docbook/en/images/izpack-welcome.png
   projects/jboss-osgi/trunk/docbook/en/modules/ch02-getting-started.xml
   projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java
Log:
Start work on Beta2 user guide

Deleted: projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/DeploymentScannerService.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/DeploymentScannerService.java	2009-06-02 14:29:41 UTC (rev 89669)
+++ projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/DeploymentScannerService.java	2009-06-02 14:40:32 UTC (rev 89670)
@@ -1,76 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.service.hotdeploy;
-
-//$Id$
-
-import java.net.URL;
-
-import org.jboss.osgi.spi.service.BundleInfo;
-
-
-/**
- * A service that scans a directory location for new/removed bundles.
- * 
- * @author thomas.diesler at jboss.com
- * @since 27-May-2009
- */
-public interface DeploymentScannerService
-{
-   /**
-    * The property that names the scan location: org.jboss.osgi.hotdeploy.scandir
-    */
-   String PROPERTY_SCAN_LOCATION = "org.jboss.osgi.hotdeploy.scandir";
-   
-   /**
-    * The property to defines the scan interval: org.jboss.osgi.hotdeploy.interval
-    */
-   String PROPERTY_SCAN_INTERVAL = "org.jboss.osgi.hotdeploy.interval";
-   
-   /**
-    * Get the scan location URL.
-    *  
-    * This is can be specified by setting the {@link PROPERTY_SCAN_LOCATION} property. 
-    */
-   URL getScanLocation();
-   
-   /**
-    * The number of scans since the service started 
-    */
-   long getScanCount();
-   
-   /**
-    * The number of milliseconds between scans
-    * Defaults to 2000ms 
-    */
-   long getScanInterval();
-   
-   /**
-    * Run a directory scan
-    */
-   void scan();
-   
-   /**
-    * Returns the array of bundles currently known to the deployemtn scanner. 
-    */
-   BundleInfo[] getBundles();
-}
\ No newline at end of file

Modified: projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerActivator.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerActivator.java	2009-06-02 14:29:41 UTC (rev 89669)
+++ projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerActivator.java	2009-06-02 14:40:32 UTC (rev 89670)
@@ -23,7 +23,7 @@
 
 //$Id$
 
-import org.jboss.osgi.service.hotdeploy.DeploymentScannerService;
+import org.jboss.osgi.spi.service.DeploymentScannerService;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
 

Modified: projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java	2009-06-02 14:29:41 UTC (rev 89669)
+++ projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java	2009-06-02 14:40:32 UTC (rev 89670)
@@ -29,15 +29,17 @@
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.LinkedHashSet;
 import java.util.List;
+import java.util.Set;
 import java.util.jar.Attributes;
 import java.util.jar.JarFile;
 import java.util.jar.Manifest;
 
 import org.jboss.osgi.common.log.LogServiceTracker;
-import org.jboss.osgi.service.hotdeploy.DeploymentScannerService;
 import org.jboss.osgi.spi.service.BundleInfo;
 import org.jboss.osgi.spi.service.DeployerService;
+import org.jboss.osgi.spi.service.DeploymentScannerService;
 import org.jboss.osgi.spi.service.BundleInfo.State;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
@@ -63,6 +65,7 @@
    private DeployerService deployer;
    private ScannerThread scannerThread;
    private List<BundleInfo> lastScan = new ArrayList<BundleInfo>();
+   private Set<ScanListener> listeners = new LinkedHashSet<ScanListener>();
    private boolean traceBundles = false;
 
    public DeploymentScannerImpl(BundleContext context)
@@ -94,8 +97,21 @@
       }
    }
 
+   public void addScanListener(ScanListener listener)
+   {
+      listeners.add(listener);
+   }
+
+   public void removeScanListener(ScanListener listener)
+   {
+      listeners.remove(listener);
+   }
+
    public void scan()
    {
+      for (ScanListener listener : listeners)
+         listener.beforeScan(this);
+      
       List<BundleInfo> currScan = Arrays.asList(getBundles());
 
       if (traceBundles)
@@ -107,6 +123,9 @@
 
       lastScan = currScan;
       scanCount++;
+
+      for (ScanListener listener : listeners)
+         listener.afterScan(this);
    }
 
    private void logBundleInfos(String message, List<BundleInfo> bundleInfos)

Modified: projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/ScannerThread.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/ScannerThread.java	2009-06-02 14:29:41 UTC (rev 89669)
+++ projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/ScannerThread.java	2009-06-02 14:40:32 UTC (rev 89670)
@@ -24,7 +24,7 @@
 //$Id$
 
 import org.jboss.osgi.common.log.LogServiceTracker;
-import org.jboss.osgi.service.hotdeploy.DeploymentScannerService;
+import org.jboss.osgi.spi.service.DeploymentScannerService;
 import org.osgi.framework.BundleContext;
 import org.osgi.service.log.LogService;
 

Modified: projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/JMXConnectorService.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/JMXConnectorService.java	2009-06-02 14:29:41 UTC (rev 89669)
+++ projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/JMXConnectorService.java	2009-06-02 14:40:32 UTC (rev 89670)
@@ -106,7 +106,7 @@
 
          jmxConnectorServer.start();
 
-         log.log(LogService.LOG_INFO, "JMXConnectorServer started: " + serviceURL);
+         log.log(LogService.LOG_DEBUG, "JMXConnectorServer started: " + serviceURL);
       }
       catch (IOException ex)
       {

Modified: projects/jboss-osgi/trunk/distribution/src/main/resources/installer/user-input-spec.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/src/main/resources/installer/user-input-spec.xml	2009-06-02 14:29:41 UTC (rev 89669)
+++ projects/jboss-osgi/trunk/distribution/src/main/resources/installer/user-input-spec.xml	2009-06-02 14:40:32 UTC (rev 89670)
@@ -12,7 +12,7 @@
   <panel order="1">
     <createForPack name="JBossOSGi Integration" />
     <field type="radio" variable="jbossSelection">
-      <description align="left" txt="Please choose your target server" />
+      <description align="left" txt="Please choose your target container" />
       <spec>
         <choice txt="JBoss-5.0.1" value="jboss501" set="true"/>
         <choice txt="JBoss-5.1.0" value="jboss510"/>

Modified: projects/jboss-osgi/trunk/docbook/en/images/izpack-done.png
===================================================================
(Binary files differ)

Modified: projects/jboss-osgi/trunk/docbook/en/images/izpack-installpath.png
===================================================================
(Binary files differ)

Deleted: projects/jboss-osgi/trunk/docbook/en/images/izpack-packs.jpg
===================================================================
(Binary files differ)

Added: projects/jboss-osgi/trunk/docbook/en/images/izpack-packs.png
===================================================================
(Binary files differ)


Property changes on: projects/jboss-osgi/trunk/docbook/en/images/izpack-packs.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: projects/jboss-osgi/trunk/docbook/en/images/izpack-structure.jpg
===================================================================
(Binary files differ)

Added: projects/jboss-osgi/trunk/docbook/en/images/izpack-target-container.png
===================================================================
(Binary files differ)


Property changes on: projects/jboss-osgi/trunk/docbook/en/images/izpack-target-container.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Deleted: projects/jboss-osgi/trunk/docbook/en/images/izpack-target-server.png
===================================================================
(Binary files differ)

Modified: projects/jboss-osgi/trunk/docbook/en/images/izpack-verify.png
===================================================================
(Binary files differ)

Modified: projects/jboss-osgi/trunk/docbook/en/images/izpack-welcome.png
===================================================================
(Binary files differ)

Modified: projects/jboss-osgi/trunk/docbook/en/modules/ch02-getting-started.xml
===================================================================
--- projects/jboss-osgi/trunk/docbook/en/modules/ch02-getting-started.xml	2009-06-02 14:29:41 UTC (rev 89669)
+++ projects/jboss-osgi/trunk/docbook/en/modules/ch02-getting-started.xml	2009-06-02 14:40:32 UTC (rev 89670)
@@ -18,7 +18,7 @@
     
     <!-- [TODO] release update  -->
     <programlisting>
-    java -jar jboss-osgi-installer-1.0.0.Beta1.jar
+    java -jar jboss-osgi-installer-1.0.0.Beta2.jar
     </programlisting>
       
     <para>The installer first shows a welcome screen</para>
@@ -43,7 +43,7 @@
     
     <mediaobject>
       <imageobject>
-        <imagedata fileref="images/izpack-packs.jpg"/> 
+        <imagedata fileref="images/izpack-packs.png"/> 
       </imageobject>
     </mediaobject>
 
@@ -65,7 +65,7 @@
     
     <mediaobject>
       <imageobject>
-        <imagedata fileref="images/izpack-target-server.png"/> 
+        <imagedata fileref="images/izpack-target-container.png"/> 
       </imageobject>
     </mediaobject>
     
@@ -107,37 +107,39 @@
       </imageobject>
     </mediaobject>
     
-    <para>The JBossOSGi Runtime is a customized version of the <ulink url="http://www.jboss.org/jbossas">JBoss Application Server</ulink>. From that we removed the services 
-    that are not absolutely necessary to run the installed OSGi Framework. Consequently, you can start the JBossOSGi Runtime in the same
-    way as you start <ulink url="http://www.jboss.org/jbossas">JBossAS</ulink></para>
+    <para>The JBossOSGi Runtime is ... [TODO]</para>
     
     <programlisting>
-    [tdiesler at tdvaio runtime]$ bin/run.sh
-    =========================================================================
-    
-      JBoss Bootstrap Environment
-    
-      JBOSS_HOME: /usr/java/jboss-osgi-1.0.0.Beta1/runtime
-    
-      ...
-    
-    =========================================================================
-    
-    14:43:43,598 INFO  [ServerImpl] Starting JBoss (Microcontainer)...
-    ...
-    14:43:52,298 INFO  [FelixIntegration] OSGi Integration Felix - 1.0.0.Beta1
-    14:43:52,692 INFO  [FelixIntegration] Installed bundle: org.osgi.compendium
-    14:43:52,700 INFO  [FelixIntegration] Installed bundle: org.jboss.osgi.service.logging
-    14:43:52,701 INFO  [FelixIntegration] Started bundle: org.osgi.compendium
-    14:43:52,766 INFO  [FelixIntegration] Started bundle: org.jboss.osgi.service.logging
-    14:43:53,290 INFO  [OSGiDeployer] Installed: jboss-osgi-service-webconsole [3][INSTALLED]
-    14:43:53,297 INFO  [OSGiDeployer] Installed: org.apache.felix.bundlerepository [4][INSTALLED]
-    14:43:53,308 INFO  [OSGiDeployer] Installed: org.apache.felix.configadmin [5][INSTALLED]
-    14:43:53,322 INFO  [OSGiDeployer] Installed: org.apache.felix.http.jetty [6][INSTALLED]
-    14:43:53,328 INFO  [OSGiDeployer] Installed: org.apache.felix.log [7][INSTALLED]
-    14:43:53,333 INFO  [OSGiDeployer] Installed: org.apache.felix.metatype [8][INSTALLED]
-    ...
-    14:43:55,250 INFO  [ServerImpl] JBoss (Microcontainer) [5.0.1.GA ...] <emphasis role="bold">Started in 11s:645ms</emphasis>
+[tdiesler at tddell runtime]$ bin/run.sh
+=========================================================================
+
+  JBossOSGi Bootstrap Environment
+
+  OSGI_HOME: /home/tdiesler/jboss-osgi-1.0.0.Beta2/runtime
+
+  JAVA: /usr/java/jdk1.6/bin/java
+
+  JAVA_OPTS: ...
+
+=========================================================================
+
+16:18:32,974 INFO  [FelixIntegration] OSGi Integration Felix - 1.0.0.Beta2
+16:18:33,403 INFO  [FelixIntegration] Installed bundle [1]: org.osgi.compendium
+16:18:33,412 INFO  [FelixIntegration] Installed bundle [2]: org.apache.felix.log
+16:18:33,425 INFO  [FelixIntegration] Installed bundle [3]: jboss-osgi-common
+16:18:33,435 INFO  [FelixIntegration] Installed bundle [4]: jboss-osgi-hotdeploy
+16:18:33,550 INFO  [jboss-osgi-hotdeploy] Start DeploymentScanner: [scandir=server/default/bundles,interval=2000ms]
+16:18:33,555 INFO  [OSGiBootstrap] JBossOSGi Runtime booted in 0.581sec
+...
+16:18:33,617 INFO  [jboss-osgi-common] Installed: jboss-osgi-jndi [5]
+16:18:33,627 INFO  [jboss-osgi-common] Installed: jboss-osgi-jmx [6]
+16:18:33,659 INFO  [jboss-osgi-common] Installed: jboss-osgi-common-core [7]
+...
+16:18:34,170 INFO  [jboss-osgi-jndi] JNDI started: JNP=localhost:1099, RMI=localhost:1098
+16:18:34,401 INFO  [jboss-osgi-jmx] JMXConnectorServer started: service:jmx:rmi://localhost/jndi/rmi://localhost:1098/jmxconnector
+16:18:34,543 INFO  [jboss-osgi-jmx] MBeanServerConnection bound to: jmx/invoker/RMIAdaptor
+...
+16:18:34,544 INFO  [OSGiBootstrap] JBossOSGi Runtime started in 1.57sec
     </programlisting>
     
     <emphasis role="bold">Provided Examples</emphasis>
@@ -278,7 +280,7 @@
     Buildfile: build.xml
     
     init:
-         [echo] V1.0.0.Beta1
+         [echo] V1.0.0.Beta2
     
     init-hudson:
          [echo] 
@@ -306,7 +308,7 @@
     Buildfile: build.xml
     
     init:
-         [echo] V1.0.0.Beta1
+         [echo] V1.0.0.Beta2
     
     init-hudson:
          [echo] 
@@ -332,7 +334,7 @@
     Buildfile: build.xml
     
     init:
-         [echo] V1.0.0.Beta1
+         [echo] V1.0.0.Beta2
     
     init-hudson:
          [echo] 

Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java	2009-06-02 14:29:41 UTC (rev 89669)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java	2009-06-02 14:40:32 UTC (rev 89670)
@@ -32,9 +32,13 @@
 import java.util.Properties;
 
 import org.jboss.logging.Logger;
+import org.jboss.osgi.spi.service.DeploymentScannerService;
+import org.jboss.osgi.spi.service.DeploymentScannerService.ScanListener;
 import org.kohsuke.args4j.CmdLineException;
 import org.kohsuke.args4j.CmdLineParser;
 import org.kohsuke.args4j.Option;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
 
 /**
  * The OSGiBootstrap provides an {@link OSGiFramework} through a {@link OSGiBootstrapProvider}.
@@ -69,7 +73,7 @@
 
    private String osgiHome;
    private String osgiServerHome;
-   
+
    /*
     * The main entry point
     */
@@ -108,9 +112,9 @@
       osgiHome = System.getProperty(OSGI_HOME);
       if (osgiHome == null)
          throw new IllegalStateException("Cannot obtain system property: '" + OSGI_HOME + "'");
-      
+
       osgiServerHome = osgiHome + "/server/" + serverName;
-      
+
       Properties defaults = new Properties();
       defaults.setProperty(OSGI_SERVER_NAME, serverName);
       defaults.setProperty(OSGI_SERVER_HOME, osgiServerHome);
@@ -203,12 +207,38 @@
       public void run()
       {
          // Start the framework
-         long start = System.currentTimeMillis();
+         final long start = System.currentTimeMillis();
          framework.start();
+
+         // Report how long it took to boot and do the first scan
+         BundleContext context = framework.getBundleContext();
+         ServiceReference sref = context.getServiceReference(DeploymentScannerService.class.getName());
+         if (sref != null)
+         {
+            DeploymentScannerService scannerService = (DeploymentScannerService)context.getService(sref);
+            ScanListener listener = new ScanListener()
+            {
+               public void beforeScan(DeploymentScannerService service)
+               {
+                  // do nothing
+               }
+
+               public void afterScan(DeploymentScannerService service)
+               {
+                  long end = System.currentTimeMillis();
+                  float diff = (end - start) / 1000f;
+                  getLogger().info("JBossOSGi Runtime started in " + diff + "sec");
+
+                  // Remove this listener after the first scan
+                  service.removeScanListener(this);
+               }
+            };
+            scannerService.addScanListener(listener);
+         }
+
          long end = System.currentTimeMillis();
-
          float diff = (end - start) / 1000f;
-         getLogger().info("JBossOSGi Runtime started in " + diff + "sec");
+         getLogger().info("JBossOSGi Runtime booted in " + diff + "sec");
 
          Reader br = new InputStreamReader(System.in);
          try

Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/DeploymentScannerService.java (from rev 89649, projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/DeploymentScannerService.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/DeploymentScannerService.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/DeploymentScannerService.java	2009-06-02 14:40:32 UTC (rev 89670)
@@ -0,0 +1,100 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.spi.service;
+
+//$Id$
+
+import java.net.URL;
+
+/**
+ * A service that scans a directory location for new/removed bundles.
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 27-May-2009
+ */
+public interface DeploymentScannerService
+{
+   /**
+    * The property that names the scan location: org.jboss.osgi.hotdeploy.scandir
+    */
+   String PROPERTY_SCAN_LOCATION = "org.jboss.osgi.hotdeploy.scandir";
+   
+   /**
+    * The property to defines the scan interval: org.jboss.osgi.hotdeploy.interval
+    */
+   String PROPERTY_SCAN_INTERVAL = "org.jboss.osgi.hotdeploy.interval";
+   
+   /**
+    * Get the scan location URL.
+    *  
+    * This is can be specified by setting the {@link PROPERTY_SCAN_LOCATION} property. 
+    */
+   URL getScanLocation();
+   
+   /**
+    * The number of scans since the service started 
+    */
+   long getScanCount();
+   
+   /**
+    * The number of milliseconds between scans
+    * Defaults to 2000ms 
+    */
+   long getScanInterval();
+   
+   /**
+    * Run a directory scan
+    */
+   void scan();
+   
+   /**
+    * Returns the array of bundles currently known to the deployemtn scanner. 
+    */
+   BundleInfo[] getBundles();
+   
+   /**
+    * Add a scan listener to this service
+    */
+   void addScanListener(ScanListener listener);
+   
+   /**
+    * Remove the scan listener from this service
+    */
+   void removeScanListener(ScanListener listener);
+   
+   /**
+    * A ScanListener can be registered with the {@link DeploymentScannerService}
+    * to monitor the progress of deployed bundles 
+    */
+   interface ScanListener
+   {
+      /**
+       * Called before every scan
+       */
+      void beforeScan(DeploymentScannerService service);
+      
+      /**
+       * Called after every scan
+       */
+      void afterScan(DeploymentScannerService service);
+   }
+}
\ No newline at end of file




More information about the jboss-osgi-commits mailing list