Well, I changed the MBeanServer to return an MBeanHandle to bypass the registry lookup for each invoke();
1M server invokes: 3900
1M handle invokes: 3730
1M proxy invokes: 15380
So with registries of a small size, the lookup isn't really an issue now is it.
Anyhow it's just a convenience/performance tradeoff and it'd be up to the developer to make that call...
Trev
> This is silly, as long as JMX doesn't provide
> security, standardized remote lookup/invocation,
> standardized transaction semantics and a persistence
> engine, the similarity with EJB/JMX is a system one.
> The API is the JMX one. Exposing the *system*
> invocation API is an aberation compared to exposing
> the business API.
Why is it silly? I didn't say anything like 'JMX is replacement of EJB'. What I said is that JMX is a component architecture. Sure, it misses some features of EJB (like the ones you enumerated), but on the other hand it doesn't restrict you as EJB does (threads, IO etc.). So if our design needs security, transactions, remote invocation we use EJBs, for the other things we use JMX. Where is the border between *business* and *system* API? JMX components can be used either as system or business ones.
> There are many ways to expose the JMX node to remote,
> we have 2 and another one standard invoker coming
> in.
>
There is definitely a lot of things to improve. Read the JSR 160.
> Look, I am a fan of JMX as a system API building our
> app server, exposing singletons to users makes sense
> in some very controlled cases (where you need the
> capacity to find and invoke singletons), and is an
> aberation in many other cases.
What are the cases when you cannot live without singletons?
> I am tired of the EJB
> this and that 0.02 criticism.
Me too. I don't understand why you took my comments as a EJB criticism. I'm big fan of both JMX and EJB ;-)
Jiri.
>
> > public class JMXHelper {
>
> purely local no distribution?
yep, just local
>
> > public static final String DOMAIN_NAME = "Foo";
> > private static MBeanServer mBeanServer = null;
> >
> > /** Invokes a method on a MBean. Signatures of
> > arguments are dynamically reflected.
> > * If any of the arguments is a subclass of
> expected
> > d type, use the invoke with explicit signatures
> > */
> > public static Object invoke(String objectName,
> > String actionName, Object[] params) throws
> Exception
> > {
> > String[] signatures = new String[params.length];
> > for (int i = 0; i < params.length; i++)
> > ) signatures = params.getClass().getName();
> > return invoke(objectName, actionName, params,
> > , signatures);
> > }
>
> so you wrote 2 lines to create the object name from
> the string and derive the parameters signature from
> the parameters...
>
> cute
You would be surprised how helpful 2 lines of code can be, sometimes.
For you, gurus, the helper class looks silly, but for the rest that doesn't know much about JMX...