1 19 20 package org.openharmonise.dav.server.apm; 21 22 import org.openharmonise.rm.config.*; 23 24 34 public class APMFactory { 35 36 37 private static final String PNAME_WEBDAV_APM = "WEBDAV_APM"; 38 private static AuxillaryProcessManager m_apm = null; 39 40 43 private APMFactory() { 44 super(); 45 } 46 47 53 static public AuxillaryProcessManager getAPM() throws APMException { 54 55 try { 56 if(m_apm == null) { 57 58 String sAuxillaryClass = 59 ConfigSettings 60 .getProperty( 61 PNAME_WEBDAV_APM); 62 63 if (sAuxillaryClass != null && sAuxillaryClass.length() > 0) { 64 Class classAuxillary = Class.forName(sAuxillaryClass); 65 m_apm = 66 (AuxillaryProcessManager) classAuxillary.newInstance(); 67 } 68 } 69 } catch (ConfigException e) { 70 throw new APMException(e); 71 } catch (ClassNotFoundException e) { 72 throw new APMException(e); 73 } catch (InstantiationException e) { 74 throw new APMException(e); 75 } catch (IllegalAccessException e) { 76 throw new APMException(e); 77 } 78 79 return m_apm; 80 } 81 82 } 83 | Popular Tags |