ro.isdc.wro.http.handler.factory
Class ConfigurableRequestHandlerFactory

java.lang.Object
  extended by ro.isdc.wro.model.resource.support.AbstractConfigurableStrategySupport<S,P>
      extended by ro.isdc.wro.model.resource.support.AbstractConfigurableMultipleStrategy<RequestHandler,RequestHandlerProvider>
          extended by ro.isdc.wro.http.handler.factory.ConfigurableRequestHandlerFactory
All Implemented Interfaces:
RequestHandlerFactory, ObjectFactory<Collection<RequestHandler>>

public class ConfigurableRequestHandlerFactory
extends AbstractConfigurableMultipleStrategy<RequestHandler,RequestHandlerProvider>
implements RequestHandlerFactory

A RequestHandler implementation which is easy to configure using a Properties object.

Since:
1.5.0
Author:
Alex Objelean

Field Summary
static String KEY
          Name of the property used to configure requestHandlers.
 
Constructor Summary
ConfigurableRequestHandlerFactory()
           
 
Method Summary
 Collection<RequestHandler> create()
          
protected  Class<RequestHandlerProvider> getProviderClass()
          
protected  Map<String,RequestHandler> getStrategies(RequestHandlerProvider provider)
          
protected  String getStrategyKey()
          
 
Methods inherited from class ro.isdc.wro.model.resource.support.AbstractConfigurableMultipleStrategy
createItemsAsString, getConfiguredStrategies
 
Methods inherited from class ro.isdc.wro.model.resource.support.AbstractConfigurableStrategySupport
copyAll, getAvailableAliases, getAvailableStrategies, getConfiguredValue, getProviderFinder, getStrategyForAlias, newProperties, overrideDefaultStrategyMap, setProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY

public static final String KEY
Name of the property used to configure requestHandlers.

See Also:
Constant Field Values
Constructor Detail

ConfigurableRequestHandlerFactory

public ConfigurableRequestHandlerFactory()
Method Detail

getStrategyKey

protected String getStrategyKey()

Specified by:
getStrategyKey in class AbstractConfigurableStrategySupport<RequestHandler,RequestHandlerProvider>
Returns:
the key of the strategy property.

getStrategies

protected Map<String,RequestHandler> getStrategies(RequestHandlerProvider provider)

Specified by:
getStrategies in class AbstractConfigurableStrategySupport<RequestHandler,RequestHandlerProvider>
Parameters:
provider - the instance responsible for strategy lookup.
Returns:
the map of provided strategies.

create

public Collection<RequestHandler> create()

Specified by:
create in interface ObjectFactory<Collection<RequestHandler>>

getProviderClass

protected Class<RequestHandlerProvider> getProviderClass()

Overrides:
getProviderClass in class AbstractConfigurableStrategySupport<RequestHandler,RequestHandlerProvider>
Returns:
the class of the provider of type P. Uses ParameterizedType to compute the class. Override it to support anonymous classes which do not play well with ParameterizedType's.


Copyright © 2008-2013. All Rights Reserved.