1 25 26 package org.objectweb.easybeans.naming.interceptors; 27 28 import org.objectweb.easybeans.log.JLog; 29 import org.objectweb.easybeans.log.JLogFactory; 30 31 36 public final class ENCManager { 37 38 41 private static JLog logger = JLogFactory.getLog(ENCManager.class); 42 43 46 private static Class encInterceptor = null; 47 48 51 private ENCManager() { 52 53 } 54 55 58 public static Class getInterceptorClass() { 59 if (encInterceptor == null) { 60 ClassLoader loader = Thread.currentThread().getContextClassLoader(); 61 62 try { 64 loader.loadClass(JOnASENCInterceptor.JONAS_NAMING_MANAGER_CLASS); 65 encInterceptor = JOnASENCInterceptor.class; 66 logger.info("Detecting JOnAS : using JOnAS ENC for the naming."); 67 } catch (ClassNotFoundException e) { 68 try { 70 loader.loadClass(TomcatENCInterceptor.TOMCAT_NAMING_CLASS); 71 encInterceptor = TomcatENCInterceptor.class; 72 logger.info("Detecting Tomcat : using Tomcat ENC for the naming."); 73 } catch (ClassNotFoundException e1) { 74 encInterceptor = EZBENCInterceptor.class; 76 logger.debug("Using EasyBeans ENC for the naming."); 77 } 78 } 79 80 } 81 return encInterceptor; 82 } 83 } 84 | Popular Tags |