1 23 package com.sun.enterprise.admin.wsmgmt.lifecycle; 24 25 import com.sun.enterprise.admin.monitor.registry.MonitoringRegistrationException; 26 import com.sun.enterprise.admin.monitor.registry.MonitoringLevel; 27 import com.sun.enterprise.admin.wsmgmt.config.spi.WebServiceConfig; 28 import com.sun.enterprise.admin.monitor.registry.MonitoringLevel; 29 30 31 38 class MonitoringLifeCycleImpl { 39 40 41 public void initializeMonitoring(String appId, String modName, 42 String ctxRoot, boolean isStandAlone, boolean isEjbModule, String vs, 43 WebServiceConfig wsConfig) throws MonitoringRegistrationException { 44 45 if ( wsConfig == null ) { 46 return; 47 } 48 49 String monLevel = wsConfig.getMonitoringLevel(); 50 51 MonitoringLevel newLevel = MonitoringLevel.instance(monLevel); 52 if ( newLevel.equals(MonitoringLevel.OFF) ) { 53 return; 55 } 56 57 instrumentMonitoring(wsConfig.getEndpointName(), modName, ctxRoot, 58 isStandAlone, vs, appId, MonitoringLevel.OFF, 59 newLevel, isEjbModule); 60 } 61 62 public void uninitializeMonitoring(String appId, String modName, 63 String ctxRoot, boolean isStandAlone, boolean isEjbModule, String vs, 64 WebServiceConfig wsConfig) throws MonitoringRegistrationException { 65 66 if (wsConfig == null) { 67 return; 68 } 69 70 String monLevel = wsConfig.getMonitoringLevel(); 71 72 MonitoringLevel oldLevel = MonitoringLevel.instance(monLevel); 73 if ( oldLevel.equals(MonitoringLevel.OFF) ) { 74 return; 76 } 77 78 instrumentMonitoring(wsConfig.getEndpointName(),modName, ctxRoot, 79 isStandAlone, vs, appId, oldLevel, 80 MonitoringLevel.OFF, isEjbModule); 81 } 82 83 99 public void instrumentMonitoring(String name, String moduleName, 100 String ctxRoot, boolean isStandAlone, String vs, String j2eeAppName, 101 MonitoringLevel oldLevel, MonitoringLevel newLevel, 102 boolean isEjbModule) 103 throws MonitoringRegistrationException { 104 105 if ( name == null) { 106 return; 107 } 108 109 EndpointRegistration epr = new EndpointRegistration( name, moduleName, 110 ctxRoot, isStandAlone, vs, j2eeAppName, isEjbModule); 111 112 if ( oldLevel == newLevel ) { 114 return; 115 } 116 117 if ( oldLevel == OFF ) { 118 if ( newLevel == LOW ) { 119 epr.enableLOW(); 120 } 121 if ( newLevel == HIGH ) { 122 epr.enableLOW(); 123 } 125 } 126 127 if ( oldLevel == LOW ) { 128 if ( newLevel == HIGH) { 129 } 131 if ( newLevel == OFF ){ 132 epr.disableLOW(); 133 } 134 } 135 136 if ( oldLevel == HIGH ) { 137 if ( newLevel == LOW ){ 138 } 141 if ( newLevel == OFF ){ 142 epr.disableLOW(); 143 } 144 } 145 } 146 147 static MonitoringLifeCycleImpl flcm = null; 149 150 private static final MonitoringLevel OFF = MonitoringLevel.OFF; 151 private static final MonitoringLevel HIGH = MonitoringLevel.HIGH; 152 private static final MonitoringLevel LOW = MonitoringLevel.LOW; 153 154 } 155 | Popular Tags |