|Of course you can do but this is a similar questions like why does JBoss
|(<yeahh/>) use JMX to call methods on other MBeans through JMX
|and not by using JNDI.

you mean the lookup?
or do you mean the call?

The call is through JMX the MBeanServer? that is the way the MBeanServer is
built... why they didn't expose native objects (if that is what you mean) I
don't know, maybe callbacks and notification with the MBeanServer
indirection.

|First of all some people asked for that but I think that JMX has one big
|advantage over the EJB route is that you do not have to know which
|class or interface the service implements, you just have to find
|the service
|and then call its method (but of course there is no guarantee).

I differ, we only use standard MBeans and so we know the interface.

if/when we use Dynamic MBeans we can propose the invoke() interface natively
for these :)

|For the timer you can go either way (locally). But remotely you do not have
|to distribute classes which can be also a disadvantage (as we saw with
|Proxies).

we really want to have just the "management" of the j2ee services exposed in
a first round.

|To give you an example now we use the ServiceControl MBean to startup
|the JBoss components but later on you can easily replace this (let's say) a
|new version of the DependencyManager. When you use your approach then
|at least both have to implement the same Interface (which they do now but
|this doesn't have to be).

... they are independent issues in my mind. One is "finding" and carrying a
call invocation the other one is the model you expose ("your known vs
unknown, or new interface").  I believe we can deploy anything as an EJB,
all EJB buys us is it throws the remote infrastructure for free and the JNDI
hookup with a xml file defined name, essentially what the connector does
plus JNDI.

|Yes, JMX is slow and untyped but it is flexible, so what do you prefer?
|
|BTW, the EJB route or idea is that EJBs live on the network but should a
|JMX service really live on the network. In general I say that it is bound
|locally
|to its MBeanServer or should (as example) an EJB container become an
|object living on the wire?

Ok this is a real point, I believe a container should be defined at it's own
level (local) and that the MBeans should only be accessed by our management
EJB (or M-EJB), the federation can happen but at a later stage. It will
remain that we can administer farms of these outside a distributed
MBeanServer.

If you want to try it take all the stuff that exists in 8082 and offer an
EJB by MBean extension I believe we can know the service JMX name by a
property.

it makes the whole thing trivial, I mean the connector essentially is an RMI
layer that can proxy calls to the MBeanServer, well that is what an EJB
server is for, plus we can expose a ("java:/management/datasource/...") etc
etc do you see other problems with it, if not I might give it a try in a
couple of weeks

marc

|Have fun - Andy
|----- Original Message -----
|From: "marc fleury" <[EMAIL PROTECTED]>
|To: "jBoss" <[EMAIL PROTECTED]>
|Sent: Friday, December 08, 2000 8:04 PM
|Subject: RE: [jBoss-User] Timer Mbean - how to get at it
|
|
|> again
|>
|> can't we go the EJB route and offer admin in JNDI like any other bean ?
|>
|> ?
|>
|> marc
|>
|>
|> |-----Original Message-----
|> |From: [EMAIL PROTECTED]
|> |[mailto:[EMAIL PROTECTED]]On Behalf Of Andy "Mad"
|> |Schaefer
|> |Sent: Thursday, December 07, 2000 5:29 PM
|> |To: jBoss
|> |Subject: Re: [jBoss-User] Timer Mbean - how to get at it
|> |
|> |
|> |----- Original Message -----
|> |From: "Peter Antman" <[EMAIL PROTECTED]>
|> |To: <[EMAIL PROTECTED]>
|> |Sent: Wednesday, December 06, 2000 11:53 PM
|> |Subject: Re: [jBoss-User] Timer Mbean - how to get at it
|> |
|> |
|> |>
|> |> Thanks,
|> |>
|> |> On  6 Dec, Andy "Mad" Schaefer wrote:
|> |> > Hi
|> |> >
|> |> > Yes, I know that I already promissed to create a HowTo on the time
|> |> > issue but I didn't got the time.
|> |> > But for short there's the way (I assume that you are in the same JVM
|> |> > as jBoss is running):
|> |> > - Add a <MLET> tag to jBoss.conf loading
|"javax.management.timer.Timer"
|> |> > - Get a reference to the MBeanServer. If you are in a MBean then you
|> |> >    get it for free (during pre or post registration) otherwise you
|have
|> |it
|> |> >    to get it from JNDI or through MBeanFactory.getMBeanServer() ).
|> |>
|> |>
|> |> What is the JNDI name?
|> |Sorry, but the JMX Connector on the server-side is registered
|on the JNDI
|> |server to make him accessible over the network (like a person in the
|phone
|> |directory). Have a look at the org.jboss.jmx.server.RMIConnector (I
|think)
|> |to finds its JNDI name.
|> |
|> |> > - Get the ObjectInstance through the MBeanServer like:
|> |> >    Set lBeans = lBeanServer.queryMBeans(
|> |> >         new ObjectName( "DefaultDomain", "service", "timer" ),
|> |> >         null
|> |> >     );
|> |> >     if( !lBeans.isEmpty() ) {
|> |> >         ObjectInstance lTimerBean = (ObjectInstance)
|> |> > lBeans.iterator().next();
|> |> > - use addNotification() on the Timer to set what you are interested
|in:
|> |> >     lBeanServer.invoke( lTimerBean.getObjectName(),
|"addNotification",
|> |> >         new Object[] { <List of parameters see JavaDoc> },
|> |> >         new String[] { <List of parameters data type> }
|> |> >     );
|> |> > - add yourself as a Notification Listener:
|> |> >     lBeanServer.addNotificationListener(
|> |> >         lTimerBean.getObjectName(), <your listener instance>
|> |> >     );
|> |> >
|> |>
|> |>
|> |> Here is an alternative (at least it seems to work for mee):
|> |>
|> |>
|> |>
|> |> 1. Ad listeners:
|> |>
|> |>
|> |> MBeanServer server = (MBeanServer) MBeanServerFactory.
|> |>
|> |findMBeanServer(null).iterator().next();
|> |>
|> |>
|> |> server.addNotificationListener(new ObjectName("Timer:service=Timer"),
|> |>        listener,
|> |>        filter,
|> |>        o);
|> |>
|> |> 2. Add stuff to time:
|> |>
|> |> timer =
|> |(TimerMBean)MBeanProxy.create(TimerMBean.class,"Timer:service=Timer");
|> |> timer.addNotification("test", "testing",
|> |>   null, new java.util.Date(new java.util.Date().
|> |>                                      getTime() +Timer.ONE_MINUTE  )
|> |>                                         );
|> |>
|> |>
|> |> With MLET set to:
|> |> <MLET CODE = "javax.management.timer.Timer" ARCHIVE="jmxri.jar"
|> |NAME="Timer:serv
|> |> ice=Timer" CODEBASE="../../lib/">
|> |> </MLET>
|> |>
|> |> //Peter
|> |I think that will work as well. Andy
|> |
|> |
|> |
|> |
|> |--
|> |--------------------------------------------------------------
|> |To subscribe:        [EMAIL PROTECTED]
|> |To unsubscribe:      [EMAIL PROTECTED]
|> |Problems?:           [EMAIL PROTECTED]
|> |
|> |
|>
|>
|>
|> --
|> --------------------------------------------------------------
|> To subscribe:        [EMAIL PROTECTED]
|> To unsubscribe:      [EMAIL PROTECTED]
|> Problems?:           [EMAIL PROTECTED]
|>
|
|
|
|--
|--------------------------------------------------------------
|To subscribe:        [EMAIL PROTECTED]
|To unsubscribe:      [EMAIL PROTECTED]
|Problems?:           [EMAIL PROTECTED]
|
|



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to