gate.util.spring
Class SavedApplicationFactoryBean
java.lang.Object
gate.util.spring.GateAwareObject
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 ResourceCustomiser
s that will be applied to
the application after it is loaded.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SavedApplicationFactoryBean
public SavedApplicationFactoryBean()
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