1 23 package com.sun.enterprise.admin.monitor; 24 25 26 32 public class WSMonitorLifeCycleFactory { 33 34 38 private WSMonitorLifeCycleFactory () { 39 } 40 41 46 public static WSMonitorLifeCycleFactory getInstance() { 47 return lcf; 48 } 49 50 71 public WSMonitorLifeCycleProvider getWSMonitorLifeCycleProvider() 72 throws InstantiationException , IllegalAccessException , ClassCastException , 73 ClassNotFoundException { 74 String implName = System.getProperty(WSMGMT_PROVIDER_NAME); 75 if ( implName == null ) { 76 Class repClass = Class.forName(WSMGMT_DEFAULT_PROVIDER); 77 Object o = repClass.newInstance(); 78 return (WSMonitorLifeCycleProvider)o; 79 } else { 80 Class repClass = Class.forName(implName); 81 Object o = repClass.newInstance(); 82 return (WSMonitorLifeCycleProvider)o; 83 } 84 } 85 86 87 public static final String WSMGMT_PROVIDER_NAME = 88 "wsmgmt.lifecycle.provider.classname"; 89 90 public static final String WSMGMT_DEFAULT_PROVIDER = 91 "com.sun.enterprise.admin.wsmgmt.lifecycle.AppServWSMonitorLifeCycleProvider"; 92 93 static WSMonitorLifeCycleFactory lcf = new WSMonitorLifeCycleFactory(); 95 } 96 | Popular Tags |