Package org.ametys.core.cocoon.source
Class ProxySourceFactory
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.core.cocoon.source.ProxySourceFactory
-
- All Implemented Interfaces:
Component
,Configurable
,LogEnabled
,Serviceable
,ThreadSafe
,SourceFactory
- Direct Known Subclasses:
KernelSourceFactory
public class ProxySourceFactory extends AbstractLogEnabled implements SourceFactory, ThreadSafe, Serviceable, Configurable
Factory for reading files in one protocol and switch to others if not found. Configuration should be like:<match>kernel://(.*)</match> <protocols> <protocol>resource://org/ametys/runtime/kernel/{1}</protocol> <protocol>context://kernel/{1}</protocol> </protocols>
-
-
Field Summary
Fields Modifier and Type Field Description private ServiceManager
_manager
protected Pattern
_matcher
URI matcherprotected List<String>
_protocols
Proxied sourcesprivate SourceResolver
_sourceResolver
-
Fields inherited from interface org.apache.excalibur.source.SourceFactory
ROLE
-
-
Constructor Summary
Constructors Constructor Description ProxySourceFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(Configuration configuration)
Source
getSource(String location, Map parameters)
void
release(Source source)
void
service(ServiceManager manager)
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_protocols
protected List<String> _protocols
Proxied sources
-
_sourceResolver
private SourceResolver _sourceResolver
-
_manager
private ServiceManager _manager
-
-
Constructor Detail
-
ProxySourceFactory
public ProxySourceFactory()
-
-
Method Detail
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getSource
public Source getSource(String location, Map parameters) throws IOException, MalformedURLException
- Specified by:
getSource
in interfaceSourceFactory
- Throws:
IOException
MalformedURLException
-
release
public void release(Source source)
- Specified by:
release
in interfaceSourceFactory
-
-