Olaf Bergner wrote:
I recently built merlin's jmx facility.

Wow - your brave!


Had to tweak the project.xml under
facilities/jmx a bit since it was lacking a <currentVersion> tag and thus
generated unversioned jars which couldn't be identified by merlin. Then I
built and ran the jmx tutorial under platform/tutorials. I did a
merlin --offline conf\hello.block and kept getting a
ComponentRegistrationException to the effect that HelloComponent did not
implement a required interface. I started digging in merlin's source code
(int's obviously not for the faint of heart)

:-)


and reached a tentative conclusion:

- The ComponentRegistrationException is thrown in
AbstractComponentRegistrationManager.verifyInterfaces(Object object, Class[]
interfaces) and states that "object" doesn't implement one of the interfaces
in "interfaces", where "interfaces" are supposedly all MBean interfaces
implemented by "object".

- In AbstractComponentRegistrationManager.register(ComponentModel
componentModel) the "object" above is obtained via componentModel.resolve().
I strongly suspect that resolve() returns not the component proper but a
proxy implementing all service interfaces but not necessarily the MBean
interfaces implemented by the component.

That's correct.


In order to verify my suspicion I patched tutorial.HelloComponent to declare
HelloMBean as a service interface in its .xinfo file. This did the trick.
Now I can see HelloMBean in the MX4J console and change its output string.

So it seems that currently merlin mandates that components declare their
MBean interfaces as service interfaces which IMHO is not desirable. Since
the ComponentRegistrationManager operates on a ComponentModel I tried to
find a way of asking a ComponentModel for the component proper it models -
but found none. So I am not sure how to fix this.

The solution is to update the Resolver interface to include something like:


Object resolve( boolean proxy );

So if you do something like:

Object object = m_model.resolve( false );

You will get back the pure non-proxied component.

Stephen.


--


|------------------------------------------------|
| Magic by Merlin                                |
| Production by Avalon                           |
|                                                |
| http://avalon.apache.org/merlin                |
| http://dpml.net/merlin/distributions/latest    |
|------------------------------------------------|

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to