gate.util.spring
Class SavedApplicationFactoryBean

java.lang.Object
  extended by gate.util.spring.GateAwareObject
      extended by gate.util.spring.SavedApplicationFactoryBean
All Implemented Interfaces:
org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean

public class SavedApplicationFactoryBean
extends GateAwareObject
implements org.springframework.beans.factory.FactoryBean, org.springframework.beans.factory.DisposableBean

Spring factory bean to load a saved GATE application from a Spring resource location. Typically used via the gate: extension namespace:

 <gate:saved-application location="WEB-INF/application.gapp" />
 
See Init for details of how to declare this namespace in your bean definition files. We first attempt to resolve the location as a File, if this fails we fall back to resolving it as a URL. This is useful with servlet context resources (with an expanded web application) as it will give a file: URL rather than an opaque scheme like jndi: (Tomcat). The element also supports a nested <gate:customisers> element, giving a list of ResourceCustomisers that will be applied to the application after it is loaded.


Constructor Summary
SavedApplicationFactoryBean()
           
 
Method Summary
 void destroy()
          Destroy the resource created by this bean, by passing it to Factory.deleteResource(gate.Resource).
 Object getObject()
          Loads the saved application file and applies any registered customisers.
 Class getObjectType()
           
 boolean isSingleton()
           
 void setCustomisers(List<ResourceCustomiser> customisers)
           
 void setLocation(org.springframework.core.io.Resource location)
           
 
Methods inherited from class gate.util.spring.GateAwareObject
ensureGateInit, setBeanFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SavedApplicationFactoryBean

public SavedApplicationFactoryBean()
Method Detail

setLocation

public void setLocation(org.springframework.core.io.Resource location)

setCustomisers

public void setCustomisers(List<ResourceCustomiser> customisers)

getObject

public Object getObject()
                 throws GateException,
                        IOException
Loads the saved application file and applies any registered customisers.

Specified by:
getObject in interface org.springframework.beans.factory.FactoryBean
Returns:
the (possibly customised) application
Throws:
GateException
IOException

getObjectType

public Class getObjectType()
Specified by:
getObjectType in interface org.springframework.beans.factory.FactoryBean

isSingleton

public boolean isSingleton()
Specified by:
isSingleton in interface org.springframework.beans.factory.FactoryBean

destroy

public void destroy()
             throws Exception
Destroy the resource created by this bean, by passing it to Factory.deleteResource(gate.Resource). This will in turn delete any PRs that the application contains.

Specified by:
destroy in interface org.springframework.beans.factory.DisposableBean
Throws:
Exception