001: /*
002: * BEGIN_HEADER - DO NOT EDIT
003: *
004: * The contents of this file are subject to the terms
005: * of the Common Development and Distribution License
006: * (the "License"). You may not use this file except
007: * in compliance with the License.
008: *
009: * You can obtain a copy of the license at
010: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
011: * See the License for the specific language governing
012: * permissions and limitations under the License.
013: *
014: * When distributing Covered Code, include this CDDL
015: * HEADER in each file and include the License file at
016: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
017: * If applicable add the following below this CDDL HEADER,
018: * with the fields enclosed by brackets "[]" replaced with
019: * your own identifying information: Portions Copyright
020: * [year] [name of copyright owner]
021: */
022:
023: /*
024: * @(#)UIMBeanFactoryReferenceImpl.java
025: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026: *
027: * END_HEADER - DO NOT EDIT
028: */
029: package com.sun.jbi.ui.runtime.mbeans;
030:
031: import javax.jbi.JBIException;
032: import javax.management.ObjectName;
033:
034: import com.sun.jbi.EnvironmentContext;
035: import com.sun.jbi.management.MBeanNames;
036:
037: /**
038: * This class is a factory implemenation that creates the UIMBean impl depending
039: * on the RI configuration.
040: *
041: * @author graj
042: *
043: */
044: public class UIMBeanFactoryReferenceImpl extends UIMBeanFactory {
045:
046: private static ObjectName sFrameworkConfigMBeanObjectName = null;
047:
048: /**
049: *
050: */
051: public UIMBeanFactoryReferenceImpl() {
052: }
053:
054: /**
055: * creates the UIMBean implemenation.
056: *
057: * @param aContext
058: * jbi context
059: * @throws javax.jbi.JBIException
060: * on error
061: * @return UIMBean implemenation
062: */
063: public JBIAdminCommandsUIMBean createJBIAdminCommandsUIMBean(
064: EnvironmentContext aContext) throws JBIException {
065: // return RI Impl
066: AbstractUIMBeanImpl.logDebug("Creating RI Impl of UIMBean");
067: return new JBIAdminCommandsUIMBeanImpl(aContext);
068: }
069:
070: /**
071: * creates the JBIStatisticsMBean.
072: * @param aContext EnvironmentContext
073: * @throws javax.jbi.JBIException on error
074: * @return UIMBean implemenation
075: */
076: public JBIStatisticsMBean createJBIStatisticsMBean(
077: EnvironmentContext aContext) throws JBIException {
078: return new JBIStatisticsMBeanImpl(aContext);
079: }
080:
081: /**
082: * gets the framework configuration mbean object name
083: *
084: * @param aContext
085: * framework context
086: * @return mbean object name
087: */
088: protected static ObjectName getFrameworkConfigMBeanObjectName(
089: EnvironmentContext aContext) {
090: if (UIMBeanFactoryReferenceImpl.sFrameworkConfigMBeanObjectName == null) {
091: MBeanNames mbeanNames = (com.sun.jbi.management.MBeanNames) aContext
092: .getMBeanNames();
093: UIMBeanFactoryReferenceImpl.sFrameworkConfigMBeanObjectName = mbeanNames
094: .getSystemServiceMBeanName(
095: MBeanNames.SERVICE_NAME_FRAMEWORK,
096: MBeanNames.CONTROL_TYPE_CONFIGURATION);
097: }
098: return UIMBeanFactoryReferenceImpl.sFrameworkConfigMBeanObjectName;
099: }
100:
101: /**
102: * @param args
103: */
104: public static void main(String[] args) {
105:
106: }
107:
108: }
|