org.springframework.batch.core.configuration.support
Class OsgiBundleXmlApplicationContextFactory

java.lang.Object
  extended by org.springframework.batch.core.configuration.support.OsgiBundleXmlApplicationContextFactory
All Implemented Interfaces:
ApplicationContextFactory, ApplicationContextAware, org.springframework.osgi.context.BundleContextAware

public class OsgiBundleXmlApplicationContextFactory
extends Object
implements org.springframework.osgi.context.BundleContextAware, ApplicationContextFactory, ApplicationContextAware

ApplicationContextFactory that can be used to load a context from an XML location in a bundle.

Author:
Dave Syer

Constructor Summary
OsgiBundleXmlApplicationContextFactory()
           
 
Method Summary
 ConfigurableApplicationContext createApplicationContext()
          Create an application context from the provided path, using the current OSGi BundleContext and the enclosing Spring ApplicationContext as a parent context.
 boolean equals(Object obj)
           
 int hashCode()
           
 void setApplicationContext(ApplicationContext applicationContext)
          Setter for the parent application context.
 void setBundleContext(org.osgi.framework.BundleContext context)
          Stash the BundleContext for creating a job application context later.
 void setDisplayName(String displayName)
           
 void setPath(String path)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OsgiBundleXmlApplicationContextFactory

public OsgiBundleXmlApplicationContextFactory()
Method Detail

setPath

public void setPath(String path)
Parameters:
path - the resource path to the xml to load for the child context.

setDisplayName

public void setDisplayName(String displayName)
Parameters:
displayName - the display name for the application context created.

setApplicationContext

public void setApplicationContext(ApplicationContext applicationContext)
                           throws BeansException
Setter for the parent application context.

Specified by:
setApplicationContext in interface ApplicationContextAware
Throws:
BeansException
See Also:
ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)

setBundleContext

public void setBundleContext(org.osgi.framework.BundleContext context)
Stash the BundleContext for creating a job application context later.

Specified by:
setBundleContext in interface org.springframework.osgi.context.BundleContextAware
See Also:
BundleContextAware.setBundleContext(org.osgi.framework.BundleContext)

createApplicationContext

public ConfigurableApplicationContext createApplicationContext()
Create an application context from the provided path, using the current OSGi BundleContext and the enclosing Spring ApplicationContext as a parent context.

Specified by:
createApplicationContext in interface ApplicationContextFactory
See Also:
ApplicationContextFactory.createApplicationContext()

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2013 SpringSource. All Rights Reserved.