org.directwebremoting.spring
Class SpringCreator

java.lang.Object
  extended by org.directwebremoting.extend.AbstractCreator
      extended by org.directwebremoting.spring.SpringCreator
All Implemented Interfaces:
Creator

public class SpringCreator
extends AbstractCreator
implements Creator

A creator that relies on a spring bean factory.

Author:
Joe Walker [joe at getahead dot ltd dot uk]

Field Summary
 
Fields inherited from interface org.directwebremoting.extend.Creator
APPLICATION, PAGE, REQUEST, SCRIPT, SESSION
 
Constructor Summary
SpringCreator()
           
 
Method Summary
 java.lang.String getBeanName()
           
 java.lang.Object getInstance()
          Accessor for the/an instance of this Creator.
 java.lang.Class<?> getType()
          Accessor for the java.lang.Class that this Creator allows access to.
 void setBeanName(java.lang.String beanName)
           
 void setClass(java.lang.String classname)
          What sort of class do we create?
static void setOverrideBeanFactory(org.springframework.beans.factory.BeanFactory factory)
          Set a web-app wide BeanFactory.
 void setProperties(java.util.Map<java.lang.String,java.lang.String> params)
          DefaultConfiguration is done via access to the DOM Element.
static void setXmlBeanFactory(org.springframework.beans.factory.BeanFactory factory)
          Deprecated. This method is misnamed use setOverrideBeanFactory
 
Methods inherited from class org.directwebremoting.extend.AbstractCreator
getJavascript, getScope, isCacheable, isHidden, setCacheable, setHidden, setJavascript, setScope, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.directwebremoting.extend.Creator
getJavascript, getScope, isCacheable, isHidden
 

Constructor Detail

SpringCreator

public SpringCreator()
Method Detail

getBeanName

public java.lang.String getBeanName()
Returns:
Returns the beanName.

setBeanName

public void setBeanName(java.lang.String beanName)
Parameters:
beanName - The beanName to set.

setClass

public void setClass(java.lang.String classname)
What sort of class do we create?

Parameters:
classname - The name of the class

setProperties

public void setProperties(java.util.Map<java.lang.String,java.lang.String> params)
                   throws java.lang.IllegalArgumentException
Description copied from interface: Creator
DefaultConfiguration is done via access to the DOM Element. This is not at all ideal, but it will do for the moment.

Specified by:
setProperties in interface Creator
Overrides:
setProperties in class AbstractCreator
Parameters:
params - The map of parameters to configure the creator
Throws:
java.lang.IllegalArgumentException - If the config data in the Element is invalid

getType

public java.lang.Class<?> getType()
Description copied from interface: Creator
Accessor for the java.lang.Class that this Creator allows access to.

Specified by:
getType in interface Creator
Returns:
The type of this allowed class

getInstance

public java.lang.Object getInstance()
                             throws java.lang.InstantiationException
Description copied from interface: Creator
Accessor for the/an instance of this Creator.

Specified by:
getInstance in interface Creator
Returns:
the instance to use
Throws:
java.lang.InstantiationException - If for some reason the object can not be created

setXmlBeanFactory

@Deprecated
public static void setXmlBeanFactory(org.springframework.beans.factory.BeanFactory factory)
Deprecated. This method is misnamed use setOverrideBeanFactory

Set a web-app wide BeanFactory. This method is misnamed (The parameter is a BeanFactory and not a XmlBeanFactory)

Parameters:
factory - The factory to set.

setOverrideBeanFactory

public static void setOverrideBeanFactory(org.springframework.beans.factory.BeanFactory factory)
Set a web-app wide BeanFactory.

Parameters:
factory - The factory to set.

Copyright 2008