01: //========================================================================
02: //$Id: JBossWebAppContextMBean.java 1208 2006-11-13 21:38:44Z janb $
03: //Copyright 2006 Mort Bay Consulting Pty. Ltd.
04: //------------------------------------------------------------------------
05: //Licensed under the Apache License, Version 2.0 (the "License");
06: //you may not use this file except in compliance with the License.
07: //You may obtain a copy of the License at
08: //http://www.apache.org/licenses/LICENSE-2.0
09: //Unless required by applicable law or agreed to in writing, software
10: //distributed under the License is distributed on an "AS IS" BASIS,
11: //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: //See the License for the specific language governing permissions and
13: //limitations under the License.
14: //========================================================================
15:
16: package org.jboss.jetty.management;
17:
18: import javax.management.ObjectName;
19:
20: import org.jboss.jetty.JBossWebAppContext;
21: import org.mortbay.jetty.webapp.WebAppContext;
22: import org.mortbay.log.Log;
23: import org.mortbay.management.ObjectMBean;
24:
25: /**
26: * JBossWebApplicationContextMBean
27: *
28: * Provides special object name for itself so that
29: * we can integrate with jboss jsr77 management system.
30: */
31: public class JBossWebAppContextMBean extends ObjectMBean {
32: private JBossWebAppContext _webAppContext;
33:
34: public JBossWebAppContextMBean(Object managedObject) {
35: super (managedObject);
36: _webAppContext = (JBossWebAppContext) managedObject;
37: }
38:
39: public ObjectName getObjectName() {
40:
41: ObjectName oname = null;
42: try {
43: oname = new ObjectName(
44: getMBeanContainer().getDomain()
45: + ":J2EEServer=none,J2EEApplication=none,J2EEWebModule="
46: + _webAppContext.getUniqueName());
47: } catch (Exception e) {
48: Log.warn(e);
49: }
50: return oname;
51: }
52:
53: }
|