[jboss-as7-dev] MSC service names in AS7

David M. Lloyd david.lloyd at redhat.com
Wed Jun 1 16:51:04 EDT 2011


On 06/01/2011 03:08 PM, David Bosschaert wrote:
>
>
> ----- Original Message -----
>> From: "David M. Lloyd"<david.lloyd at redhat.com>
>> To: jboss-as7-dev at lists.jboss.org
>> Sent: Wednesday, 1 June, 2011 9:02:28 PM
>> Subject: Re: [jboss-as7-dev] MSC service names in AS7
>> On 06/01/2011 02:54 PM, David Bosschaert wrote:
>>> Hi all,
>>>
>>> Just a quick question re service names in AS7. Is there any
>>> guidelines on the names you give your AS7 services? When I use a
>>> shortlived service, does it matter what name I give it?
>>
>> All services created by us start with "jboss.". Service names should
>> be
>> chosen in such a way as to make conflicts impossible. That's about it.
>
> Ok, thanks.
>
> One further question. Let's say my service performs some async action in start() and when that action is finished I'm not really interested in the service any more. Should I remove it somehow from the system then?

In other words, a one-time task which is triggered when all its 
dependencies start?  We don't have a generalized API for this.  There 
are subtle conceptual issues.

First, using a service will cause its dependencies to automatically 
start if they are, say, ON_DEMAND.  However if your service then 
immediately stops or is removed, the dependency services will stop 
again, which is not a useful semantic.

You can use listeners instead, however a listener can only presently be 
added to an installed service (i.e. you can't install a listener on a 
name in anticipation of a future service).

So the real question is, what problem are you trying to solve here?

> Additionally, let's say I have a service that can run more than once, should I give it a different name every time?

Services can be stopped and started repeatedly, and in fact it is part 
of the contract of a service that it must be able to do so.
-- 
- DML


More information about the jboss-as7-dev mailing list