de.folt.models.datamodel
Class DataSourceStorage

java.lang.Object
  extended by de.folt.models.datamodel.DataSourceStorage

public class DataSourceStorage
extends java.lang.Object

Class implements an association between a data source and its usage (how often createInstance is called)

Author:
klemens

Constructor Summary
DataSourceStorage(DataSource dataSource)
           
 
Method Summary
 int decrementCounter()
          decrementCounter decrement the counter associated with the data source
 int getCounter()
           
 DataSource getDataSource()
           
 int incrementCounter()
          incrementCounter increment the counter associated with the data source
 boolean isRemoveIfCounterZero()
           
 void setDataSource(DataSource dataSource)
           
 void setRemoveIfCounterZero(boolean removeIfCounterZero)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSourceStorage

public DataSourceStorage(DataSource dataSource)
Parameters:
dataSource - - the data source to add
Method Detail

decrementCounter

public int decrementCounter()
decrementCounter decrement the counter associated with the data source

Returns:
decremented counter value

getCounter

public int getCounter()
Returns:
the counter the counter value of the data source

getDataSource

public DataSource getDataSource()
Returns:
the dataSource get the data source

incrementCounter

public int incrementCounter()
incrementCounter increment the counter associated with the data source

Returns:
incremented counter value

isRemoveIfCounterZero

public boolean isRemoveIfCounterZero()
Returns:
the removeIfCounterZero this boolean indicates for the removeInstance if the data source should be removed (that it the data source method remove is called)

setDataSource

public void setDataSource(DataSource dataSource)
Parameters:
dataSource - the dataSource to set

setRemoveIfCounterZero

public void setRemoveIfCounterZero(boolean removeIfCounterZero)
Parameters:
removeIfCounterZero - the removeIfCounterZero to set (should the data source remove method be called when counter decrements to 0)