[jboss-cvs] JBossAS SVN: r95673 - branches/Branch_5_x/profileservice/src/main/org/jboss/profileservice/management.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Oct 28 05:39:21 EDT 2009
Author: emuckenhuber
Date: 2009-10-28 05:39:21 -0400 (Wed, 28 Oct 2009)
New Revision: 95673
Modified:
branches/Branch_5_x/profileservice/src/main/org/jboss/profileservice/management/ManagementViewImpl.java
Log:
don't throw an exception on getMatchingDeploymentNames and implement TODO
Modified: branches/Branch_5_x/profileservice/src/main/org/jboss/profileservice/management/ManagementViewImpl.java
===================================================================
--- branches/Branch_5_x/profileservice/src/main/org/jboss/profileservice/management/ManagementViewImpl.java 2009-10-28 08:54:37 UTC (rev 95672)
+++ branches/Branch_5_x/profileservice/src/main/org/jboss/profileservice/management/ManagementViewImpl.java 2009-10-28 09:39:21 UTC (rev 95673)
@@ -997,7 +997,8 @@
public void setProfileService(ProfileService ps)
{
this.ps = ps;
- log.debug("setProfileService: "+ps);
+ if(log.isTraceEnabled())
+ log.trace("setProfileService: "+ps);
}
public ManagedOperationProxyFactory getProxyFactory()
@@ -1028,7 +1029,8 @@
public void setMainDeployer(MainDeployer mainDeployer)
{
this.mainDeployer = mainDeployer;
- log.debug("setMainDeployer: "+mainDeployer);
+ if(log.isTraceEnabled())
+ log.trace("setMainDeployer: "+mainDeployer);
}
public MetaValueFactory getMetaValueFactory()
@@ -1119,12 +1121,16 @@
}
public Set<String> getMatchingDeploymentName(String regex)
- throws NoSuchDeploymentException
{
SecurityManager sm = System.getSecurityManager();
if(sm != null)
+ {
sm.checkPermission(MV_RUNTIME_PERMISSION);
-
+ }
+ if(regex == null)
+ {
+ throw new IllegalArgumentException("null regex");
+ }
Set<String> names = getDeploymentNames();
HashSet<String> matches = new HashSet<String>();
Pattern p = Pattern.compile(regex);
@@ -1132,26 +1138,36 @@
{
Matcher m = p.matcher(name);
if( m.matches() )
+ {
matches.add(name);
+ }
}
- if( matches.size() == 0 )
- {
- formatter.applyPattern(i18n.getString("ManagementView.NoSuchDeploymentException")); //$NON-NLS-1$
- Object[] args = {regex};
- String msg = formatter.format(args);
- throw new NoSuchDeploymentException(msg);
- }
return matches;
}
+
public Set<ManagedDeployment> getMatchingDeployments(String name, NameMatcher<ManagedDeployment> matcher)
- throws NoSuchDeploymentException, Exception
{
SecurityManager sm = System.getSecurityManager();
if(sm != null)
+ {
sm.checkPermission(MV_RUNTIME_PERMISSION);
-
+ }
+ if(name == null)
+ {
+ throw new IllegalArgumentException("null deployment name");
+ }
+ if(matcher == null)
+ {
+ throw new IllegalArgumentException("null deployment matcher");
+ }
Set<ManagedDeployment> matches = new HashSet<ManagedDeployment>();
- // TODO
+ for(ManagedDeployment deployment : this.managedDeployments.values())
+ {
+ if(matcher.matches(deployment, name))
+ {
+ matches.add(deployment);
+ }
+ }
return matches;
}
More information about the jboss-cvs-commits
mailing list