jsr77 specifies the name for the mbean representing the ejb itself.  Except for 
the domain name part, its the same as the map part of the geronimo gbean name 
for the ejb gbean.  Jsr77 is not my strong point but I thought there were 
supposed to be some statistics possibly available from the mbean for the ejb.  
You might want to make your mbeans "children" of the jsr77 ejb mbean,

There's a method for making a child abstract name in geronimo like this (from 
JSr77Naming.java in framework/modules/geronimo-kernel):

    public AbstractName createChildName(AbstractName parentAbstractName, 
Artifact artifact, String name, String type) {
        if (name == null) {
            throw new NullPointerException("No name supplied");
        }
        if (type == null) {
            throw new NullPointerException("No type supplied");
        }
        Map nameMap = new HashMap(parentAbstractName.getName());

        String parentType = (String) nameMap.remove(J2EE_TYPE);
        String parentName = (String) nameMap.remove(J2EE_NAME);
        if (parentType == null) {
            throw new IllegalArgumentException("parent name must have a 
j2eeType name component");
        }
        if (INVALID_GENERIC_PARENT_TYPE.equals(parentType)) {
            throw new IllegalArgumentException("You can't create a child of a 
generic typed gbean");
        }
        nameMap.put(parentType, parentName);
        nameMap.put(J2EE_TYPE, type);
        nameMap.put(J2EE_NAME, name);

        return new AbstractName(artifact,
                nameMap,
                createObjectName(nameMap));
    }

The crucial point here is the parent's last name component is name=foo, and 
this has to be turned into parentType=foo,name=foo-child.


I'm not sure what will happen in geronimo when all the gbeans are exposed in 
jmx and you add some more not backed by gbeans.  However, this is something 
we'll need to figure out.

thanks
david jencks


On May 10, 2010, at 7:44 PM, David Blevins wrote:

> Still largely uneducated when it comes to what is a good ObjectName and very 
> much looking for feedback.
> 
> Currently, we'll have three MBeans for each @Stateless bean, one to represent 
> the "Pool", one for "Invocations", and one just generic for the bean in 
> general (still hacking that one up).
> 
> What should the ObjectName for each of these be?
> 
> 
> -David
> 

Reply via email to