[jboss-cvs] JBossAS SVN: r109650 - in trunk: system/src/main/java/org/jboss/system/tools and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Dec 2 11:17:03 EST 2010
Author: emuckenhuber
Date: 2010-12-02 11:17:02 -0500 (Thu, 02 Dec 2010)
New Revision: 109650
Modified:
trunk/profileservice/src/resources/hdscanner-jboss-beans.xml
trunk/system/src/main/java/org/jboss/system/tools/ProfileServiceToolsFacade.java
trunk/testsuite/src/main/org/jboss/test/deployers/test/LegacyDeploymentScannerUnitTestCase.java
Log:
JBAS-8700
Modified: trunk/profileservice/src/resources/hdscanner-jboss-beans.xml
===================================================================
--- trunk/profileservice/src/resources/hdscanner-jboss-beans.xml 2010-12-02 16:16:06 UTC (rev 109649)
+++ trunk/profileservice/src/resources/hdscanner-jboss-beans.xml 2010-12-02 16:17:02 UTC (rev 109650)
@@ -17,6 +17,7 @@
<bean name="ProfileServiceDeploymentRepositoryAdapter" class="org.jboss.system.tools.LegacyDeploymentScannerAdapter">
<property name="profileService"><inject bean="jboss.profileservice:service=ProfileService" /></property>
<property name="repositoryManager"><inject bean="ArtifactRepositoryManager" /></property>
+ <property name="actionController"><inject bean="ActionController" /></property>
<property name="hdFactory"><inject bean="HDScannerFactory" /></property>
</bean>
Modified: trunk/system/src/main/java/org/jboss/system/tools/ProfileServiceToolsFacade.java
===================================================================
--- trunk/system/src/main/java/org/jboss/system/tools/ProfileServiceToolsFacade.java 2010-12-02 16:16:06 UTC (rev 109649)
+++ trunk/system/src/main/java/org/jboss/system/tools/ProfileServiceToolsFacade.java 2010-12-02 16:17:02 UTC (rev 109650)
@@ -28,6 +28,7 @@
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
+import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.jboss.profileservice.profile.metadata.plugin.HotDeploymentProfileMetaData;
@@ -35,8 +36,11 @@
import org.jboss.profileservice.profile.metadata.plugin.ScanPeriod;
import org.jboss.profileservice.repository.artifact.ArtifactRepositoryManager;
import org.jboss.profileservice.spi.NoSuchProfileException;
+import org.jboss.profileservice.spi.Profile;
import org.jboss.profileservice.spi.ProfileKey;
import org.jboss.profileservice.spi.ProfileService;
+import org.jboss.profileservice.spi.action.ActionController;
+import org.jboss.profileservice.spi.managed.ManagedProfile;
import org.jboss.profileservice.spi.metadata.ProfileMetaData;
import org.jboss.profileservice.spi.repository.ArtifactId;
import org.jboss.profileservice.spi.repository.ArtifactRepository;
@@ -65,6 +69,8 @@
/** The time unit. */
private TimeUnit timeUnit = TimeUnit.SECONDS;
+ private ActionController actionController;
+
/** The profile service. */
private ProfileService profileService;
@@ -154,6 +160,13 @@
this.repositoryManager = repositoryManager;
}
+ public ActionController getActionController() {
+ return actionController;
+ }
+ public void setActionController(ActionController actionController) {
+ this.actionController = actionController;
+ }
+
/**
* start()
*/
@@ -167,6 +180,9 @@
{
throw new IllegalStateException("null repository manager");
}
+ if(actionController == null) {
+ throw new IllegalStateException("null action controller");
+ }
}
/**
@@ -279,17 +295,19 @@
*
* @return the deployment urls.
*/
- public String[] listDeployedURLs()
- {
+ public String[] listDeployedURLs() {
final Collection<String> names = new HashSet<String>();
- for(final ArtifactRepository<ArtifactId> repository : repositoryManager.getRepositories())
- {
- final URI artifactRepositoryURI = repository.getRepositoryURI();
- names.add(artifactRepositoryURI.getPath());
+ for(final ProfileKey key : actionController.getActiveProfiles()) {
+ final ManagedProfile managed = actionController.getManagedProfile(key);
+ final Profile profile = managed.getProfile();
+ final Set<String> deploymentNames = profile.getDeploymentNames();
+ if(deploymentNames != null && deploymentNames.isEmpty() == false) {
+ names.addAll(deploymentNames);
+ }
}
return names.toArray(new String[names.size()]);
}
-
+
/**
* Check whether a repository manages a certain {@code URI}.
*
Modified: trunk/testsuite/src/main/org/jboss/test/deployers/test/LegacyDeploymentScannerUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/test/LegacyDeploymentScannerUnitTestCase.java 2010-12-02 16:16:06 UTC (rev 109649)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/test/LegacyDeploymentScannerUnitTestCase.java 2010-12-02 16:17:02 UTC (rev 109650)
@@ -155,8 +155,6 @@
assertNotNull(deployments);
assertTrue(deployments.length > 1);
- URL directory = getDeployURL(deployDir);
- assertFalse(Arrays.binarySearch(deployments, directory.toURI().toString()) == -1);
}
public void testDeploymentMgrRedeploy() throws Exception
More information about the jboss-cvs-commits
mailing list