Package org.gvsig.fmap.dal.resource.db
Class AbstractDBResourceNoBlocker
java.lang.Object
org.gvsig.fmap.dal.resource.spi.AbstractResource
org.gvsig.fmap.dal.resource.spi.AbstractNonBlockingResource
org.gvsig.fmap.dal.resource.db.AbstractDBResourceNoBlocker
- 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
public abstract class AbstractDBResourceNoBlocker
extends org.gvsig.fmap.dal.resource.spi.AbstractNonBlockingResource
Abstract Data Base Resource implementation that allow the concurrent access.
Useful for Pooled Data Base 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 establishabstract booleaninform if connection to the data base is establishedbooleanisThis(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.AbstractNonBlockingResource
executeMethods inherited from class org.gvsig.fmap.dal.resource.spi.AbstractResource
addConsumer, addObserver, addObservers, closeRequest, deleteObserver, deleteObservers, executeBegins, executeEnds, getConsumerAt, getConsumersCount, getData, getLastTimeOpen, getLastTimeUsed, getName, getParameters, inUse, isOpen, notifyChanges, notifyClose, notifyDispose, notifyObserver, notifyOpen, openCount, performExecution, prepare, prepare, removeConsumer, setData, updateLastTimeOpen, updateLastTimeUsed
-
Constructor Details
-
AbstractDBResourceNoBlocker
protected AbstractDBResourceNoBlocker(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:
-
isConnected
public abstract boolean isConnected()inform if connection to the data base is established- Returns:
-
connect
public final void connect() throws org.gvsig.fmap.dal.exception.DataExceptionEstablish connection to data base- Throws:
org.gvsig.fmap.dal.exception.DataException
-
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
-
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- Throws:
org.gvsig.fmap.dal.resource.exception.ResourceException- See Also:
-
equals
-