gate.util.spring
Class GateAwareObject

java.lang.Object
  extended by gate.util.spring.GateAwareObject
All Implemented Interfaces:
org.springframework.beans.factory.BeanFactoryAware
Direct Known Subclasses:
DuplicateResourceFactoryBean, FeatureMapFactoryBean, GateResourceFactoryBean, SavedApplicationFactoryBean

public class GateAwareObject
extends Object
implements org.springframework.beans.factory.BeanFactoryAware

Convenience superclass for objects that may be created by Spring and need to ensure that GATE is initialised before they do their work. Subclasses can call ensureGateInit() to force the initialisation of any Init beans in the creating BeanFactory, thus ensuring that GATE will be properly initialised. The method does nothing if the bean factory has not been set (e.g. if the object is being used outside Spring). In this case, we assume that GATE initialisation has already been handled elsewhere.


Constructor Summary
GateAwareObject()
           
 
Method Summary
protected  void ensureGateInit()
          To be called by subclasses to ensure that any Init beans in the containing bean factory (and its ancestor factories, if any) have been initialised.
 void setBeanFactory(org.springframework.beans.factory.BeanFactory factory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GateAwareObject

public GateAwareObject()
Method Detail

ensureGateInit

protected void ensureGateInit()
To be called by subclasses to ensure that any Init beans in the containing bean factory (and its ancestor factories, if any) have been initialised.


setBeanFactory

public void setBeanFactory(org.springframework.beans.factory.BeanFactory factory)
Specified by:
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAware