[jboss-cvs] JBossAS SVN: r80100 - in trunk: system/src/main/org/jboss/system/server/profileservice/repository and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Oct 27 06:57:50 EDT 2008


Author: emuckenhuber
Date: 2008-10-27 06:57:50 -0400 (Mon, 27 Oct 2008)
New Revision: 80100

Modified:
   trunk/profileservice/src/main/org/jboss/profileservice/management/ManagementViewImpl.java
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java
   trunk/testsuite/src/main/org/jboss/test/profileservice/override/test/AbstractProfileServiceTest.java
   trunk/testsuite/src/resources/profileservice/override/profileservice-datasource.ear/META-INF/application.xml
Log:
[JBAS-6037] refresh managementView after a component update

Modified: trunk/profileservice/src/main/org/jboss/profileservice/management/ManagementViewImpl.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/ManagementViewImpl.java	2008-10-27 09:56:55 UTC (rev 80099)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/ManagementViewImpl.java	2008-10-27 10:57:50 UTC (rev 80100)
@@ -1003,19 +1003,14 @@
          }
       }
 
-      // update lastModified
-      long lastModified = System.currentTimeMillis();
       // TODO this updates the parent only - maybe we just need to update the child - if we also check it when restoring
-      parentMetaData.setLastModified(lastModified);
+      parentMetaData.setLastModified(System.currentTimeMillis());
       
       // Wrap 
       Map<String, Object> metaDataAttachment = Collections.singletonMap(RepositoryAttachmentMetaData.class.getName(), (Object) parentMetaData);
       
       // Update the repository deployment attachments
       activeProfile.updateDeployment(compDeployment, phase, metaDataAttachment);
-      
-      // TODO do we need to rebuild managed view after updating a component ? 
-      this.activeProfileLastModified = lastModified;
    }
 
    /**

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java	2008-10-27 09:56:55 UTC (rev 80099)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java	2008-10-27 10:57:50 UTC (rev 80100)
@@ -1170,6 +1170,9 @@
       
       // Store the repository metadata
       xmlSerializer.saveAttachment(deploymentPath + "metadata", metaData);
+      
+      //
+      this.lastModified = System.currentTimeMillis();
    }
    
    /**
@@ -1247,7 +1250,8 @@
          RepositoryAttachmentMetaData attachmentMetaData,
          boolean trace)
    {
-      boolean isParent = "".equals(contextName);
+      // The toplevel context
+      boolean isRoot = "".equals(contextName);
       
       if(trace)
          log.trace("Rebuilding StructureMetaData for context: " + contextName);
@@ -1294,7 +1298,7 @@
           MutableAttachments mutable =  new LazyPredeterminedManagedObjects(this.serializer, deploymentPath, availableAttachments);
           
           // TODO is there a better way to do this ?
-          if(isParent)
+          if(isRoot)
              deployment.setPredeterminedManagedObjects(mutable);
           else 
              info.setPredeterminedManagedObjects(mutable);

Modified: trunk/testsuite/src/main/org/jboss/test/profileservice/override/test/AbstractProfileServiceTest.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/profileservice/override/test/AbstractProfileServiceTest.java	2008-10-27 09:56:55 UTC (rev 80099)
+++ trunk/testsuite/src/main/org/jboss/test/profileservice/override/test/AbstractProfileServiceTest.java	2008-10-27 10:57:50 UTC (rev 80100)
@@ -45,7 +45,6 @@
 public abstract class AbstractProfileServiceTest extends JBossTestCase implements ProgressListener
 {
 
-   protected ManagementView activeView;
    protected DeploymentManager deployMgr;
 
    public AbstractProfileServiceTest(String name)
@@ -111,19 +110,17 @@
    protected ManagementView getManagementView()
       throws Exception
    {
-      if( activeView == null )
-      {
-         String profileName = getProfileName();
-         InitialContext ctx = getInitialContext();
-         ProfileService ps = (ProfileService) ctx.lookup("ProfileService");
-         activeView = ps.getViewManager();
-         ProfileKey defaultKey = new ProfileKey(profileName);
-         activeView.loadProfile(defaultKey);
-         // Init the VFS to setup the vfs* protocol handlers
-         VFS.init();
-      }
+      String profileName = getProfileName();
+      InitialContext ctx = getInitialContext();
+      ProfileService ps = (ProfileService) ctx.lookup("ProfileService");
+      ManagementView activeView = ps.getViewManager();
+      ProfileKey defaultKey = new ProfileKey(profileName);
+      activeView.loadProfile(defaultKey);
+      // Init the VFS to setup the vfs* protocol handlers
+      VFS.init();    
       return activeView;
    }
+   
    /**
     * Obtain the ProfileService.ManagementView
     * @return

Modified: trunk/testsuite/src/resources/profileservice/override/profileservice-datasource.ear/META-INF/application.xml
===================================================================
--- trunk/testsuite/src/resources/profileservice/override/profileservice-datasource.ear/META-INF/application.xml	2008-10-27 09:56:55 UTC (rev 80099)
+++ trunk/testsuite/src/resources/profileservice/override/profileservice-datasource.ear/META-INF/application.xml	2008-10-27 10:57:50 UTC (rev 80100)
@@ -9,7 +9,7 @@
     <module>
         <web>
             <web-uri>testWarDeployment.war</web-uri>
-            <context-root>/testWarDeployment-ear</context-root>
+            <context-root>/nestedWarDeployment</context-root>
         </web>
     </module>
 </application>




More information about the jboss-cvs-commits mailing list