[jboss-user] [JBoss Microcontainer Users] - ManagementView API question/comment

ozizka@redhat.com do-not-reply at jboss.com
Tue Oct 27 22:32:42 EDT 2009


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



More information about the jboss-user mailing list