net.sf.jasperreports.extensions
Class SpringExtensionsRegistryFactory

java.lang.Object
  extended by net.sf.jasperreports.extensions.SpringExtensionsRegistryFactory
All Implemented Interfaces:
ExtensionsRegistryFactory

public class SpringExtensionsRegistryFactory
extends java.lang.Object
implements ExtensionsRegistryFactory

A ExtensionsRegistryFactory which works by loading a Spring beans XML file and using beans of specific types as extensions.

The factory requires a property named net.sf.jasperreports.extension.<registry ID>.spring.beans.resource to be present in the properties map passed to createRegistry(String, JRPropertiesMap). The value of this property must resolve to a resource name which is loaded from the context classloader, and parsed as a Spring beans XML file.

Once the Spring beans XML file is loaded, this factory creates a SpringExtensionsRegistry instance which will use the bean factory.

Version:
$Id: SpringExtensionsRegistryFactory.java 4595 2011-09-08 15:55:10Z teodord $
Author:
Lucian Chirita (lucianc@users.sourceforge.net)

Field Summary
static java.lang.String PROPERTY_SUFFIX_SPRING_BEANS_RESOURCE
          The suffix of the property that gives the Spring beans XML resource name.
 
Constructor Summary
SpringExtensionsRegistryFactory()
           
 
Method Summary
 ExtensionsRegistry createRegistry(java.lang.String registryId, JRPropertiesMap properties)
          Instantiates an extensions registry.
protected  ListableBeanFactory getBeanFactory(java.lang.String registryId, JRPropertiesMap properties)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_SUFFIX_SPRING_BEANS_RESOURCE

public static final java.lang.String PROPERTY_SUFFIX_SPRING_BEANS_RESOURCE
The suffix of the property that gives the Spring beans XML resource name.

See Also:
Constant Field Values
Constructor Detail

SpringExtensionsRegistryFactory

public SpringExtensionsRegistryFactory()
Method Detail

createRegistry

public ExtensionsRegistry createRegistry(java.lang.String registryId,
                                         JRPropertiesMap properties)
Description copied from interface: ExtensionsRegistryFactory
Instantiates an extensions registry.

Specified by:
createRegistry in interface ExtensionsRegistryFactory
Parameters:
registryId - the ID of the registry to instantiate. The ID can be used to identify a set of properties to be used when instantiating the registry.
properties - the map of properties that can be used to configure the registry instantiation process
Returns:
an extensions registry
See Also:
DefaultExtensionsRegistry.PROPERTY_REGISTRY_PREFIX

getBeanFactory

protected ListableBeanFactory getBeanFactory(java.lang.String registryId,
                                             JRPropertiesMap properties)


© 2001-2010 Jaspersoft Corporation www.jaspersoft.com