Package org.gvsig.fmap.dal.resource.db
Class AbstractDBResourceBlocker
java.lang.Object
org.gvsig.fmap.dal.resource.spi.AbstractResource
org.gvsig.fmap.dal.resource.db.AbstractDBResourceBlocker
- All Implemented Interfaces:
org.gvsig.fmap.dal.resource.db.DBResource,org.gvsig.fmap.dal.resource.Resource,org.gvsig.fmap.dal.resource.spi.ResourceProvider,org.gvsig.tools.observer.Observable,org.gvsig.tools.observer.WeakReferencingObservable
public abstract class AbstractDBResourceBlocker
extends org.gvsig.fmap.dal.resource.spi.AbstractResource
implements org.gvsig.fmap.dal.resource.db.DBResource
Abstract Data Base Resource implementation that prevents the concurrent
access.
- Author:
- jmvivo
-
Field Summary
Fields inherited from class org.gvsig.fmap.dal.resource.spi.AbstractResource
lock, multiResourcelock -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor -
Method Summary
Modifier and TypeMethodDescriptionfinal voidconnect()Establish connection to data baseprotected abstract voidprotected booleanequals(Comparable v1, Comparable v2) get()Return a connection to the data base.
Connect to the Data Base if is neededReturn a connection to the data base.
Connect to the Data Base if is neededprotected abstract Objectfinal implementation method to get a connection to data base
Called fromconnect()
This method is called with the connection establishbooleanisThis(org.gvsig.fmap.dal.resource.ResourceParameters parameters) Check if parameters is the same for this resource.
Note: override this method to add checks for specify final implementation parametersMethods inherited from class org.gvsig.fmap.dal.resource.spi.AbstractResource
addConsumer, addObserver, addObservers, closeRequest, deleteObserver, deleteObservers, execute, executeBegins, executeEnds, getConsumerAt, getConsumersCount, getData, getLastTimeOpen, getLastTimeUsed, getName, getParameters, inUse, isOpen, notifyChanges, notifyClose, notifyDispose, notifyObserver, notifyOpen, openCount, performExecution, prepare, prepare, removeConsumer, setData, updateLastTimeOpen, updateLastTimeUsedMethods 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.db.DBResource
isConnectedMethods inherited from interface org.gvsig.fmap.dal.resource.Resource
addConsumer, closeRequest, execute, getConsumersCount, getData, getLastTimeOpen, getLastTimeUsed, getName, getParameters, inUse, isOpen, openCount, removeConsumer, setData
-
Constructor Details
-
AbstractDBResourceBlocker
protected AbstractDBResourceBlocker(AbstractDBResourceParameters parameters) throws org.gvsig.fmap.dal.exception.InitializeException Default constructor- Parameters:
parameters-- Throws:
org.gvsig.fmap.dal.exception.InitializeException
-
-
Method Details
-
get
Return a connection to the data base.
Connect to the Data Base if is needed- Specified by:
getin interfaceorg.gvsig.fmap.dal.resource.Resource- Specified by:
getin classorg.gvsig.fmap.dal.resource.spi.AbstractResource- Returns:
- connection to the data base
- Throws:
org.gvsig.fmap.dal.resource.exception.AccessResourceException
-
getConnection
Return a connection to the data base.
Connect to the Data Base if is needed- Returns:
- connection to the data base
- Throws:
org.gvsig.fmap.dal.resource.exception.AccessResourceException- See Also:
-
connect
public final void connect() throws org.gvsig.fmap.dal.exception.DataExceptionEstablish connection to data base- Throws:
org.gvsig.fmap.dal.exception.DataException
-
isThis
public boolean isThis(org.gvsig.fmap.dal.resource.ResourceParameters parameters) throws org.gvsig.fmap.dal.resource.exception.ResourceException Check if parameters is the same for this resource.
Note: override this method to add checks for specify final implementation parameters- Specified by:
isThisin interfaceorg.gvsig.fmap.dal.resource.spi.ResourceProvider- Throws:
org.gvsig.fmap.dal.resource.exception.ResourceException- See Also:
-
equals
-
connectToDB
protected abstract void connectToDB() throws org.gvsig.fmap.dal.exception.DataException- Throws:
org.gvsig.fmap.dal.exception.DataException
-
getTheConnection
final implementation method to get a connection to data base
Called fromconnect()
This method is called with the connection establish- Throws:
org.gvsig.fmap.dal.exception.DataException
-