[jboss-cvs] JBossAS SVN: r90526 - in trunk: main/src/main/org/jboss and 8 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jun 23 10:53:33 EDT 2009


Author: alesj
Date: 2009-06-23 10:53:32 -0400 (Tue, 23 Jun 2009)
New Revision: 90526

Added:
   trunk/system-jmx/src/main/org/jboss/system/microcontainer/LifecycleInfo.java
   trunk/system/src/main/org/jboss/system/server/profile/basic/IncludeExcludeVisitorAttributes.java
   trunk/system/src/main/org/jboss/system/tools/
   trunk/system/src/main/org/jboss/system/tools/DeploymentRepositoryAdapter.java
   trunk/system/src/main/org/jboss/system/tools/DeploymentScanner.java
   trunk/system/src/main/org/jboss/system/tools/DeploymentScannerMBean.java
   trunk/system/src/main/org/jboss/system/tools/ProfileServiceDeploymentRepositoryAdapter.java
Modified:
   trunk/component-matrix/pom.xml
   trunk/main/src/main/org/jboss/Main.java
   trunk/profileservice/src/resources/hdscanner-jboss-beans.xml
   trunk/server/src/etc/conf/all/bootstrap/profile.xml
   trunk/server/src/etc/conf/all/standardjboss.xml
   trunk/server/src/etc/conf/default/bootstrap/profile.xml
   trunk/system-jmx/src/main/org/jboss/system/microcontainer/ServiceControllerContext.java
   trunk/system-jmx/src/main/org/jboss/system/microcontainer/ServiceProxy.java
   trunk/system/src/main/org/jboss/system/server/profile/basic/XmlIncludeVirtualFileFilter.java
Log:
Update MC libs + dependencies.
Port Max's tools demands, Seam's synch bug fix, KernelBus lifecycle.

Modified: trunk/component-matrix/pom.xml
===================================================================
--- trunk/component-matrix/pom.xml	2009-06-23 14:32:01 UTC (rev 90525)
+++ trunk/component-matrix/pom.xml	2009-06-23 14:53:32 UTC (rev 90526)
@@ -58,13 +58,13 @@
     <version.org.jboss.bootstrap>1.0.0-Beta-2</version.org.jboss.bootstrap>
     <version.org.jboss.cache.core>3.1.0.GA</version.org.jboss.cache.core>
     <version.org.jboss.cache.pojo>3.0.0.GA</version.org.jboss.cache.pojo>
-    <version.org.jboss.cl>2.0.3.GA</version.org.jboss.cl>
+    <version.org.jboss.cl>2.0.6.GA</version.org.jboss.cl>
     <version.org.jboss.cluster.cache.jbc>2.0.0.GA</version.org.jboss.cluster.cache.jbc>
     <version.org.jboss.cluster.cache.spi>2.0.0.GA</version.org.jboss.cluster.cache.spi>
     <version.org.jboss.cluster.client>1.1.1.GA</version.org.jboss.cluster.client>
     <version.org.jboss.cluster.server.api>1.1.1.GA</version.org.jboss.cluster.server.api>
-    <version.org.jboss.common.core>2.2.12.GA</version.org.jboss.common.core>
-    <version.org.jboss.deployers>2.0.5.GA</version.org.jboss.deployers>
+    <version.org.jboss.common.core>2.2.14.GA</version.org.jboss.common.core>
+    <version.org.jboss.deployers>2.0.8.GA</version.org.jboss.deployers>
     <version.org.jboss.ejb3.common.client>1.0.0</version.org.jboss.ejb3.common.client>
     <version.org.jboss.ejb3.core.client>1.1.7</version.org.jboss.ejb3.core.client>
     <version.org.jboss.ejb3.endpoint.deployer>0.1.3</version.org.jboss.ejb3.endpoint.deployer>
@@ -74,15 +74,15 @@
     <version.org.jboss.ejb3.security.client>1.0.0</version.org.jboss.ejb3.security.client>
     <version.org.jboss.ejb3>1.1.7</version.org.jboss.ejb3>
     <version.org.jboss.integration>5.1.0.SP1</version.org.jboss.integration>
-    <version.org.jboss.jbossxb>2.0.0.GA</version.org.jboss.jbossxb>
+    <version.org.jboss.jbossxb>2.0.1.GA</version.org.jboss.jbossxb>
     <version.org.jboss.jpa>1.0.0</version.org.jboss.jpa>
     <version.org.jboss.logbridge>1.0.0.GA</version.org.jboss.logbridge>
     <version.org.jboss.logging>2.1.0.GA</version.org.jboss.logging>
     <version.org.jboss.logmanager>1.0.0.GA</version.org.jboss.logmanager>
     <version.org.jboss.man>2.1.1.CR1</version.org.jboss.man>
-    <version.org.jboss.mdr>2.0.1.GA</version.org.jboss.mdr>
-    <version.org.jboss.metadata>1.0.0.CR16</version.org.jboss.metadata>
-    <version.org.jboss.microcontainer>2.0.4.GA</version.org.jboss.microcontainer>
+    <version.org.jboss.mdr>2.0.2.GA</version.org.jboss.mdr>
+    <version.org.jboss.metadata>1.0.1.GA</version.org.jboss.metadata>
+    <version.org.jboss.microcontainer>2.0.7.GA</version.org.jboss.microcontainer>
     <version.org.jboss.mx>6.0.0.Beta1</version.org.jboss.mx>
     <version.org.jboss.naming>5.0.3.GA</version.org.jboss.naming>
     <version.org.jboss.reflect>2.0.2.GA</version.org.jboss.reflect>
@@ -90,7 +90,7 @@
     <version.org.jboss.security>2.1.0.20090318</version.org.jboss.security>
     <version.org.jboss.service.binding>1.0.0.CR1</version.org.jboss.service.binding>
     <version.org.jboss.threads>1.0.0.GA</version.org.jboss.threads>
-    <version.org.jboss.vfs>2.1.0.GA</version.org.jboss.vfs>
+    <version.org.jboss.vfs>2.1.2.GA</version.org.jboss.vfs>
     <version.org.jboss.security.negotiation>2.0.3.SP1</version.org.jboss.security.negotiation>
     <version.org.jboss.slf4j>1.0.2.GA</version.org.jboss.slf4j>
     <version.org.jboss.xnio.metadata>1.0.1.GA</version.org.jboss.xnio.metadata>
@@ -98,7 +98,7 @@
     <version.org.slf4j>1.5.6</version.org.slf4j>
     <version.org.springframework>2.5.5</version.org.springframework>
     <version.oswego-concurrent.concurrent>1.3.4-jboss-update1</version.oswego-concurrent.concurrent>
-    <version.seam.integration>5.0.2.GA</version.seam.integration>
+    <version.seam.integration>5.1.0.CR1</version.seam.integration>
     <version.staxex>2.1.1</version.staxex>
     <version.streambuffer>2.1.1</version.streambuffer>
     <version.suffix.org.jboss.javaee>.GA</version.suffix.org.jboss.javaee>

Modified: trunk/main/src/main/org/jboss/Main.java
===================================================================
--- trunk/main/src/main/org/jboss/Main.java	2009-06-23 14:32:01 UTC (rev 90525)
+++ trunk/main/src/main/org/jboss/Main.java	2009-06-23 14:53:32 UTC (rev 90526)
@@ -21,9 +21,6 @@
  */
 package org.jboss;
 
-import gnu.getopt.Getopt;
-import gnu.getopt.LongOpt;
-
 import java.io.File;
 import java.io.FilenameFilter;
 import java.net.MalformedURLException;
@@ -33,6 +30,8 @@
 import java.util.List;
 import java.util.Properties;
 
+import gnu.getopt.Getopt;
+import gnu.getopt.LongOpt;
 import org.jboss.bootstrap.spi.Server;
 import org.jboss.bootstrap.spi.ServerConfig;
 import org.jboss.bootstrap.spi.util.ServerConfigUtil;
@@ -114,6 +113,11 @@
     */
    public void boot(final String[] args) throws Exception
    {
+      // TODO; remove this when JBAS-6744 is fixed
+      String useUnorderedSequence = System.getProperty("xb.builder.useUnorderedSequence");
+      if (useUnorderedSequence == null)
+         System.setProperty("xb.builder.useUnorderedSequence", "true");
+
       // First process the command line to pickup custom props/settings
       processCommandLine(args);
 

Modified: trunk/profileservice/src/resources/hdscanner-jboss-beans.xml
===================================================================
--- trunk/profileservice/src/resources/hdscanner-jboss-beans.xml	2009-06-23 14:32:01 UTC (rev 90525)
+++ trunk/profileservice/src/resources/hdscanner-jboss-beans.xml	2009-06-23 14:53:32 UTC (rev 90526)
@@ -15,4 +15,19 @@
         <property name="scanThreadName">HDScanner</property>
     </bean>
 
+  <bean name="ToolsDeploymentScanner" class="org.jboss.system.tools.DeploymentScanner">
+    <constructor>
+      <parameter><inject bean="ProfileServiceDeploymentRepositoryAdapter"/></parameter>
+    </constructor>
+    <property name="serverConfig"><inject bean="JBossServer" property="config"/></property>
+  </bean>
+
+  <bean name="ProfileServiceDeploymentRepositoryAdapter" class="org.jboss.system.tools.ProfileServiceDeploymentRepositoryAdapter">
+    <constructor>
+      <parameter><inject bean="HDScanner"/></parameter>
+      <parameter><inject bean="ProfileService"/></parameter>
+      <parameter><inject bean="StructureModificationChecker"/></parameter>
+    </constructor>
+  </bean>
+
 </deployment>

Modified: trunk/server/src/etc/conf/all/bootstrap/profile.xml
===================================================================
--- trunk/server/src/etc/conf/all/bootstrap/profile.xml	2009-06-23 14:32:01 UTC (rev 90525)
+++ trunk/server/src/etc/conf/all/bootstrap/profile.xml	2009-06-23 14:53:32 UTC (rev 90526)
@@ -82,7 +82,8 @@
     <destroy method="flush"/>
   </bean>
 
-  <bean name="StructureModificationChecker" class="org.jboss.deployers.vfs.spi.structure.modified.MetaDataStructureModificationChecker">
+  <!-- This just checks metadata locations -->
+  <bean name="MetaDataStructureModificationChecker" class="org.jboss.deployers.vfs.spi.structure.modified.MetaDataStructureModificationChecker">
     <constructor>
       <parameter><inject bean="MainDeployer" /></parameter>
     </constructor>
@@ -90,6 +91,36 @@
     <property name="filter"><bean class="org.jboss.system.server.profile.basic.XmlIncludeVirtualFileFilter" /></property>
   </bean>
 
+  <!-- Synchs modifed files -->
+  <bean name="SynchAdapter" class="org.jboss.deployers.vfs.spi.structure.modified.OverrideSynchAdapter"/>
+
+  <!-- We just visit wars, but exclude classes, lib, dev dirs -->
+  <bean name="WebVisitorAttributes" class="org.jboss.system.server.profile.basic.IncludeExcludeVisitorAttributes">
+    <constructor>
+      <parameter>
+        <set>
+          <value>.war</value>
+        </set>
+      </parameter>
+      <parameter>
+        <set>
+          <value>WEB-INF/classes</value>
+          <value>WEB-INF/lib</value>
+          <value>WEB-INF/dev</value>
+        </set>
+      </parameter>
+    </constructor>
+  </bean>
+
+  <bean name="StructureModificationChecker" class="org.jboss.deployers.vfs.spi.structure.modified.SynchWrapperModificationChecker">
+    <constructor>
+      <parameter><inject bean="MetaDataStructureModificationChecker"/></parameter>
+      <parameter><inject bean="SynchAdapter"/></parameter>
+    </constructor>
+    <property name="originalAttributes"><inject bean="WebVisitorAttributes"/></property>
+    <property name="tempAttributes"><inject bean="WebVisitorAttributes"/></property>
+  </bean>
+
 	<bean name="BasicProfileFactory" class="org.jboss.system.server.profileservice.repository.BasicProfileFactory">
 		<property name="profileRepository"><inject bean="ProfileRepositoryFactory" /></property>
 	</bean>

Modified: trunk/server/src/etc/conf/all/standardjboss.xml
===================================================================
--- trunk/server/src/etc/conf/all/standardjboss.xml	2009-06-23 14:32:01 UTC (rev 90525)
+++ trunk/server/src/etc/conf/all/standardjboss.xml	2009-06-23 14:53:32 UTC (rev 90526)
@@ -341,12 +341,6 @@
       <invoker-mbean>default</invoker-mbean>
       <proxy-factory>org.jboss.ejb.plugins.inflow.JBossJMSMessageEndpointFactory</proxy-factory>
       <proxy-factory-config>
-        <endpoint-interceptors>
-          <interceptor>org.jboss.proxy.ClientMethodInterceptor</interceptor>
-          <interceptor>org.jboss.ejb.plugins.inflow.MessageEndpointInterceptor</interceptor>
-          <interceptor>org.jboss.proxy.TransactionInterceptor</interceptor>
-          <interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
-        </endpoint-interceptors>
         <activation-config>
            <activation-config-property>
               <activation-config-property-name>providerAdapterJNDI</activation-config-property-name>
@@ -389,6 +383,12 @@
               <activation-config-property-value>10</activation-config-property-value>
            </activation-config-property>
         </activation-config>
+        <endpoint-interceptors>
+          <interceptor>org.jboss.proxy.ClientMethodInterceptor</interceptor>
+          <interceptor>org.jboss.ejb.plugins.inflow.MessageEndpointInterceptor</interceptor>
+          <interceptor>org.jboss.proxy.TransactionInterceptor</interceptor>
+          <interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
+        </endpoint-interceptors>
       </proxy-factory-config>
     </invoker-proxy-binding>
   </invoker-proxy-bindings>
@@ -405,7 +405,7 @@
       <container-interceptors>
         <interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor>
-        <interceptor>org.jboss.ejb.plugins.security.PreSecurityInterceptor</interceptor> 
+        <interceptor>org.jboss.ejb.plugins.security.PreSecurityInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.SecurityInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.TxInterceptorCMT</interceptor>
         <interceptor>org.jboss.ejb.plugins.CallValidationInterceptor</interceptor>
@@ -453,8 +453,8 @@
       <call-ejb-store-on-clean>true</call-ejb-store-on-clean>
       <container-interceptors>
          <interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor>
-         <interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor> 
-         <interceptor>org.jboss.ejb.plugins.security.PreSecurityInterceptor</interceptor> 
+         <interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor>
+         <interceptor>org.jboss.ejb.plugins.security.PreSecurityInterceptor</interceptor>
          <interceptor>org.jboss.ejb.plugins.SecurityInterceptor</interceptor>
          <interceptor>org.jboss.ejb.plugins.TxInterceptorCMT</interceptor>
          <interceptor>org.jboss.ejb.plugins.EntityCreationInterceptor</interceptor>
@@ -499,7 +499,7 @@
         <interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.CleanShutdownInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor>
-        <interceptor>org.jboss.ejb.plugins.security.PreSecurityInterceptor</interceptor> 
+        <interceptor>org.jboss.ejb.plugins.security.PreSecurityInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.SecurityInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.TxInterceptorCMT</interceptor>
         <interceptor>org.jboss.ejb.plugins.CallValidationInterceptor</interceptor>
@@ -546,7 +546,7 @@
       <container-interceptors>
         <interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor>
-        <interceptor>org.jboss.ejb.plugins.security.PreSecurityInterceptor</interceptor> 
+        <interceptor>org.jboss.ejb.plugins.security.PreSecurityInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.SecurityInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.TxInterceptorCMT</interceptor>
         <interceptor>org.jboss.ejb.plugins.CallValidationInterceptor</interceptor>
@@ -592,7 +592,7 @@
       <container-interceptors>
         <interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor>
-        <interceptor>org.jboss.ejb.plugins.security.PreSecurityInterceptor</interceptor> 
+        <interceptor>org.jboss.ejb.plugins.security.PreSecurityInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.SecurityInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.TxInterceptorCMT</interceptor>
         <interceptor>org.jboss.ejb.plugins.CallValidationInterceptor</interceptor>
@@ -628,7 +628,7 @@
       <container-interceptors>
         <interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor>
-        <interceptor>org.jboss.ejb.plugins.security.PreSecurityInterceptor</interceptor> 
+        <interceptor>org.jboss.ejb.plugins.security.PreSecurityInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.SecurityInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.TxInterceptorCMT</interceptor>
         <interceptor>org.jboss.ejb.plugins.CallValidationInterceptor</interceptor>
@@ -672,7 +672,7 @@
         <interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.CleanShutdownInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor>
-        <interceptor>org.jboss.ejb.plugins.security.PreSecurityInterceptor</interceptor> 
+        <interceptor>org.jboss.ejb.plugins.security.PreSecurityInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.SecurityInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.TxInterceptorCMT</interceptor>
         <interceptor>org.jboss.ejb.plugins.CallValidationInterceptor</interceptor>
@@ -721,7 +721,7 @@
       <container-interceptors>
         <interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor>
-        <interceptor>org.jboss.ejb.plugins.security.PreSecurityInterceptor</interceptor> 
+        <interceptor>org.jboss.ejb.plugins.security.PreSecurityInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.SecurityInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.TxInterceptorCMT</interceptor>
         <interceptor>org.jboss.ejb.plugins.CallValidationInterceptor</interceptor>
@@ -754,7 +754,7 @@
       <container-interceptors>
         <interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor>
-        <interceptor>org.jboss.ejb.plugins.security.PreSecurityInterceptor</interceptor> 
+        <interceptor>org.jboss.ejb.plugins.security.PreSecurityInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.SecurityInterceptor</interceptor>
         <!-- CMT -->
         <interceptor transaction="Container">org.jboss.ejb.plugins.TxInterceptorCMT</interceptor>
@@ -767,8 +767,8 @@
         <interceptor>org.jboss.resource.connectionmanager.CachedConnectionInterceptor</interceptor>
       </container-interceptors>
       <instance-pool>org.jboss.ejb.plugins.StatelessSessionInstancePool</instance-pool>
-      <instance-cache></instance-cache>
-      <persistence-manager></persistence-manager>
+      <instance-cache/>
+      <persistence-manager/>
       <container-pool-conf>
         <MaximumSize>100</MaximumSize>
       </container-pool-conf>
@@ -782,7 +782,7 @@
         <interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.CleanShutdownInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor>
-        <interceptor>org.jboss.ejb.plugins.security.PreSecurityInterceptor</interceptor> 
+        <interceptor>org.jboss.ejb.plugins.security.PreSecurityInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.SecurityInterceptor</interceptor>
         <!-- CMT -->
         <interceptor transaction="Container">org.jboss.ejb.plugins.TxInterceptorCMT</interceptor>
@@ -795,8 +795,8 @@
         <interceptor>org.jboss.resource.connectionmanager.CachedConnectionInterceptor</interceptor>
       </container-interceptors>
       <instance-pool>org.jboss.ejb.plugins.StatelessSessionInstancePool</instance-pool>
-      <instance-cache></instance-cache>
-      <persistence-manager></persistence-manager>
+      <instance-cache/>
+      <persistence-manager/>
       <container-pool-conf>
         <MaximumSize>100</MaximumSize>
       </container-pool-conf>
@@ -815,7 +815,7 @@
       <container-interceptors>
         <interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor>
-        <interceptor>org.jboss.ejb.plugins.security.PreSecurityInterceptor</interceptor> 
+        <interceptor>org.jboss.ejb.plugins.security.PreSecurityInterceptor</interceptor>
         <!-- CMT -->
         <interceptor transaction="Container">org.jboss.ejb.plugins.TxInterceptorCMT</interceptor>
         <interceptor transaction="Container">org.jboss.ejb.plugins.CallValidationInterceptor</interceptor>
@@ -858,7 +858,7 @@
         <interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.CleanShutdownInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor>
-        <interceptor>org.jboss.ejb.plugins.security.PreSecurityInterceptor</interceptor> 
+        <interceptor>org.jboss.ejb.plugins.security.PreSecurityInterceptor</interceptor>
         <!-- CMT -->
         <interceptor transaction="Container">org.jboss.ejb.plugins.TxInterceptorCMT</interceptor>
         <interceptor transaction="Container">org.jboss.ejb.plugins.CallValidationInterceptor</interceptor>
@@ -866,7 +866,7 @@
         <!-- BMT -->
         <interceptor transaction="Bean">org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor</interceptor>
         <interceptor transaction="Bean">org.jboss.ejb.plugins.TxInterceptorBMT</interceptor>
-        <interceptor transaction="Bean">org.jboss.ejb.plugins.CallValidationInterceptor</interceptor> 
+        <interceptor transaction="Bean">org.jboss.ejb.plugins.CallValidationInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.SecurityInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.StatefulSessionSecurityInterceptor</interceptor>
         <interceptor>org.jboss.resource.connectionmanager.CachedConnectionInterceptor</interceptor>
@@ -909,7 +909,7 @@
       <container-interceptors>
         <interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor>
-        <interceptor>org.jboss.ejb.plugins.security.PreSecurityInterceptor</interceptor> 
+        <interceptor>org.jboss.ejb.plugins.security.PreSecurityInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.SecurityInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.TxInterceptorCMT</interceptor>
         <interceptor>org.jboss.ejb.plugins.CallValidationInterceptor</interceptor>
@@ -953,7 +953,7 @@
         <interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.CleanShutdownInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor>
-        <interceptor>org.jboss.ejb.plugins.security.PreSecurityInterceptor</interceptor> 
+        <interceptor>org.jboss.ejb.plugins.security.PreSecurityInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.SecurityInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.TxInterceptorCMT</interceptor>
         <interceptor>org.jboss.ejb.plugins.CallValidationInterceptor</interceptor>
@@ -1002,7 +1002,7 @@
       <container-interceptors>
         <interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor>
-        <interceptor>org.jboss.ejb.plugins.security.PreSecurityInterceptor</interceptor> 
+        <interceptor>org.jboss.ejb.plugins.security.PreSecurityInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.SecurityInterceptor</interceptor>
         <interceptor>org.jboss.ejb.plugins.TxInterceptorCMT</interceptor>
         <interceptor>org.jboss.ejb.plugins.CallValidationInterceptor</interceptor>
@@ -1047,8 +1047,8 @@
         <interceptor>org.jboss.resource.connectionmanager.CachedConnectionInterceptor</interceptor>
       </container-interceptors>
       <instance-pool>org.jboss.ejb.plugins.MessageDrivenInstancePool</instance-pool>
-      <instance-cache></instance-cache>
-      <persistence-manager></persistence-manager>
+      <instance-cache/>
+      <persistence-manager/>
       <container-pool-conf>
         <MaximumSize>100</MaximumSize>
       </container-pool-conf>
@@ -1073,8 +1073,8 @@
         <interceptor>org.jboss.resource.connectionmanager.CachedConnectionInterceptor</interceptor>
       </container-interceptors>
       <instance-pool>org.jboss.ejb.plugins.MessageDrivenInstancePool</instance-pool>
-      <instance-cache></instance-cache>
-      <persistence-manager></persistence-manager>
+      <instance-cache/>
+      <persistence-manager/>
       <container-pool-conf>
         <MaximumSize>100</MaximumSize>
       </container-pool-conf>
@@ -1099,8 +1099,8 @@
         <interceptor>org.jboss.resource.connectionmanager.CachedConnectionInterceptor</interceptor>
       </container-interceptors>
       <instance-pool>org.jboss.ejb.plugins.MessageDrivenInstancePool</instance-pool>
-      <instance-cache></instance-cache>
-      <persistence-manager></persistence-manager>
+      <instance-cache/>
+      <persistence-manager/>
       <container-pool-conf>
         <MaximumSize>100</MaximumSize>
       </container-pool-conf>

Modified: trunk/server/src/etc/conf/default/bootstrap/profile.xml
===================================================================
--- trunk/server/src/etc/conf/default/bootstrap/profile.xml	2009-06-23 14:32:01 UTC (rev 90525)
+++ trunk/server/src/etc/conf/default/bootstrap/profile.xml	2009-06-23 14:53:32 UTC (rev 90526)
@@ -73,7 +73,8 @@
     <destroy method="flush"/>
   </bean>
 
-  <bean name="StructureModificationChecker" class="org.jboss.deployers.vfs.spi.structure.modified.MetaDataStructureModificationChecker">
+  <!-- This just checks metadata locations -->
+  <bean name="MetaDataStructureModificationChecker" class="org.jboss.deployers.vfs.spi.structure.modified.MetaDataStructureModificationChecker">
     <constructor>
       <parameter><inject bean="MainDeployer" /></parameter>
     </constructor>
@@ -81,6 +82,36 @@
     <property name="filter"><bean class="org.jboss.system.server.profile.basic.XmlIncludeVirtualFileFilter" /></property>
   </bean>
 
+  <!-- Synchs modifed files -->
+  <bean name="SynchAdapter" class="org.jboss.deployers.vfs.spi.structure.modified.OverrideSynchAdapter"/>
+
+  <!-- We just visit wars, but exclude classes, lib, dev dirs -->
+  <bean name="WebVisitorAttributes" class="org.jboss.system.server.profile.basic.IncludeExcludeVisitorAttributes">
+    <constructor>
+      <parameter>
+        <set>
+          <value>.war</value>
+        </set>
+      </parameter>
+      <parameter>
+        <set>
+          <value>WEB-INF/classes</value>
+          <value>WEB-INF/lib</value>
+          <value>WEB-INF/dev</value>
+        </set>
+      </parameter>
+    </constructor>
+  </bean>
+
+  <bean name="StructureModificationChecker" class="org.jboss.deployers.vfs.spi.structure.modified.SynchWrapperModificationChecker">
+    <constructor>
+      <parameter><inject bean="MetaDataStructureModificationChecker"/></parameter>
+      <parameter><inject bean="SynchAdapter"/></parameter>
+    </constructor>
+    <property name="originalAttributes"><inject bean="WebVisitorAttributes"/></property>
+    <property name="tempAttributes"><inject bean="WebVisitorAttributes"/></property>
+  </bean>
+
 	<bean name="BasicProfileFactory" class="org.jboss.system.server.profileservice.repository.BasicProfileFactory">
 		<property name="profileRepository"><inject bean="ProfileRepositoryFactory" /></property>
 	</bean>

Copied: trunk/system/src/main/org/jboss/system/server/profile/basic/IncludeExcludeVisitorAttributes.java (from rev 90514, trunk/system/src/main/org/jboss/system/server/profile/basic/XmlIncludeVirtualFileFilter.java)
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profile/basic/IncludeExcludeVisitorAttributes.java	                        (rev 0)
+++ trunk/system/src/main/org/jboss/system/server/profile/basic/IncludeExcludeVisitorAttributes.java	2009-06-23 14:53:32 UTC (rev 90526)
@@ -0,0 +1,92 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.system.server.profile.basic;
+
+import java.net.URL;
+import java.util.Collections;
+import java.util.Set;
+
+import org.jboss.logging.Logger;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.VirtualFileFilter;
+import org.jboss.virtual.VisitorAttributes;
+
+/**
+ * Include/exclude visitor attributes.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class IncludeExcludeVisitorAttributes extends VisitorAttributes
+{
+   private Logger log = Logger.getLogger(getClass());
+
+   private Set<String> includes;
+   private Set<String> excludes;
+
+   public IncludeExcludeVisitorAttributes(Set<String> includes, Set<String> excludes)
+   {
+      if (includes == null)
+         includes = Collections.emptySet();
+      if (excludes == null)
+         excludes = Collections.emptySet();
+
+      this.includes = includes;
+      this.excludes = excludes;
+
+      setIncludeRoot(false);
+      setLeavesOnly(true);
+      setRecurseFilter(new RecurseFilter());
+   }
+
+   private class RecurseFilter implements VirtualFileFilter
+   {
+      public boolean accepts(VirtualFile file)
+      {
+         try
+         {
+            URL url = file.toURL();
+            String urlString = url.toExternalForm();
+
+            for (String include : includes)
+            {
+               if (urlString.contains(include) == false)
+                  return false;
+            }
+
+            for (String exclude : excludes)
+            {
+               if (urlString.contains(exclude))
+                  return false;
+            }
+
+            return true;
+         }
+         catch (Exception e)
+         {
+            if (log.isTraceEnabled())
+               log.trace("Exception while filtering file: " + file, e);
+
+            return false;
+         }
+      }
+   }
+}
\ No newline at end of file

Modified: trunk/system/src/main/org/jboss/system/server/profile/basic/XmlIncludeVirtualFileFilter.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profile/basic/XmlIncludeVirtualFileFilter.java	2009-06-23 14:32:01 UTC (rev 90525)
+++ trunk/system/src/main/org/jboss/system/server/profile/basic/XmlIncludeVirtualFileFilter.java	2009-06-23 14:53:32 UTC (rev 90526)
@@ -21,18 +21,17 @@
  */
 package org.jboss.system.server.profile.basic;
 
-import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.VirtualFileFilter;
+import org.jboss.deployers.vfs.spi.structure.modified.AbstractPathNameFilter;
 
 /**
  * Include only .xml files.
  *
  * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
  */
-public class XmlIncludeVirtualFileFilter implements VirtualFileFilter
+public class XmlIncludeVirtualFileFilter extends AbstractPathNameFilter
 {
-   public boolean accepts(VirtualFile file)
+   public boolean accepts(String path)
    {
-      return file.getName().endsWith(".xml");
+      return path.endsWith(".xml");
    }
 }
\ No newline at end of file

Added: trunk/system/src/main/org/jboss/system/tools/DeploymentRepositoryAdapter.java
===================================================================
--- trunk/system/src/main/org/jboss/system/tools/DeploymentRepositoryAdapter.java	                        (rev 0)
+++ trunk/system/src/main/org/jboss/system/tools/DeploymentRepositoryAdapter.java	2009-06-23 14:53:32 UTC (rev 90526)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.system.tools;
+
+import java.net.URISyntaxException;
+import java.net.URL;
+
+/**
+ * Deployment repository adapter.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public interface DeploymentRepositoryAdapter
+{
+   /**
+    * Suspend scan.
+    */
+   void suspend();
+
+   /**
+    * Resume scan.
+    */
+   void resume();
+
+   /**
+    * Add url.
+    *
+    * @param url the url
+    * @throws URISyntaxException for any error
+    */
+   void addURL(URL url) throws URISyntaxException;
+
+   /**
+    * Remove url.
+    *
+    * @param url the url
+    * @throws URISyntaxException for any error
+    */
+   void removeURL(URL url) throws URISyntaxException;
+
+   /**
+    * Does this repository contain a url.
+    *
+    * @param url the url
+    * @return true if the url is contained
+    * @throws URISyntaxException for any error
+    */
+   boolean hasURL(URL url) throws URISyntaxException;
+
+   /**
+    * List deployed urls as strings.
+    *
+    * @return the list of deployed urls
+    */
+   String[] listDeployedURLs();
+}
\ No newline at end of file

Added: trunk/system/src/main/org/jboss/system/tools/DeploymentScanner.java
===================================================================
--- trunk/system/src/main/org/jboss/system/tools/DeploymentScanner.java	                        (rev 0)
+++ trunk/system/src/main/org/jboss/system/tools/DeploymentScanner.java	2009-06-23 14:53:32 UTC (rev 90526)
@@ -0,0 +1,154 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.system.tools;
+
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+import org.jboss.aop.microcontainer.aspects.jmx.JMX;
+import org.jboss.beans.metadata.api.annotations.Start;
+import org.jboss.beans.metadata.api.annotations.Stop;
+import org.jboss.bootstrap.spi.ServerConfig;
+import org.jboss.util.StringPropertyReplacer;
+
+/**
+ * Deployment scanner impl - hooking into ProfileService.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+ at JMX(name = "jboss.deployment:flavor=URL,type=DeploymentScanner", exposedInterface = DeploymentScannerMBean.class, registerDirectly = true)
+public class DeploymentScanner implements DeploymentScannerMBean
+{
+   private ServerConfig serverConfig;
+   private URL serverHomeURL;
+
+   private DeploymentRepositoryAdapter adapter;
+
+   public DeploymentScanner(DeploymentRepositoryAdapter adapter)
+   {
+      if (adapter == null)
+         throw new IllegalArgumentException("Null adapter");
+
+      this.adapter = adapter;
+   }
+
+   /**
+    * Create server home.
+    */
+   public void create()
+   {
+      if (serverConfig == null)
+         throw new IllegalArgumentException("Null server config.");
+
+      serverHomeURL = serverConfig.getServerHomeURL();
+   }
+
+   @Start(ignored = true)
+   public void start()
+   {
+      adapter.resume();
+   }
+
+   @Stop(ignored = true)
+   public void stop()
+   {
+      adapter.suspend();
+   }
+
+   public void addURL(String url) throws MalformedURLException, URISyntaxException
+   {
+      if (url == null)
+         throw new IllegalArgumentException("Null url");
+
+      addURL(makeURL(url));
+   }
+
+   public void addURL(URL url) throws URISyntaxException
+   {
+      if (url == null)
+         throw new IllegalArgumentException("Null url");
+
+      adapter.addURL(url);
+   }
+
+   public void removeURL(String url) throws MalformedURLException, URISyntaxException
+   {
+      if (url == null)
+         throw new IllegalArgumentException("Null url");
+
+      removeURL(makeURL(url));
+   }
+
+   public void removeURL(URL url) throws URISyntaxException
+   {
+      if (url == null)
+         throw new IllegalArgumentException("Null url");
+
+      adapter.removeURL(url);
+   }
+
+   public boolean hasURL(String url) throws MalformedURLException, URISyntaxException
+   {
+      if (url == null)
+         throw new IllegalArgumentException("Null url");
+
+      return hasURL(makeURL(url));
+   }
+
+   public boolean hasURL(URL url) throws URISyntaxException
+   {
+      if (url == null)
+         throw new IllegalArgumentException("Null url");
+
+      return adapter.hasURL(url);
+   }
+
+   public String[] listDeployedURLs()
+   {
+      return adapter.listDeployedURLs();
+   }
+
+   /**
+    * A helper to make a URL from a full url, or a filespec.
+    *
+    * @param urlspec the url string
+    * @return url based on server home
+    * @throws MalformedURLException for any error
+    */
+   protected URL makeURL(String urlspec) throws MalformedURLException
+   {
+      // First replace URL with appropriate properties
+      urlspec = StringPropertyReplacer.replaceProperties(urlspec);
+      return new URL(serverHomeURL, urlspec);
+   }
+
+   /**
+    * Set the server config.
+    *
+    * @param serverConfig the server config
+    */
+   public void setServerConfig(ServerConfig serverConfig)
+   {
+      this.serverConfig = serverConfig;
+   }
+}

Added: trunk/system/src/main/org/jboss/system/tools/DeploymentScannerMBean.java
===================================================================
--- trunk/system/src/main/org/jboss/system/tools/DeploymentScannerMBean.java	                        (rev 0)
+++ trunk/system/src/main/org/jboss/system/tools/DeploymentScannerMBean.java	2009-06-23 14:53:32 UTC (rev 90526)
@@ -0,0 +1,104 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.system.tools;
+
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+/**
+ * Deployment api for tools.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public interface DeploymentScannerMBean
+{
+   /**
+    * Enable scanning.
+    */
+   void start();
+
+   /**
+    * Disable scanning.
+    */
+   void stop();
+
+   /**
+    * Add url to scanner.
+    *
+    * @param url the url
+    * @throws MalformedURLException for any error
+    * @throws URISyntaxException for any error
+    */
+   void addURL(String url) throws MalformedURLException, URISyntaxException;
+
+   /**
+    * Add url to scanner.
+    *
+    * @param url the url
+    * @throws URISyntaxException for any error
+    */
+   void addURL(URL url) throws URISyntaxException;
+
+   /**
+    * Add url to scanner.
+    *
+    * @param url the url
+    * @throws MalformedURLException for any error
+    * @throws URISyntaxException for any error
+    */
+   void removeURL(String url) throws MalformedURLException, URISyntaxException;
+
+   /**
+    * Add url to scanner.
+    *
+    * @param url the url
+    * @throws URISyntaxException for any error
+    */
+   void removeURL(URL url) throws URISyntaxException;
+
+   /**
+    * Does this repository contain a url.
+    *
+    * @param url the url
+    * @return true if the url is contained
+    * @throws MalformedURLException for any error
+    * @throws URISyntaxException for any error
+    */
+   boolean hasURL(String url) throws MalformedURLException, URISyntaxException;
+
+   /**
+    * Does this repository contain a url.
+    *
+    * @param url the url
+    * @return true if the url is contained
+    * @throws URISyntaxException for any error
+    */
+   boolean hasURL(URL url) throws URISyntaxException;
+
+   /**
+    * List deployed urls as strings.
+    *
+    * @return the list of deployed urls
+    */
+   String[] listDeployedURLs();
+}
\ No newline at end of file

Added: trunk/system/src/main/org/jboss/system/tools/ProfileServiceDeploymentRepositoryAdapter.java
===================================================================
--- trunk/system/src/main/org/jboss/system/tools/ProfileServiceDeploymentRepositoryAdapter.java	                        (rev 0)
+++ trunk/system/src/main/org/jboss/system/tools/ProfileServiceDeploymentRepositoryAdapter.java	2009-06-23 14:53:32 UTC (rev 90526)
@@ -0,0 +1,338 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.system.tools;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.jboss.deployers.vfs.spi.structure.modified.StructureModificationChecker;
+import org.jboss.logging.Logger;
+import org.jboss.profileservice.spi.ModificationInfo;
+import org.jboss.profileservice.spi.MutableProfile;
+import org.jboss.profileservice.spi.NoSuchProfileException;
+import org.jboss.profileservice.spi.Profile;
+import org.jboss.profileservice.spi.ProfileDeployment;
+import org.jboss.profileservice.spi.ProfileKey;
+import org.jboss.profileservice.spi.ProfileService;
+import org.jboss.system.server.profileservice.hotdeploy.Scanner;
+import org.jboss.system.server.profileservice.repository.HotDeploymentRepository;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * Profile deployment repository adapter.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class ProfileServiceDeploymentRepositoryAdapter implements DeploymentRepositoryAdapter
+{
+   private static final Logger log = Logger.getLogger(ProfileServiceDeploymentRepositoryAdapter.class);
+   private static final ProfileKey profileName = new ProfileKey("deployment-scanner-profile");
+
+   private Scanner scanner;
+   private ProfileService ps;
+   private StructureModificationChecker checker;
+
+   private DeploymentScannerProfile profile;
+
+   public ProfileServiceDeploymentRepositoryAdapter(Scanner scanner, ProfileService ps, StructureModificationChecker checker)
+   {
+      if (scanner == null)
+         throw new IllegalArgumentException("Null scanner");
+      if (ps == null)
+         throw new IllegalArgumentException("Null profile service");
+      if (checker == null)
+         throw new IllegalArgumentException("Null structure checker");
+
+      this.scanner = scanner;
+      this.ps = ps;
+      this.checker = checker;
+   }
+
+   /**
+    * Create profile.
+    *
+    * @throws Exception for any error
+    */
+   public void create() throws Exception
+   {
+      this.profile = new DeploymentScannerProfile(checker);
+      // Create the profile
+      registerProfile();
+   }
+
+   /**
+    * Stop profile.
+    */
+   public void destroy()
+   {
+      stopProfile();
+   }
+
+   /**
+    * Register profile.
+    *
+    * @throws Exception for any error
+    */
+   protected void registerProfile() throws Exception
+   {
+      if(this.ps == null)
+         throw new IllegalStateException("Null profile service.");
+
+      // Register
+      this.ps.registerProfile(profile);
+
+      // Activate
+      log.debug("Activating deployment scanner profile " + profileName);
+      this.ps.activateProfile(profileName);
+      this.ps.validateProfile(profileName);
+   }
+
+   public void resume()
+   {
+      scanner.resume();
+   }
+
+   public void suspend()
+   {
+      scanner.suspend();
+   }
+
+   /**
+    * Stop deactivates and unregisters the transient deployments profile.
+    */
+   public void stopProfile()
+   {
+      try
+      {
+         // Deactivate
+         log.debug("Deactivating deployment scanner profile: " + profileName);
+         this.ps.deactivateProfile(profileName);
+      }
+      catch(Exception e)
+      {
+         log.debug("Failed to deactivate deployment scanner profile: ", e);
+      }
+      try
+      {
+         // Unregister
+         log.debug("Unregistering transient profile: " + profileName);
+         this.ps.unregisterProfile(profileName);
+      }
+      catch(Exception e)
+      {
+         log.debug("Failed to unregister deployment scanner profile: ", e);
+      }
+   }
+
+   public void addURL(URL url) throws URISyntaxException
+   {
+      URI uri = url.toURI();
+      Collection<URI> uris = profile.getURIs();
+      if (uris.contains(uri) == false)
+      {
+         uris.add(uri);
+      }
+   }
+
+   public void removeURL(URL url) throws URISyntaxException
+   {
+      URI uri = url.toURI();
+      Collection<URI> uris = profile.getURIs();
+      uris.remove(uri);
+   }
+
+   public boolean hasURL(URL url) throws URISyntaxException
+   {
+      URI uri = url.toURI();
+      // TODO - this only checks this profile
+      return profile.getURIs().contains(uri);
+   }
+
+   public String[] listDeployedURLs()
+   {
+      List<String> urls = new ArrayList<String>();
+
+      Collection<ProfileKey> activeProfiles = ps.getActiveProfileKeys();
+      if (activeProfiles != null && activeProfiles.isEmpty() == false)
+      {
+         for (ProfileKey key : activeProfiles)
+         {
+            // The profile
+            Profile profile;
+            try
+            {
+               profile = ps.getActiveProfile(key);
+            }
+            catch (NoSuchProfileException ignore)
+            {
+               continue;
+            }
+            Collection<ProfileDeployment> deployments = profile.getDeployments();
+            if (deployments != null && deployments.isEmpty() == false)
+            {
+               for (ProfileDeployment pd : deployments)
+               {
+                  VirtualFile root = pd.getRoot();
+                  if (root != null)
+                  {
+                     try
+                     {
+                        urls.add(root.toURL().toExternalForm());
+                     }
+                     catch (Exception e)
+                     {
+                        log.warn("Exception while reading root's URL: " + root);
+                     }
+                  }
+               }
+            }
+         }
+      }
+
+      return urls.toArray(new String[urls.size()]);
+   }
+
+   public static class DeploymentScannerProfile extends HotDeploymentRepository implements MutableProfile
+   {
+      private volatile boolean enableHotDeployment;
+      private Map<URI, List<VirtualFile>> oldCache = new ConcurrentHashMap<URI, List<VirtualFile>>();
+      private Map<URI, List<VirtualFile>> newCache = new ConcurrentHashMap<URI, List<VirtualFile>>();
+
+      public DeploymentScannerProfile(StructureModificationChecker checker)
+      {
+         super(profileName, new URI[0]);
+         setChecker(checker);
+      }
+
+      /**
+       * Expose uris.
+       *
+       * @return the uris
+       */
+      Collection<URI> getURIs()
+      {
+         return uris;
+      }
+
+      public void addDeployment(ProfileDeployment deployment) throws Exception
+      {
+         super.addDeployment(deployment.getName(), deployment);
+      }
+
+      public void enableModifiedDeploymentChecks(boolean flag)
+      {
+         this.enableHotDeployment = flag;
+      }
+
+      @Override
+      public Collection<ModificationInfo> getModifiedDeployments() throws Exception
+      {
+         if(this.enableHotDeployment == false)
+            return Collections.emptySet();
+
+         return super.getModifiedDeployments();
+      }
+
+      @Override
+      protected void checkForAdditions(List<ModificationInfo> modified) throws Exception
+      {
+         // clear new cache
+         newCache.clear();
+         // do real check
+         super.checkForAdditions(modified);
+         // remove the old stuff - what's left of it
+         long lastModified = System.currentTimeMillis();
+         for (List<VirtualFile> files : oldCache.values())
+         {
+            for (VirtualFile file : files)
+            {
+               // the key is URI
+               String name = file.toURI().toString();
+               // it still exists - remove it
+               if (acceptsDeployment(name) == false)
+               {
+                  unlockRead();
+                  ProfileDeployment previous;
+                  try
+                  {
+                     // the actual removal, but we don't delete the file
+                     previous = removeDeployment(name, false);
+                  }
+                  finally
+                  {
+                     lockRead();
+                  }
+                  ModificationInfo removed = new ModificationInfo(previous, lastModified, ModificationInfo.ModifyStatus.REMOVED);
+                  modified.add(removed);
+               }
+            }
+         }
+         // switch new --> old
+         oldCache.clear();
+         oldCache.putAll(newCache);
+      }
+
+      @Override
+      protected void applyAddedDeployments(URI applicationDir, List<ModificationInfo> modified, List<VirtualFile> added) throws Exception
+      {
+         // remove from old cache - it exists
+         List<VirtualFile> files = oldCache.remove(applicationDir);
+         // do real apply
+         super.applyAddedDeployments(applicationDir, modified, added);
+         // add to old + put to new
+         if (files == null)
+            files = new ArrayList<VirtualFile>(added);
+         else
+            files.addAll(added);
+         newCache.put(applicationDir, files);
+      }
+
+      public ProfileKey getKey()
+      {
+         return profileName;
+      }
+
+      public Collection<ProfileKey> getSubProfiles()
+      {
+         return Collections.emptySet();
+      }
+
+      public boolean hasDeployment(String name)
+      {
+         // FIXME
+         return false;
+      }
+
+      public boolean isMutable()
+      {
+         return true;
+      }
+   }
+}
\ No newline at end of file

Copied: trunk/system-jmx/src/main/org/jboss/system/microcontainer/LifecycleInfo.java (from rev 90514, trunk/system-jmx/src/main/org/jboss/system/microcontainer/ServiceControllerContext.java)
===================================================================
--- trunk/system-jmx/src/main/org/jboss/system/microcontainer/LifecycleInfo.java	                        (rev 0)
+++ trunk/system-jmx/src/main/org/jboss/system/microcontainer/LifecycleInfo.java	2009-06-23 14:53:32 UTC (rev 90526)
@@ -0,0 +1,155 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.system.microcontainer;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.management.MBeanInfo;
+import javax.management.MBeanOperationInfo;
+import javax.management.MBeanServer;
+
+import org.jboss.dependency.spi.Controller;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.dependency.spi.ControllerStateModel;
+import org.jboss.system.ServiceController;
+
+/**
+ * Holds the needed kernel bus lifecycle invocation info.
+ * Used by {@link ServiceControllerContext#lifecycleInvocation(String, Object[], String[])}
+ * to make invocations on the MBean lifecycle methods.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class LifecycleInfo
+{
+   private ServiceControllerContext context;
+   private Map<String, StateInfo> lifecycleOps;
+
+   /**
+    * @param context the ServiceControllerContext
+    * @throws Throwable for any error
+    */
+   public LifecycleInfo(ServiceControllerContext context) throws Throwable
+   {
+      if (context == null)
+         throw new IllegalArgumentException("Null context");
+
+      this.context = context;
+      // build possible lifecycle ops
+      lifecycleOps = new HashMap<String, StateInfo>();
+      lifecycleOps.put("create", new StateInfo(false, true, ControllerState.CREATE));
+      lifecycleOps.put("start", new StateInfo(false, true, ControllerState.INSTALLED));
+      lifecycleOps.put("stop", new StateInfo(false, false, ControllerState.CREATE));
+      lifecycleOps.put("destroy", new StateInfo(false, false, ControllerState.CONFIGURED));
+
+      ServiceController controller = context.getServiceController();
+      MBeanServer server = controller.getMBeanServer();
+      if (server != null)
+      {
+         MBeanInfo info = server.getMBeanInfo(context.getObjectName());
+         MBeanOperationInfo[] ops = info.getOperations();
+         if (ops != null)
+         {
+            for (MBeanOperationInfo op : ops)
+            {
+               String name = op.getName();
+
+               StateInfo flag = lifecycleOps.get(name);
+               if (flag == null)
+               {
+                  continue;
+               }
+
+               // Validate that is a no-arg void return type method
+               if (op.getReturnType().equals("void") == false)
+               {
+                  continue;
+               }
+               if (op.getSignature().length != 0)
+               {
+                  continue;
+               }
+
+               flag.opExists = true;
+            }
+         }
+      }
+   }
+
+   /**
+    * Is this invocation a lifecycle invocation.
+    *
+    * Return state value to which this context should be moved
+    * or return current state if we're already past the lifecycle state
+    * or null if the invocation is actually not a lifecycle invocation.
+    *
+    * @param opName operation name
+    * @param signature method's parameter types / signatures
+    * @return state to which we should move this context, or null if this is not lifecycle invocation
+    * @throws Throwable for any error
+    */
+   public ControllerState lifecycleInvocation(String opName, String[] signature) throws Throwable
+   {
+      if (signature != null && signature.length > 0)
+         return null;
+
+      StateInfo flag = lifecycleOps.get(opName);
+      if (flag == null || flag.opExists == false)
+         return null;
+
+      Controller controller = context.getController();
+      ControllerStateModel model = controller.getStates();
+      ControllerState state = context.getState();
+      if (flag.installPhase)
+      {
+         if (model.isAfterState(flag.state, state))
+            return flag.state;
+         else
+            return state;
+      }
+      else
+      {
+         if (model.isBeforeState(flag.state, state))
+            return flag.state;
+         else
+            return state;
+      }
+   }
+
+   /**
+    * State info holder.
+    */
+   private class StateInfo
+   {
+      boolean opExists;
+      boolean installPhase;
+      ControllerState state;
+
+      private StateInfo(boolean opExists, boolean installPhase, ControllerState state)
+      {
+         this.opExists = opExists;
+         this.installPhase = installPhase;
+         this.state = state;
+      }
+   }
+}

Modified: trunk/system-jmx/src/main/org/jboss/system/microcontainer/ServiceControllerContext.java
===================================================================
--- trunk/system-jmx/src/main/org/jboss/system/microcontainer/ServiceControllerContext.java	2009-06-23 14:32:01 UTC (rev 90525)
+++ trunk/system-jmx/src/main/org/jboss/system/microcontainer/ServiceControllerContext.java	2009-06-23 14:53:32 UTC (rev 90526)
@@ -33,7 +33,7 @@
 import org.jboss.dependency.spi.ControllerMode;
 import org.jboss.dependency.spi.ControllerState;
 import org.jboss.dependency.spi.DependencyItem;
-import org.jboss.dependency.spi.dispatch.InvokeDispatchContext;
+import org.jboss.dependency.spi.dispatch.LifecycleDispatchContext;
 import org.jboss.system.Service;
 import org.jboss.system.ServiceContext;
 import org.jboss.system.ServiceController;
@@ -48,7 +48,7 @@
  * @author <a href="ales.justin at jboss.com">Ales Justin</a>
  * @version $Revision$
  */
-public class ServiceControllerContext extends AbstractControllerContext implements InvokeDispatchContext
+public class ServiceControllerContext extends AbstractControllerContext implements LifecycleDispatchContext
 {
    /** The ObjectName */
    private ObjectName objectName;
@@ -64,7 +64,10 @@
 
    // Whether to include the lifecycle
    private boolean includeLifecycle = true;
-   
+
+   /** The lifecycle info */
+   private volatile LifecycleInfo lifecycleInfo;
+
    /**
     * Create a new ServiceControllerContext.
     * 
@@ -199,6 +202,14 @@
       }
    }
 
+   public ControllerState lifecycleInvocation(String name, Object parameters[], String[] signature) throws Throwable
+   {
+      if (lifecycleInfo == null)
+         lifecycleInfo = new LifecycleInfo(this);
+
+      return lifecycleInfo.lifecycleInvocation(name, signature);
+   }
+
    /**
     * Get the ObjectName.
     * 

Modified: trunk/system-jmx/src/main/org/jboss/system/microcontainer/ServiceProxy.java
===================================================================
--- trunk/system-jmx/src/main/org/jboss/system/microcontainer/ServiceProxy.java	2009-06-23 14:32:01 UTC (rev 90525)
+++ trunk/system-jmx/src/main/org/jboss/system/microcontainer/ServiceProxy.java	2009-06-23 14:53:32 UTC (rev 90526)
@@ -25,6 +25,7 @@
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
 import java.util.HashMap;
+import java.util.Map;
 
 import javax.management.MBeanInfo;
 import javax.management.MBeanOperationInfo;
@@ -51,6 +52,7 @@
  * @author <a href="mailto:jason at planet57.com">Jason Dillon</a>
  * @author <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
  * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
  * @version $Revision$
  */
 public class ServiceProxy implements InvocationHandler
@@ -59,20 +61,20 @@
     * A mapping from the Service interface method names to the corresponding
     * index into the ServiceProxy.hasOp array.
     */
-   private static HashMap<String, Integer> serviceOpMap = new HashMap<String, Integer>();
+   private static Map<String, Integer> serviceOpMap = new HashMap<String, Integer>();
 
    // A singleton proxy with no callouts
    private static Service NO_LIFECYCLE_CALLOUT;
-   
+
    /**
     * Initialize the service operation map.
     */
    static
    {
-      serviceOpMap.put("create", new Integer(0));
-      serviceOpMap.put("start", new Integer(1));
-      serviceOpMap.put("destroy", new Integer(2));
-      serviceOpMap.put("stop", new Integer(3));
+      serviceOpMap.put("create", 0);
+      serviceOpMap.put("start", 1);
+      serviceOpMap.put("destroy", 2);
+      serviceOpMap.put("stop", 3);
       Class<?>[] interfaces = { Service.class };
       NO_LIFECYCLE_CALLOUT = (Service) Proxy.newProxyInstance(Service.class.getClassLoader(), interfaces, NoLifecycleCallout.INSTANCE);
    }
@@ -108,17 +110,18 @@
     */
    public static Service getServiceProxy(ObjectName objectName, MBeanServer server, boolean includeLifecycle) throws Exception
    {
-      Service service = null;
-      MBeanInfo info = server.getMBeanInfo(objectName);
-      MBeanOperationInfo[] opInfo = info.getOperations();
-      Class<?>[] interfaces = { Service.class };
-      InvocationHandler handler = new ServiceProxy(objectName, server, opInfo);
-      if (includeLifecycle == false)
-         service = NO_LIFECYCLE_CALLOUT; 
+      if (includeLifecycle)
+      {
+         MBeanInfo info = server.getMBeanInfo(objectName);
+         MBeanOperationInfo[] opInfo = info.getOperations();
+         Class<?>[] interfaces = { Service.class };
+         InvocationHandler handler = new ServiceProxy(objectName, server, opInfo);
+         return (Service) Proxy.newProxyInstance(Service.class.getClassLoader(), interfaces, handler);
+      }
       else
-         service = (Service) Proxy.newProxyInstance(Service.class.getClassLoader(), interfaces, handler);
-
-      return service;
+      {
+         return NO_LIFECYCLE_CALLOUT;
+      }
    }
 
    /**
@@ -135,9 +138,8 @@
       this.server = server;
       this.objectName = objectName;
 
-      for (int op = 0; op < opInfo.length; op++)
+      for (MBeanOperationInfo info : opInfo)
       {
-         MBeanOperationInfo info = opInfo[op];
          String name = info.getName();
 
          if (name.equals(ServiceController.JBOSS_INTERNAL_LIFECYCLE))
@@ -162,7 +164,7 @@
             continue;
          }
 
-         hasOp[opID.intValue()] = true;
+         hasOp[opID] = true;
       }
    }
 
@@ -171,14 +173,13 @@
     * corresponding hasOp array element is true, dispatch the method to the
     * mbean we are proxying.
     *
-    * @param proxy
-    * @param method
-    * @param args
-    * @return             Always null.
-    * @throws Throwable
+    * @param proxy the proxy
+    * @param method the method
+    * @param args the args
+    * @return always null.
+    * @throws Throwable for any error
     */
-   public Object invoke(Object proxy, Method method, Object[] args)
-         throws Throwable
+   public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
    {
       String name = method.getName();
 
@@ -197,7 +198,7 @@
 
       Integer opID = serviceOpMap.get(name);
 
-      if (opID != null && hasOp[opID.intValue()] == true)
+      if (opID != null && hasOp[opID])
       {
          // deal with those pesky JMX exceptions
          try
@@ -213,11 +214,11 @@
 
       return null;
    }
-   
+
    private static class NoLifecycleCallout implements InvocationHandler
    {
       private static NoLifecycleCallout INSTANCE = new NoLifecycleCallout();
-      
+
       public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
       {
          return null;




More information about the jboss-cvs-commits mailing list