FileDocCategorySizeDatePackage
PluggableFeatureFactoryImpl.javaAPI DocGlassfish v2 API4677Fri May 04 22:35:50 BST 2007com.sun.enterprise.server.pluggable

PluggableFeatureFactoryImpl

public class PluggableFeatureFactoryImpl extends com.sun.enterprise.pluggable.PluggableFeatureFactoryBaseImpl
An implementation of PluggableFeatureFactory interface using dynamic proxies. This class does not directly implement the interface PluggableFeatureFactory, but an proxy instance implementing the interface can be obtained by a call to the static method getInstance(). In reality, this class implements InvocationHnalder interface used to handle method invocations on a dynamic proxy object.

Fields Summary
private static final String
DEFAULT_FEATURES_PROPERTY_CLASS
Name of the property class containing feature name and feature implementation class names.
private static Logger
_logger
Constructors Summary
public PluggableFeatureFactoryImpl(Logger logger)
Private constructor. The public instances of this object are not available. The instance of this class is however used as invocation handler for dynamic proxy returned by static method getInstance().


                                       
       
        super(logger);
    
Methods Summary
protected java.lang.ObjectcreateFeatureFactory(java.lang.reflect.InvocationHandler handler)

        return Proxy.newProxyInstance(
                PluggableFeatureFactory.class.getClassLoader(),
                new Class[] { PluggableFeatureFactory.class },
                handler);
    
protected java.lang.StringgetDefaultFeatureFactoryPropertyName()

        return System.getProperty(
            PluggableFeatureFactory.PLUGGABLE_FEATURES_PROPERTY_NAME);
    
public static PluggableFeatureFactorygetFactory()

        String featurePropClass = System.getProperty(
                PluggableFeatureFactory.PLUGGABLE_FEATURES_PROPERTY_NAME,
                DEFAULT_FEATURES_PROPERTY_CLASS);
        _logger.log(Level.FINER, "featurePropClass: " + featurePropClass);
        PluggableFeatureFactoryImpl featureFactoryImpl = 
            new PluggableFeatureFactoryImpl(_logger);
        PluggableFeatureFactory featureFactory = (PluggableFeatureFactory)
            featureFactoryImpl.getInstance(featurePropClass);
        if (featureFactory == null) {	    
            _logger.log(Level.WARNING,
                    "j2eerunner.pluggable_feature_noinit", featurePropClass);
        }
        return featureFactory;