Hi,

regarding ManagementView#getMatchingDeploymentName( String regex ):

1) Shouldn't the name be ...Names?

2) What's the point of throwing an exception in case of zero names found? Why 
not just reply with an empty set? Now when I just want to check remotely 
whether or not something is deployed, I have to:


  | public boolean isDeployed( String name ){
  | try {
  |   Set<String> names = currentProfileView.getMatchingDeploymentName( name );
  |   if( matchingNames.size() > 0 )
  |     return true;
  | } catch( Exception ex ){
  |   if( ex.getCause() != null && ex.getCause().getCause() != null &&
  |     ex.getCause().getCause() instanceof NoSuchDeploymentException ){
  |   return false;
  |   } else { 
  |      throw ex;
  |   }
  | }
  | 

instead of 


  | return currentProfileView.getMatchingDeploymentName( name ).size() > 0;
  | 

3) The same applies to getDeployment( String name ) - why not just return null?

Perhaps there are some tech reasons to do it this ugly way, but I would like it 
to have the API more user-friendly.

Thanks,
Ondra

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4262540#4262540

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4262540
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to