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

    Constructors
    Modifier
    Constructor
    Description
    protected
    Default constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
    Establish connection to data base
    protected abstract void
    final implementation method to Establish connection to data base
    Called from get()

    protected boolean
     
    get()
    Return a connection to the data base.
    Connect to the Data Base if is needed
    Return a connection to the data base.
    Connect to the Data Base if is needed
    protected abstract Object
    final implementation method to get a connection to data base
    Called from connect()

    This method is called with the connection establish
    abstract boolean
    inform if connection to the data base is established
    boolean
    isThis(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 parameters

    Methods inherited from class org.gvsig.fmap.dal.resource.spi.AbstractNonBlockingResource

    execute

    Methods 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public Object get() throws org.gvsig.fmap.dal.resource.exception.AccessResourceException
      Return a connection to the data base.
      Connect to the Data Base if is needed
      Specified by:
      get in interface org.gvsig.fmap.dal.resource.Resource
      Specified by:
      get in class org.gvsig.fmap.dal.resource.spi.AbstractResource
      Returns:
      connection to the data base
      Throws:
      org.gvsig.fmap.dal.resource.exception.AccessResourceException
    • getConnection

      public Object getConnection() throws org.gvsig.fmap.dal.resource.exception.AccessResourceException
      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.DataException
      Establish connection to data base
      Throws:
      org.gvsig.fmap.dal.exception.DataException
    • connectToDB

      protected abstract void connectToDB() throws org.gvsig.fmap.dal.exception.DataException
      final implementation method to Establish connection to data base
      Called from get()

      Throws:
      org.gvsig.fmap.dal.exception.DataException
    • getTheConnection

      protected abstract Object getTheConnection() throws org.gvsig.fmap.dal.exception.DataException
      final implementation method to get a connection to data base
      Called from connect()

      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:
      • invalid reference
        AbstractResource#isThis(ResourceParameters)
    • equals

      protected boolean equals(Comparable v1, Comparable v2)