com.uwyn.rife.database
Class DbConnectionUser<ResultType,DataType>

java.lang.Object
  extended by com.uwyn.rife.database.DbConnectionUser<ResultType,DataType>
All Implemented Interfaces:
Cloneable

public abstract class DbConnectionUser<ResultType,DataType>
extends Object
implements Cloneable


Field Summary
protected  DataType mData
           
 
Constructor Summary
DbConnectionUser()
          Create a new DbConnectionUser.
DbConnectionUser(DataType data)
          Create a new DbConnectionUser with a data object.
 
Method Summary
 Object clone()
          Simply clones the instance with the default clone method since this class contains no member variables.
 DataType getData()
          Retrieve the data object that was provided to the constructor.
 void throwException(Exception exception)
          Calling this method makes it possible to throw a checked exception from within this class.
abstract  ResultType useConnection(DbConnection connection)
          Should be implemented by all extending classes.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mData

protected DataType mData
Constructor Detail

DbConnectionUser

public DbConnectionUser()
Create a new DbConnectionUser.

Since:
1.0

DbConnectionUser

public DbConnectionUser(DataType data)
Create a new DbConnectionUser with a data object.

Parameters:
data - a user data object to be stored locally
Since:
1.0
Method Detail

getData

public DataType getData()
Retrieve the data object that was provided to the constructor.

Returns:
the provided data object; or

null if no data object was provided

Since:
1.0

throwException

public void throwException(Exception exception)
                    throws InnerClassException
Calling this method makes it possible to throw a checked exception from within this class.

To catch it you should surround the reserveConnection with a try-catch block that catches InnerClassException. The original exception is then available through getCause() and can for example be rethrown.

Parameters:
exception - the exception to be thrown
Throws:
InnerClassException - when a checked exception needs to be thrown from within this class and caught outside the caller.
Since:
1.0

useConnection

public abstract ResultType useConnection(DbConnection connection)
                                  throws InnerClassException
Should be implemented by all extending classes.

Parameters:
connection - the connection that should be used
Throws:
InnerClassException
Since:
1.0

clone

public Object clone()
Simply clones the instance with the default clone method since this class contains no member variables.

Overrides:
clone in class Object
Since:
1.0


Copyright © 2001-2007 Uwyn sprl/bvba. All Rights Reserved.