1 23 package com.sun.enterprise.management.support; 24 25 import java.util.logging.Level ; 26 27 import javax.management.ObjectName ; 28 29 import com.sun.appserv.management.base.Util; 30 import com.sun.appserv.management.base.XTypes; 31 32 import com.sun.appserv.management.util.misc.ExceptionUtil; 33 import com.sun.appserv.management.util.jmx.JMXUtil; 34 35 36 import com.sun.enterprise.management.monitor.CallFlowMonitorImpl; 37 38 41 public final class NonDASLoader extends LoaderBase 42 implements NonDASLoaderMBean 43 { 44 public 45 NonDASLoader() 46 { 47 debug( "NonDASLoader" ); 48 } 49 50 53 protected void 54 startHook() 55 { 56 debug( "startHook" ); 57 } 58 59 62 protected Object 63 createDomainRoot() 64 { 65 debug( "createDomainRoot" ); 66 return null; 67 } 68 69 70 73 public boolean 74 isDAS() 75 { 76 return false; 77 } 78 79 private void 80 loadCallFlowMonitor() 81 { 82 try 83 { 84 final CallFlowMonitorImpl callFlow = new CallFlowMonitorImpl(); 85 86 final String serverName = BootUtil.getInstance().getServerName(); 87 String props = Util.makeRequiredProps( XTypes.CALL_FLOW_MONITOR, serverName ); 88 props = Util.concatenateProps( props, 89 Util.makeProp( XTypes.SERVER_ROOT_MONITOR, serverName ) ); 90 91 final ObjectName proposedName = Util.newObjectName( 92 BootUtil.getInstance().getAMXJMXDomainName(), props ); 93 94 final ObjectName objectName = 95 getMBeanServer().registerMBean( callFlow, proposedName ).getObjectName(); 96 debug( "Loaded CallFlowMonitor as " + JMXUtil.toString( objectName ) ); 97 98 } 99 catch( Exception e ) 100 { 101 final Throwable rootCause = ExceptionUtil.getRootCause(e); 102 final String msg = "Exception creating/loading CallFlowMonitor: " + 103 rootCause + ", msg=" + rootCause.getMessage(); 104 debug( msg ); 105 getMBeanLogger().log( Level.WARNING, msg, rootCause ); 106 } 107 } 108 109 private void 110 loadSpecialtyMBeans() 111 { 112 debug( "loadSpecialtyMBeans" ); 113 loadCallFlowMonitor(); 114 } 115 116 119 public void 120 adminServiceReady() 121 { 122 debug( "adminServiceReady" ); 123 loadSpecialtyMBeans(); 124 } 125 126 } 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | Popular Tags |