|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.synapse.mediators.AbstractMediator
org.apache.synapse.mediators.db.AbstractDBMediator
public abstract class AbstractDBMediator
This abstract DB mediator will perform common DB connection pooling etc. for all DB mediators
| Field Summary | |
|---|---|
protected Map |
dataSourceProps
Hold JDBC properties |
| Fields inherited from class org.apache.synapse.mediators.AbstractMediator |
|---|
log, trace, traceState |
| Constructor Summary | |
|---|---|
AbstractDBMediator()
|
|
| Method Summary | |
|---|---|
void |
addDataSourceProperty(QName name,
String value)
|
void |
addDataSourceProperty(String name,
String value)
|
void |
addStatement(Statement stmnt)
|
void |
destroy()
Destroys the mediator. |
DataSource |
getDataSource()
|
Map |
getDataSourceProps()
|
protected String |
getDSName()
Return the name or (hopefully) unique connection URL specific to the DataSource being used This is used for logging purposes only |
protected PreparedStatement |
getPreparedStatement(Statement stmnt,
MessageContext msgCtx)
Return a Prepared statement for the given Statement object, which is ready to be executed |
List |
getStatementList()
|
void |
init(SynapseEnvironment se)
Initializes the mediator. |
boolean |
mediate(MessageContext synCtx)
Process each SQL statement against the current message |
protected abstract void |
processStatement(Statement query,
MessageContext msgCtx)
Subclasses must specify how each SQL statement is processed |
void |
setDataSource(DataSource dataSource)
|
| Methods inherited from class org.apache.synapse.mediators.AbstractMediator |
|---|
auditLog, auditWarn, getTraceState, getType, handleException, handleException, isTraceOn, isTraceOrDebugOn, setEffectiveTraceState, setTraceState, shouldTrace, traceOrDebug, traceOrDebugWarn |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Map dataSourceProps
| Constructor Detail |
|---|
public AbstractDBMediator()
| Method Detail |
|---|
public void init(SynapseEnvironment se)
init in interface ManagedLifecyclese - the Synapse environment referencepublic void destroy()
destroy in interface ManagedLifecyclepublic boolean mediate(MessageContext synCtx)
mediate in interface MediatorsynCtx - the current message
protected abstract void processStatement(Statement query,
MessageContext msgCtx)
query - the SQL statementmsgCtx - current messageprotected String getDSName()
public DataSource getDataSource()
public void setDataSource(DataSource dataSource)
public void addDataSourceProperty(QName name,
String value)
public void addDataSourceProperty(String name,
String value)
public Map getDataSourceProps()
public void addStatement(Statement stmnt)
public List getStatementList()
protected PreparedStatement getPreparedStatement(Statement stmnt,
MessageContext msgCtx)
throws SQLException
stmnt - msgCtx -
SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||