|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hydrateframework.RequestContext
public class RequestContext
A request context keeps track of those resources that will be held within the scope of a single activity. What delimits an activity is dependent on application design, but may be the lifetime of an application, servicing a single request from a client, starting and completing a transaction, etc.
Constructor Summary | |
---|---|
RequestContext(ObjectContext ctx)
Create the request context. |
Method Summary | |
---|---|
void |
addConnection(java.lang.String service,
java.sql.Connection conn)
Make a connection available to the request context. |
protected void |
finalize()
Clean-up releases resources as a last resort. |
java.sql.Connection |
getConnection(java.lang.String service)
Get a connection from the request context by name. |
java.lang.String |
getDataSourceName(java.sql.Connection conn)
Returns the name of the service for which a connection was supplied |
NamedParameterStatement |
getStatement(ObjectContext ctx,
java.lang.Class cls,
java.lang.String dsName)
Retrieve a cached SQL statement for requesting or updating objects. |
void |
releaseConnections(ObjectContext ctx)
Release the connections acquired by this context back for reuse by other application code. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RequestContext(ObjectContext ctx)
ctx
- the given object context will subsequently treat this
request context as its current context.Method Detail |
---|
public void addConnection(java.lang.String service, java.sql.Connection conn)
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public void releaseConnections(ObjectContext ctx)
public java.lang.String getDataSourceName(java.sql.Connection conn)
conn
- the connection whose service is to be known
public java.sql.Connection getConnection(java.lang.String service)
ObjectFactory
class to get the
appropriate connection for reading and writing objects from a database.
service
- the name of the service e.g. jdbc/MYDB
public NamedParameterStatement getStatement(ObjectContext ctx, java.lang.Class cls, java.lang.String dsName) throws SaveException
ctx
- the object context which the statement will be associated with.cls
- the class of statement to createdsName
- the service name for the connection
SaveException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |