-
1. Re: Can MainDeployerMBean call the deploy directly ?
dimitris Jun 28, 2006 9:55 AM (in response to vickyk)Where is this code taken from? Can you provide more context?
-
2. Re: Can MainDeployerMBean call the deploy directly ?
vickyk Jun 29, 2006 12:35 AM (in response to vickyk)Please check the doStart() of the ServerImpl , here it goes
http://fisheye.jboss.com/viewrep/JBoss/jboss-system/src/main/org/jboss/system/server/ServerImpl.java?r=1.69
Regards
Vicky -
3. Re: Can MainDeployerMBean call the deploy directly ?
starksm64 Jun 29, 2006 10:01 AM (in response to vickyk)I'm not following your question then. The MBeanProxyExt is simply used to obtain a typesafe proxy on the jmx bean whose management interface is MainDeployerMBean. The standard jmx equivalent is to use the javax.management.MBeanServerInvocationHandler:
ObjectName mainDeployer = ...; MBeanServer server = ...; MainDeployerMBean proxy = (MainDeployerMBean) MBeanServerInvocationHandler.newProxyInstance( server, mainDeployer, MainDeployerMBean.class, false);
-
4. Re: Can MainDeployerMBean call the deploy directly ?
vickyk Jun 30, 2006 4:38 AM (in response to vickyk)Scott,
Why can't we haveObject[] args = //URL String[] sig = //void server.invoke(mainDeloyer,"deploy",args,sig);
instead of thisMainDeployerMBean md = (MainDeployerMBean) MBeanProxyExt.create(MainDeployerMBean.class, mainDeployer, server); try { md.deploy(config.getServerConfigURL() + config.getRootDeploymentFilename()); } catch (IncompleteDeploymentException e) { log.error("Root deployment has missing dependencies; continuing", e); }
This is what I am trying to say , as the code becomes more understandable .
Regards
Vicky -
5. Re: Can MainDeployerMBean call the deploy directly ?
starksm64 Jun 30, 2006 11:19 AM (in response to vickyk)The reason for using the typed proxy is that we believe that code is more readable/understandable when the proxy is used. Otherwise you are using a reflective type call every time an invocation is done, as opposed to a typed proxy.
-
6. Re: Can MainDeployerMBean call the deploy directly ?
vickyk Jul 2, 2006 10:45 PM (in response to vickyk)Yes, got it now!!!!
I think my understanding about the usage of the MBeanProxyExt was wrong, I initilly though that this was used for optimization as I could see the invocation to getter/setter handled by simply invoking the corresponding attributes.
Yes now I realize that this make code more readable/understandable than simply keeping the reflective calls in the code.