geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Wilkins <>
Subject Re: [General] Container interface and AbstractContainer
Date Thu, 14 Aug 2003 11:42:22 GMT

James Strachan wrote:
> On Thursday, August 14, 2003, at 11:56  am, Alex Blewitt wrote:
>>> Though as soon as I did this something hit me - if you add a 
>>> component by itself - and a component doesn't have an ObjectName (at 
>>> least on the Component interface today) then how does the Container 
>>> know the ObjectNames of the components? i.e. how can we implement the 
>>> getComponentNames() method?
>> (a) I don't think the getComponentNames() adds anything that you 
>> couldn't get yourself from the getComponents()
> Its there for JMX agents & GUIs. Its just 1 helper method. (Should 
> probably return ObjectName[] as its only real purpose is for JMX agents 
> right?)

Correct - but I'm happy to leave it for now as it is only a conveniance
method and we need to get the core semantics worked out.

>> (b) Is it true that every Component has an ObjectName? I don't think 
>> it does (necessarily), and I think this assumption could lead to bad 
>> coding ...
> Am not sure. Thats why I brought it up. Either it does or we add 
> components to a container with an ObjectName. Though I confess to not 
> knowing enough of jsr 77 & 88 to make that call.

According to JSR77 all our components should have ObjectNames.
Jan has proposed that we add getObjectName to the Component interface

(eventually it should probably be factored out to a ManagedObject
interface - but whatever it will be on component).

If we really do end up with components without object names, then we
should just make sure we handle a null return.  But I don't think
we will.

>>> Maybe I've not grokked this code fully yet but either Container needs 
>>> a getObjectName() or the addComponent() method should take an 
>>> ObjectName right? This is echo-ing Jan's previous comment that 
>>> Component should have a method...
>> The point of having a separate type for Component is that it should be 
>> a component, not an ObjectName.
>> If you were writing
>> public interface JMXContainer extends Container {
>> }
>> then you might want to restrict everything having an ObjectName, but 
>> that's not necessarily going to be the case.
> Remember that this stuff is internal to the container. Any old POJO or 
> MBean could be used as a component.

I don't think so.

Even if they are POJOs, JSR77 requires them to have a method that
returns the ObjectName of the MBean that represents/manages them.

So JMX infrastructure or not, we need JMX ObjectNames associated with
our components if we are to do JSR77.

View raw message