axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepal jayasinghe <>
Subject Re: [axis2] AxisConfiguration.getService() and inactive services
Date Thu, 21 May 2009 02:55:52 GMT
Hi Glen,
> Throwing an exception to do this is (IMHO) bad code.  It's expensive, slower,
> non-intuitive (what would you expect "getService()" to do?) and just plain
> annoying for people calling this method.
Well inactive service treat as same as  service is not there in the
system. So I do not see a big problem of throwing the exception (other
than it is costly). You will get the same exception if the service is
not deployed in the system or service is inactive. IMO, throwing the
exception is consistent, since we do the same thing for the operation,
module etc..
> getService(name) should return the AxisService matching the name if there is
> one, period, end of story, just like all the other accessors like it do.
No there should be a difference between active and inactive service. So
it should throw exception (or null) if the service is not there or inactive.
> If you don't want the dispatch code to call "isActive()" on the resulting
> service (which IMHO isn't that egregious), a getActiveService(name) utility
> method would be fine, which would simply return null if there was a service
> by the specified name that was inactive.  No exceptions necessary.
I like your idea, but my belief is we should not change those methods
now, since it is everywhere, may be we can introduce new methods.
> Thoughts?
> --Glen
> P.S.  This is all not to mention that "getServiceForActivation()" is a
> terrible name for a method that simply returns you a service.
I know, I should have changed that to getInactiveService or something.


View raw message