org.nanocontainer.nanowar.webwork2
Class PicoObjectFactory

java.lang.Object
  extended bycom.opensymphony.xwork.ObjectFactory
      extended byorg.nanocontainer.nanowar.webwork2.PicoObjectFactory

public class PicoObjectFactory
extends com.opensymphony.xwork.ObjectFactory

XWork ObjectFactory which uses a PicoContainer to create component instances.

Author:
Cyrille Le Clerc, Jonas Engman, Mauro Talevi, Grégory Joseph

Constructor Summary
PicoObjectFactory(org.picocontainer.defaults.ObjectReference objectReference)
          Creates a PicoObjectFactory with given object reference, used to pass the http request to the factory
 
Method Summary
 Object buildBean(Class actionClass)
          Instantiates an action using the PicoContainer found in the request scope.
 Object buildBean(Class clazz, Map extraContext)
          Webwork-2.2 / XWork-1.1 method.
 Object buildBean(String className)
          As ObjectFactory#buildBean(java.lang.String)does not delegate to ObjectFactory#buildBean(java.lang.Class) but directly calls clazz.newInstance(), overwrite this method to call buildBean()
 Object buildBean(String className, Map extraContext)
          Webwork-2.2 / XWork-1.1 method.
 Class getClassInstance(String className)
          Webwork-2.2 / XWork-1.1 method.
 boolean isNoArgConstructorRequired()
           
 
Methods inherited from class com.opensymphony.xwork.ObjectFactory
buildAction, buildInterceptor, buildResult, buildValidator, getContinuationPackage, getObjectFactory, setContinuationPackage, setObjectFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PicoObjectFactory

public PicoObjectFactory(org.picocontainer.defaults.ObjectReference objectReference)
Creates a PicoObjectFactory with given object reference, used to pass the http request to the factory

Parameters:
objectReference - the ObjectReference
Method Detail

isNoArgConstructorRequired

public boolean isNoArgConstructorRequired()

buildBean

public Object buildBean(Class clazz,
                        Map extraContext)
                 throws Exception
Webwork-2.2 / XWork-1.1 method. ExtraContext can be ignored.

Throws:
Exception

buildBean

public Object buildBean(String className,
                        Map extraContext)
                 throws Exception
Webwork-2.2 / XWork-1.1 method. ExtraContext can be ignored.

Throws:
Exception

getClassInstance

public Class getClassInstance(String className)
                       throws ClassNotFoundException
Webwork-2.2 / XWork-1.1 method. Used to validate a class be loaded. Using actionsContainerFactory for consistency with build methods.

Throws:
ClassNotFoundException

buildBean

public Object buildBean(Class actionClass)
                 throws Exception
Instantiates an action using the PicoContainer found in the request scope.

Throws:
Exception
See Also:
com.opensymphony.xwork.ObjectFactory#buildBean(java.lang.Class)

buildBean

public Object buildBean(String className)
                 throws Exception
As ObjectFactory#buildBean(java.lang.String)does not delegate to ObjectFactory#buildBean(java.lang.Class) but directly calls clazz.newInstance(), overwrite this method to call buildBean()

Throws:
Exception
See Also:
com.opensymphony.xwork.ObjectFactory#buildBean(java.lang.String)


Copyright © 2003-2006 Codehaus. All Rights Reserved.