|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgate.util.spring.GateAwareObject
gate.util.spring.DuplicateResourceFactoryBean
public class DuplicateResourceFactoryBean
Spring factory bean to create duplicate copies of a GATE resource. This bean would typically be declared with singleton scope, but the factory produces a new duplicate of its template resource each time getBean is called (or each time it is injected as a dependency).
| Constructor Summary | |
|---|---|
DuplicateResourceFactoryBean()
|
|
| Method Summary | |
|---|---|
void |
destroy()
Delete the duplicates we have returned, unless they have already been freed. |
Object |
getObject()
|
Class<?> |
getObjectType()
Returns a proxy class that implements the same set of GATE interfaces as the template resource. |
boolean |
isSingleton()
This factory is not a singleton - it produces a new object each time getObject() is called. |
void |
setCustomisers(List<ResourceCustomiser> customisers)
Optional customisers that will be applied to the duplicate resource before it is returned. |
void |
setReturnTemplate(boolean returnTemplate)
Should this factory bean return the template resource itself the first time getObject() is called, or should it always
return a duplicate, keeping the template in pristine condition. |
void |
setTemplate(Resource template)
Set the template resource that this factory bean will duplicate. |
| 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 |
|---|
public DuplicateResourceFactoryBean()
| Method Detail |
|---|
public void setTemplate(Resource template)
public void setReturnTemplate(boolean returnTemplate)
getObject() is called, or should it always
return a duplicate, keeping the template in pristine condition.
Generally, if the duplicates will all be created up-front, and
there are no configured customisers, then it is safe to set this
option to true. In cases where the duplicates may be created
asynchronously (possibly creating one duplicate while another one
is in use in a different thread) or may be customised after
creation it is safer to set this option to false (the default) to
keep the template pristine and always return duplicates.
public void setCustomisers(List<ResourceCustomiser> customisers)
false.
public Object getObject()
throws Exception
getObject in interface org.springframework.beans.factory.FactoryBeanExceptionpublic Class<?> getObjectType()
Factory.duplicate(Resource) for the list of interfaces that
will be considered.
getObjectType in interface org.springframework.beans.factory.FactoryBeanpublic boolean isSingleton()
getObject() is called.
isSingleton in interface org.springframework.beans.factory.FactoryBeanpublic void destroy()
destroy in interface org.springframework.beans.factory.DisposableBean
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||