"ozizka(a)redhat.com" wrote :
| 1) Shouldn't the name be ...Names?
|
We actually use this as a regular expression and do Patter.compile(regex) - so the naming
should be fine.
"ozizka(a)redhat.com" wrote :
| 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;
| |
|
Yes, i agree - in this case throwing an exception does not make much sense, returning an
empty list would be better to use.
"ozizka(a)redhat.com" wrote :
| 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.
|
Hmm, getDeployment(String name) should throw an Exception though. It's not intended to
be used without previous actions like getDeploymentNames() - otherwise you'll never
know which deployments are deployed. Usually when getDeployment(...) throws an except it
would mean that the client and the management view are out of sync.
We definitely are going to review the interfaces to make them more user-friendly and try
to include some feedback we got so far.
Thanks,
Emanuel
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4262609#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...