User: mnf999
Date: 01/10/31 21:26:00
Modified: src/main/org/jboss/ejb Container.java
Log:
The container now registers under the application JMX domain. Also we hack the
visibility of the mbean server for now, this is likely to change in the near future.
Revision Changes Path
1.58 +17 -8 jboss/src/main/org/jboss/ejb/Container.java
Index: Container.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/Container.java,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -r1.57 -r1.58
--- Container.java 2001/09/11 18:34:59 1.57
+++ Container.java 2001/11/01 05:26:00 1.58
@@ -72,7 +72,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Scott Stark</a>.
* @author <a href="[EMAIL PROTECTED]">Bill Burke</a>
- * @version $Revision: 1.57 $
+ * @version $Revision: 1.58 $
*
* <p><b>Revisions:</b>
*
@@ -149,7 +149,9 @@
/** ??? */
protected Class localInterface;
- protected MBeanServer mbeanServer;
+ // We need the visibility on the MBeanServer for prototyping, it will be removed
in the future FIXME marcf
+ //protected MBeanServer mbeanServer;
+ public MBeanServer mbeanServer;
// Public --------------------------------------------------------
@@ -392,7 +394,12 @@
}
/**
- * A default implementation of starting the container service (no-op).
+ * A default implementation of starting the container service.
+ * The container registers it's dynamic MBean interface in the JMX base.
+ * FIXME marcf: give some more thought as to where to start and stop MBean
registration.
+ * stop could be a flag in the JMX server that essentially doesn't proxy
invocations but the
+ * MBean would still be registered in the MBeanServer under the right name until
undeploy
+
* The concrete container classes should override this method to introduce
* implementation specific start behaviour.
*
@@ -402,9 +409,8 @@
throws Exception
{
localContainerInvoker.start();
- String domain = mbeanServer.getDefaultDomain();
String jndiName = this.getBeanMetaData().getJndiName();
- ObjectName jmxName = new
ObjectName(domain+":service=Container,jndiName="+jndiName);
+ ObjectName jmxName = new ObjectName("J2EE:service=EJB,jndiName="+jndiName);
mbeanServer.registerMBean(this, jmxName);
}
@@ -418,9 +424,8 @@
localContainerInvoker.stop();
try
{
- String domain = mbeanServer.getDefaultDomain();
String jndiName = this.getBeanMetaData().getJndiName();
- ObjectName jmxName = new
ObjectName(domain+":service=Container,jndiName="+jndiName);
+ ObjectName jmxName = new ObjectName("J2EE:service=EJB,jndiName="+jndiName);
mbeanServer.unregisterMBean(jmxName);
}
catch(Exception e)
@@ -467,8 +472,10 @@
*/
public abstract Object invoke(MethodInvocation mi)
throws Exception;
+
+
+ // DynamicMBean interface implementation
----------------------------------------------
- // Begin DynamicMBean interface implementation
public Object getAttribute(String attribute)
throws AttributeNotFoundException,
MBeanException,
@@ -501,6 +508,8 @@
public Object invoke(String actionName, Object[] params, String[] signature)
throws MBeanException, ReflectionException
{
+
+
if( params != null && params.length == 1 && (params[0] instanceof
MethodInvocation) == false )
throw new MBeanException(new IllegalArgumentException("Expected zero or
single MethodInvocation argument"));
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development