Package org.gvsig.fmap.dal.resource.spi
Class AbstractResource
java.lang.Object
org.gvsig.fmap.dal.resource.spi.AbstractResource
- 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
- Direct Known Subclasses:
AbstractNonBlockingResource,MultiResource
public abstract class AbstractResource
extends Object
implements org.gvsig.fmap.dal.resource.spi.ResourceProvider, org.gvsig.tools.observer.WeakReferencingObservable
Base implementation for Resource
This implementation not define the
and
invalid reference
Resource#begin()
invalid reference
Resource#end()
- Author:
- jmvivo
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractResource(org.gvsig.fmap.dal.resource.ResourceParameters parameters) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddConsumer(org.gvsig.fmap.dal.resource.spi.ResourceConsumer consumer) voidaddObserver(org.gvsig.tools.observer.Observer o) final voidaddObservers(org.gvsig.tools.observer.impl.BaseWeakReferencingObservable observers) voidvoiddeleteObserver(org.gvsig.tools.observer.Observer o) voidexecute(org.gvsig.fmap.dal.resource.ResourceAction action) protected final voidprotected final voidabstract Objectget()Returns the real resource represented by this object.org.gvsig.fmap.dal.resource.spi.ResourceConsumergetConsumerAt(int i) intgetData()final longfinal longabstract StringgetName()Returns the name of theResource.org.gvsig.fmap.dal.resource.ResourceParametersfinal booleaninUse()booleanisOpen()voidvoidvoidprotected voidnotifyObserver(String type) voidintprotected ObjectperformExecution(org.gvsig.fmap.dal.resource.ResourceAction action) voidprepare()voidprepare(org.gvsig.fmap.dal.resource.ResourceParameters params) final voidremoveConsumer(org.gvsig.fmap.dal.resource.spi.ResourceConsumer consumer) voidprotected final voidprotected final voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gvsig.fmap.dal.resource.spi.ResourceProvider
isThis
-
Field Details
-
lock
-
multiResourcelock
-
-
Constructor Details
-
AbstractResource
protected AbstractResource(org.gvsig.fmap.dal.resource.ResourceParameters parameters) throws org.gvsig.fmap.dal.exception.InitializeException - Throws:
org.gvsig.fmap.dal.exception.InitializeException
-
-
Method Details
-
updateLastTimeUsed
protected final void updateLastTimeUsed() -
updateLastTimeOpen
protected final void updateLastTimeOpen() -
getLastTimeOpen
public final long getLastTimeOpen()- Specified by:
getLastTimeOpenin interfaceorg.gvsig.fmap.dal.resource.Resource
-
getLastTimeUsed
public final long getLastTimeUsed()- Specified by:
getLastTimeUsedin interfaceorg.gvsig.fmap.dal.resource.Resource
-
getParameters
public org.gvsig.fmap.dal.resource.ResourceParameters getParameters()- Specified by:
getParametersin interfaceorg.gvsig.fmap.dal.resource.Resource
-
prepare
public void prepare(org.gvsig.fmap.dal.resource.ResourceParameters params) throws org.gvsig.fmap.dal.resource.exception.PrepareResourceException - Throws:
org.gvsig.fmap.dal.resource.exception.PrepareResourceException
-
prepare
public void prepare() throws org.gvsig.fmap.dal.resource.exception.PrepareResourceException- Specified by:
preparein interfaceorg.gvsig.fmap.dal.resource.spi.ResourceProvider- Throws:
org.gvsig.fmap.dal.resource.exception.PrepareResourceException
-
notifyOpen
public void notifyOpen() throws org.gvsig.fmap.dal.resource.exception.ResourceNotifyOpenException- Specified by:
notifyOpenin interfaceorg.gvsig.fmap.dal.resource.spi.ResourceProvider- Throws:
org.gvsig.fmap.dal.resource.exception.ResourceNotifyOpenException
-
notifyClose
public void notifyClose() throws org.gvsig.fmap.dal.resource.exception.ResourceNotifyCloseException- Specified by:
notifyClosein interfaceorg.gvsig.fmap.dal.resource.spi.ResourceProvider- Throws:
org.gvsig.fmap.dal.resource.exception.ResourceNotifyCloseException
-
notifyChanges
public void notifyChanges() throws org.gvsig.fmap.dal.resource.exception.ResourceNotifyChangesException- Specified by:
notifyChangesin interfaceorg.gvsig.fmap.dal.resource.spi.ResourceProvider- Throws:
org.gvsig.fmap.dal.resource.exception.ResourceNotifyChangesException
-
isOpen
public boolean isOpen()- Specified by:
isOpenin interfaceorg.gvsig.fmap.dal.resource.Resource
-
openCount
public int openCount()- Specified by:
openCountin interfaceorg.gvsig.fmap.dal.resource.Resource
-
addObserver
public void addObserver(org.gvsig.tools.observer.Observer o) - Specified by:
addObserverin interfaceorg.gvsig.tools.observer.Observable
-
deleteObserver
public void deleteObserver(org.gvsig.tools.observer.Observer o) - Specified by:
deleteObserverin interfaceorg.gvsig.tools.observer.Observable
-
deleteObservers
public void deleteObservers()- Specified by:
deleteObserversin interfaceorg.gvsig.tools.observer.Observable
-
addObservers
public final void addObservers(org.gvsig.tools.observer.impl.BaseWeakReferencingObservable observers) -
addConsumer
public final void addConsumer(org.gvsig.fmap.dal.resource.spi.ResourceConsumer consumer) - Specified by:
addConsumerin interfaceorg.gvsig.fmap.dal.resource.Resource
-
removeConsumer
public final void removeConsumer(org.gvsig.fmap.dal.resource.spi.ResourceConsumer consumer) - Specified by:
removeConsumerin interfaceorg.gvsig.fmap.dal.resource.Resource
-
getConsumersCount
public int getConsumersCount()- Specified by:
getConsumersCountin interfaceorg.gvsig.fmap.dal.resource.Resource
-
getConsumerAt
public org.gvsig.fmap.dal.resource.spi.ResourceConsumer getConsumerAt(int i) -
closeRequest
public void closeRequest() throws org.gvsig.fmap.dal.resource.exception.ResourceException- Specified by:
closeRequestin interfaceorg.gvsig.fmap.dal.resource.Resource- Throws:
org.gvsig.fmap.dal.resource.exception.ResourceException
-
setData
- Specified by:
setDatain interfaceorg.gvsig.fmap.dal.resource.Resource
-
getData
- Specified by:
getDatain interfaceorg.gvsig.fmap.dal.resource.Resource
-
notifyObserver
-
notifyDispose
public void notifyDispose() throws org.gvsig.fmap.dal.resource.exception.ResourceNotifyDisposeException- Specified by:
notifyDisposein interfaceorg.gvsig.fmap.dal.resource.spi.ResourceProvider- Throws:
org.gvsig.fmap.dal.resource.exception.ResourceNotifyDisposeException
-
inUse
public final boolean inUse()- Specified by:
inUsein interfaceorg.gvsig.fmap.dal.resource.Resource
-
execute
public Object execute(org.gvsig.fmap.dal.resource.ResourceAction action) throws org.gvsig.fmap.dal.resource.exception.ResourceExecuteException - Specified by:
executein interfaceorg.gvsig.fmap.dal.resource.Resource- Throws:
org.gvsig.fmap.dal.resource.exception.ResourceExecuteException
-
performExecution
protected Object performExecution(org.gvsig.fmap.dal.resource.ResourceAction action) throws Exception - Throws:
Exception
-
executeBegins
protected final void executeBegins() -
executeEnds
protected final void executeEnds() -
getName
public abstract String getName() throws org.gvsig.fmap.dal.resource.exception.AccessResourceExceptionReturns the name of theResource.- Specified by:
getNamein interfaceorg.gvsig.fmap.dal.resource.Resource- Throws:
org.gvsig.fmap.dal.resource.exception.AccessResourceException- if there is an error while accessing the resource
-
get
Returns the real resource represented by this object.- Specified by:
getin interfaceorg.gvsig.fmap.dal.resource.Resource- Throws:
org.gvsig.fmap.dal.resource.exception.AccessResourceException- if there is an error while accessing the resource
-