org.apache.struts2.plexus
Class PlexusObjectFactory

java.lang.Object
  extended by com.opensymphony.xwork2.ObjectFactory
      extended by org.apache.struts2.plexus.PlexusObjectFactory
All Implemented Interfaces:
Serializable

public class PlexusObjectFactory
extends com.opensymphony.xwork2.ObjectFactory

Plexus integartion. You need three optional files: plexus-request.xml, plexus-session.xml, and plexus-application.xml.

The syntax of these files is:

 <plexus>
 <components>
  <component>
      <role>com.acme.MyBean</role>
      <implementation>com.acme.MyBean|com.acme.MyBeanImpl</implementation>
      <componentComposer>field|setter|?</componentComposer>
      <requirements>
          <requirement>
              <role>com.acme.MyOtherBean</role>
          </requirement>
      </requirements>
      <configuration>
          <foo>123</foo>
          <bar>hello, world</bar>
      </configuration>
      </component>
  </components>
 </plexus>
 

Author:
Emmanuel Venisse
See Also:
Serialized Form

Constructor Summary
PlexusObjectFactory()
           
 
Method Summary
 Object buildAction(String actionName, String namespace, com.opensymphony.xwork2.config.entities.ActionConfig config, Map extraContext)
           
 Object buildBean(Class clazz, Map extraContext)
           
 com.opensymphony.xwork2.interceptor.Interceptor buildInterceptor(com.opensymphony.xwork2.config.entities.InterceptorConfig interceptorConfig, Map interceptorRefParams)
           
 com.opensymphony.xwork2.Result buildResult(com.opensymphony.xwork2.config.entities.ResultConfig resultConfig, Map extraContext)
           
 com.opensymphony.xwork2.validator.Validator buildValidator(String className, Map params, Map extraContext)
           
 Class getClassInstance(String className)
           
 void setReflectionProvider(com.opensymphony.xwork2.util.reflection.ReflectionProvider reflectionProvider)
           
 void setServletConfig(javax.servlet.ServletContext servletContext)
           
 
Methods inherited from class com.opensymphony.xwork2.ObjectFactory
buildBean, buildBean, buildConverter, buildUnknownHandler, getObjectFactory, injectInternalBeans, isNoArgConstructorRequired, setActionFactory, setClassLoader, setContainer, setConverterFactory, setInterceptorFactory, setResultFactory, setUnknownHandlerFactory, setValidatorFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlexusObjectFactory

public PlexusObjectFactory()
Method Detail

setReflectionProvider

public void setReflectionProvider(com.opensymphony.xwork2.util.reflection.ReflectionProvider reflectionProvider)

setServletConfig

public void setServletConfig(javax.servlet.ServletContext servletContext)

buildAction

public Object buildAction(String actionName,
                          String namespace,
                          com.opensymphony.xwork2.config.entities.ActionConfig config,
                          Map extraContext)
                   throws Exception
Overrides:
buildAction in class com.opensymphony.xwork2.ObjectFactory
Throws:
Exception

buildInterceptor

public com.opensymphony.xwork2.interceptor.Interceptor buildInterceptor(com.opensymphony.xwork2.config.entities.InterceptorConfig interceptorConfig,
                                                                        Map interceptorRefParams)
                                                                 throws ConfigurationException
Overrides:
buildInterceptor in class com.opensymphony.xwork2.ObjectFactory
Throws:
ConfigurationException

buildResult

public com.opensymphony.xwork2.Result buildResult(com.opensymphony.xwork2.config.entities.ResultConfig resultConfig,
                                                  Map extraContext)
                                           throws Exception
Overrides:
buildResult in class com.opensymphony.xwork2.ObjectFactory
Throws:
Exception

buildValidator

public com.opensymphony.xwork2.validator.Validator buildValidator(String className,
                                                                  Map params,
                                                                  Map extraContext)
                                                           throws Exception
Overrides:
buildValidator in class com.opensymphony.xwork2.ObjectFactory
Throws:
Exception

buildBean

public Object buildBean(Class clazz,
                        Map extraContext)
                 throws Exception
Overrides:
buildBean in class com.opensymphony.xwork2.ObjectFactory
Throws:
Exception

getClassInstance

public Class getClassInstance(String className)
                       throws ClassNotFoundException
Overrides:
getClassInstance in class com.opensymphony.xwork2.ObjectFactory
Throws:
ClassNotFoundException


Copyright © 2000–2018 Apache Software Foundation. All rights reserved.