From: Scott M S. <st...@us...> - 2002-08-10 17:45:28
|
User: starksm Date: 02/08/10 10:45:27 Modified: src/main/org/jboss/ejb Tag: Branch_3_2 Container.java Log: Build the jndiName component of the JMX name from the remote home jndi name if it exists, else use the local home jndi name. Revision Changes Path No revision No revision 1.96.2.1 +11 -6 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.96 retrieving revision 1.96.2.1 diff -u -r1.96 -r1.96.2.1 --- Container.java 2 Aug 2002 21:06:02 -0000 1.96 +++ Container.java 10 Aug 2002 17:45:27 -0000 1.96.2.1 @@ -89,7 +89,7 @@ * @author <a href="mailto:Sco...@jb...">Scott Stark</a>. * @author <a href="bi...@bu...">Bill Burke</a> * @author <a href="mailto:d_j...@us...">David Jencks</a> - * @version $Revision: 1.96 $ + * @version $Revision: 1.96.2.1 $ */ public abstract class Container extends ServiceMBeanSupport @@ -454,21 +454,26 @@ return codebase; } + /** Build a JMX name using the pattern jboss.j2ee:service=EJB,jndiName=[jndiName] + where the [jndiName] is either the bean remote home JNDI binding, or + the local home JNDI binding if the bean has no remote interfaces. + */ public ObjectName getJmxName() { - String jndiName = getBeanMetaData().getJndiName(); + BeanMetaData beanMetaData = getBeanMetaData(); + String jndiName = beanMetaData.getHome() != null ? + beanMetaData.getJndiName() : beanMetaData.getLocalJndiName(); if (jndiName == null) { - throw new IllegalStateException("cannot get Container object " + - "name unless jndi name is set!"); + throw new IllegalStateException("Container jndiName is null"); } - + if (jmxName == null) { jmxName = ObjectNameFactory.create(BASE_EJB_CONTAINER_NAME + ",jndiName=" + jndiName); } - + return jmxName; } |