1 23 package com.sun.enterprise.server.pluggable; 24 25 import com.sun.enterprise.pluggable.PluggableFeatureFactoryBaseImpl; 26 27 import java.lang.reflect.InvocationHandler ; 28 import java.lang.reflect.Method ; 29 import java.lang.reflect.Proxy ; 30 import java.util.Properties ; 31 import java.util.logging.Level ; 32 import java.util.logging.Logger ; 33 34 import com.sun.logging.LogDomains; 35 36 44 public class PluggableFeatureFactoryImpl extends PluggableFeatureFactoryBaseImpl { 45 49 private static final String DEFAULT_FEATURES_PROPERTY_CLASS = 50 "com.sun.enterprise.server.pluggable.PEPluggableFeatureImpl"; 51 52 private static Logger _logger = LogDomains.getLogger(LogDomains.CORE_LOGGER); 53 54 59 public PluggableFeatureFactoryImpl(Logger logger) { 60 super(logger); 61 } 62 63 public static PluggableFeatureFactory getFactory() { 64 String featurePropClass = System.getProperty( 65 PluggableFeatureFactory.PLUGGABLE_FEATURES_PROPERTY_NAME, 66 DEFAULT_FEATURES_PROPERTY_CLASS); 67 _logger.log(Level.FINER, "featurePropClass: " + featurePropClass); 68 PluggableFeatureFactoryImpl featureFactoryImpl = 69 new PluggableFeatureFactoryImpl(_logger); 70 PluggableFeatureFactory featureFactory = (PluggableFeatureFactory) 71 featureFactoryImpl.getInstance(featurePropClass); 72 if (featureFactory == null) { 73 _logger.log(Level.WARNING, 74 "j2eerunner.pluggable_feature_noinit", featurePropClass); 75 } 76 return featureFactory; 77 } 78 79 protected String getDefaultFeatureFactoryPropertyName() { 80 return System.getProperty( 81 PluggableFeatureFactory.PLUGGABLE_FEATURES_PROPERTY_NAME); 82 } 83 84 protected Object createFeatureFactory(InvocationHandler handler) { 85 return Proxy.newProxyInstance( 86 PluggableFeatureFactory.class.getClassLoader(), 87 new Class [] { PluggableFeatureFactory.class }, 88 handler); 89 } 90 } 91 | Popular Tags |