Package org.gvsig.fmap.dal.resource.spi
Class MultiResource
java.lang.Object
org.gvsig.fmap.dal.resource.spi.AbstractResource
org.gvsig.fmap.dal.resource.spi.MultiResource
- All Implemented Interfaces:
org.gvsig.fmap.dal.resource.Resource,org.gvsig.fmap.dal.resource.spi.ResourceProvider,org.gvsig.tools.observer.Observable,org.gvsig.tools.observer.WeakReferencingObservable
Resource implementation which is able to show an unique interface to a group
of Resources.
- Author:
- 2009- César Ordiñana - gvSIG team
-
Field Summary
FieldsFields inherited from class org.gvsig.fmap.dal.resource.spi.AbstractResource
lock, multiResourcelock -
Constructor Summary
ConstructorsConstructorDescriptionMultiResource(MultiResourceParameters parameters) Creates a newMultiResourcefrom the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMultiResourceConsumer(org.gvsig.fmap.dal.resource.spi.ResourceConsumer consumer) voidaddResource(String name, Object[] params, boolean defaultResource) Adds a newResourceProviderto the list of Resources managed by this group.voidaddResource(org.gvsig.fmap.dal.resource.ResourceParameters parameters, boolean defaultResource) Adds a newResourceProviderto the list of Resources managed by this group.voidexecute(org.gvsig.fmap.dal.resource.ResourceAction action) Locks the multiresource components to avoid another concurrent modificationvoidfrozen()Blocks the adding methods.get()Returns the real resource represented by this object.getData()getName()Returns the name of theResource.booleanisThis(org.gvsig.fmap.dal.resource.ResourceParameters parameters) voidvoidvoidvoidvoidprepare()voidtoString()Methods inherited from class org.gvsig.fmap.dal.resource.spi.AbstractResource
addConsumer, addObserver, addObservers, deleteObserver, deleteObservers, executeBegins, executeEnds, getConsumerAt, getConsumersCount, getLastTimeOpen, getLastTimeUsed, getParameters, inUse, isOpen, notifyObserver, openCount, performExecution, prepare, removeConsumer, updateLastTimeOpen, updateLastTimeUsed
-
Field Details
-
TYPE_NAME
- See Also:
-
DESCRIPTION
- See Also:
-
-
Constructor Details
-
MultiResource
public MultiResource(MultiResourceParameters parameters) throws org.gvsig.fmap.dal.exception.InitializeException Creates a newMultiResourcefrom the given parameters.- Parameters:
parameters- to create the resource from- Throws:
org.gvsig.fmap.dal.exception.InitializeException- if there is an error creating the resource
-
-
Method Details
-
addResource
public void addResource(org.gvsig.fmap.dal.resource.ResourceParameters parameters, boolean defaultResource) throws org.gvsig.fmap.dal.exception.InitializeException Adds a newResourceProviderto the list of Resources managed by this group.- Parameters:
parameters- to create the resource fromdefaultResource- if the added resource is to be used as the multi resource default one- Throws:
org.gvsig.fmap.dal.exception.InitializeException- if there is an error adding the resource
-
addResource
public void addResource(String name, Object[] params, boolean defaultResource) throws org.gvsig.fmap.dal.exception.InitializeException Adds a newResourceProviderto the list of Resources managed by this group.- Parameters:
name- of the resource to addparams- parameters to create the resource withdefaultResource- if the added resource is to be used as the multi resource default one- Throws:
org.gvsig.fmap.dal.exception.InitializeException- if there is an error adding the resource
-
isThis
public boolean isThis(org.gvsig.fmap.dal.resource.ResourceParameters parameters) throws org.gvsig.fmap.dal.resource.exception.ResourceException - Throws:
org.gvsig.fmap.dal.resource.exception.ResourceException
-
notifyChanges
public void notifyChanges() throws org.gvsig.fmap.dal.resource.exception.ResourceNotifyChangesException- Specified by:
notifyChangesin interfaceorg.gvsig.fmap.dal.resource.spi.ResourceProvider- Overrides:
notifyChangesin classAbstractResource- Throws:
org.gvsig.fmap.dal.resource.exception.ResourceNotifyChangesException
-
notifyClose
public void notifyClose() throws org.gvsig.fmap.dal.resource.exception.ResourceNotifyCloseException- Specified by:
notifyClosein interfaceorg.gvsig.fmap.dal.resource.spi.ResourceProvider- Overrides:
notifyClosein classAbstractResource- Throws:
org.gvsig.fmap.dal.resource.exception.ResourceNotifyCloseException
-
notifyDispose
public void notifyDispose() throws org.gvsig.fmap.dal.resource.exception.ResourceNotifyDisposeException- Specified by:
notifyDisposein interfaceorg.gvsig.fmap.dal.resource.spi.ResourceProvider- Overrides:
notifyDisposein classAbstractResource- Throws:
org.gvsig.fmap.dal.resource.exception.ResourceNotifyDisposeException
-
notifyOpen
public void notifyOpen() throws org.gvsig.fmap.dal.resource.exception.ResourceNotifyOpenException- Specified by:
notifyOpenin interfaceorg.gvsig.fmap.dal.resource.spi.ResourceProvider- Overrides:
notifyOpenin classAbstractResource- Throws:
org.gvsig.fmap.dal.resource.exception.ResourceNotifyOpenException
-
prepare
public void prepare() throws org.gvsig.fmap.dal.resource.exception.PrepareResourceException- Specified by:
preparein interfaceorg.gvsig.fmap.dal.resource.spi.ResourceProvider- Overrides:
preparein classAbstractResource- Throws:
org.gvsig.fmap.dal.resource.exception.PrepareResourceException
-
closeRequest
public void closeRequest() throws org.gvsig.fmap.dal.resource.exception.ResourceException- Specified by:
closeRequestin interfaceorg.gvsig.fmap.dal.resource.Resource- Overrides:
closeRequestin classAbstractResource- Throws:
org.gvsig.fmap.dal.resource.exception.ResourceException
-
get
Description copied from class:AbstractResourceReturns the real resource represented by this object.- Specified by:
getin interfaceorg.gvsig.fmap.dal.resource.Resource- Specified by:
getin classAbstractResource- Throws:
org.gvsig.fmap.dal.resource.exception.AccessResourceException- if there is an error while accessing the resource
-
getData
- Specified by:
getDatain interfaceorg.gvsig.fmap.dal.resource.Resource- Overrides:
getDatain classAbstractResource
-
getName
Description copied from class:AbstractResourceReturns the name of theResource.- Specified by:
getNamein interfaceorg.gvsig.fmap.dal.resource.Resource- Specified by:
getNamein classAbstractResource- Throws:
org.gvsig.fmap.dal.resource.exception.AccessResourceException- if there is an error while accessing the resource
-
toString
-
setData
- Specified by:
setDatain interfaceorg.gvsig.fmap.dal.resource.Resource- Overrides:
setDatain classAbstractResource
-
frozen
public void frozen()Blocks the adding methods. It is called when all their resources components are added. -
execute
public Object execute(org.gvsig.fmap.dal.resource.ResourceAction action) throws org.gvsig.fmap.dal.resource.exception.ResourceExecuteException Locks the multiresource components to avoid another concurrent modification- Specified by:
executein interfaceorg.gvsig.fmap.dal.resource.Resource- Overrides:
executein classAbstractResource- Throws:
org.gvsig.fmap.dal.resource.exception.ResourceExecuteException
-
addMultiResourceConsumer
public void addMultiResourceConsumer(org.gvsig.fmap.dal.resource.spi.ResourceConsumer consumer)
-