- java.lang.Object
-
- org.eclipse.jetty.spring.SpringConfigurationProcessor
-
- All Implemented Interfaces:
org.eclipse.jetty.xml.ConfigurationProcessor
public class SpringConfigurationProcessor extends java.lang.Object implements org.eclipse.jetty.xml.ConfigurationProcessor
Spring ConfigurationProcessorA
ConfigurationProcessor
that uses a spring XML file to emulate theXmlConfiguration
format.XmlConfiguration
expects a primary object that is either passed in to a call toconfigure(Object)
or that is constructed by a call toconfigure()
. This processor looks for a bean definition with an id, name or alias of "Main" as uses that as the primary bean.The objects mapped by
XmlConfiguration.getIdMap()
are set as singletons before any configuration calls and if the spring configuration file contains a definition for the singleton id, the the singleton is updated with a call toAbstractAutowireCapableBeanFactory.configureBean(Object, String)
.The property map obtained via
XmlConfiguration.getProperties()
is set as a singleton called "properties" and values can be accessed by somewhat verbose usage ofMethodInvokingFactoryBean
.This processor is returned by the
SpringConfigurationProcessorFactory
for any XML document whos first element is "beans". The factory is discovered by aServiceLoader
forConfigurationProcessorFactory
.
-
-
Constructor Summary
Constructors Constructor Description SpringConfigurationProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
configure()
Return a configured bean.java.lang.Object
configure(java.lang.Object obj)
void
init(org.eclipse.jetty.util.resource.Resource jettyResource, org.eclipse.jetty.xml.XmlParser.Node config, org.eclipse.jetty.xml.XmlConfiguration configuration)
-
-
-
Method Detail
-
init
public void init(org.eclipse.jetty.util.resource.Resource jettyResource, org.eclipse.jetty.xml.XmlParser.Node config, org.eclipse.jetty.xml.XmlConfiguration configuration)
- Specified by:
init
in interfaceorg.eclipse.jetty.xml.ConfigurationProcessor
-
configure
public java.lang.Object configure(java.lang.Object obj) throws java.lang.Exception
- Specified by:
configure
in interfaceorg.eclipse.jetty.xml.ConfigurationProcessor
- Throws:
java.lang.Exception
-
configure
public java.lang.Object configure() throws java.lang.Exception
Return a configured bean. If a bean has the id or alias of "Main", then it is returned, otherwise the first bean in the file is returned.- Specified by:
configure
in interfaceorg.eclipse.jetty.xml.ConfigurationProcessor
- Throws:
java.lang.Exception
- See Also:
ConfigurationProcessor.configure()
-
-