Home » synapse-1.2-src » org.apache.synapse.mediators.db » [javadoc | source]
abstract public class: AbstractDBMediator [javadoc | source]

All Implemented Interfaces:
    ManagedLifecycle, Mediator

Direct Known Subclasses:
    DBLookupMediator, DBReportMediator

This abstract DB mediator will perform common DB connection pooling etc. for all DB mediators
Field Summary
protected  Map dataSourceProps    Hold JDBC properties 
 List statementList    Statements 
Fields inherited from org.apache.synapse.mediators.AbstractMediator:
log,  trace,  traceState
Method from org.apache.synapse.mediators.db.AbstractDBMediator Summary:
addDataSourceProperty,   addDataSourceProperty,   addStatement,   destroy,   getDSName,   getDataSource,   getDataSourceProps,   getPreparedStatement,   getStatementList,   init,   mediate,   processStatement,   setDataSource
Methods from org.apache.synapse.mediators.AbstractMediator:
auditLog,   auditWarn,   getTraceState,   getType,   handleException,   handleException,   isTraceOn,   isTraceOrDebugOn,   setEffectiveTraceState,   setTraceState,   shouldTrace,   traceOrDebug,   traceOrDebugWarn
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.synapse.mediators.db.AbstractDBMediator Detail:
 public  void addDataSourceProperty(QName name,
    String value) 
 public  void addDataSourceProperty(String name,
    String value) 
 public  void addStatement(Statement stmnt) 
 public  void destroy() 
    Destroys the mediator. If we are using our custom DataSource, then shut down the connections
 protected String getDSName() 
    Return the name or (hopefully) unique connection URL specific to the DataSource being used This is used for logging purposes only
 public DataSource getDataSource() 
 public Map getDataSourceProps() 
 protected PreparedStatement getPreparedStatement(Statement stmnt,
    MessageContext msgCtx) throws SQLException 
    Return a Prepared statement for the given Statement object, which is ready to be executed
 public List getStatementList() 
 public  void init(SynapseEnvironment se) 
    Initializes the mediator. Does nothing right now. If DataSource lookup is supported, could do the IC lookup here
 public boolean mediate(MessageContext synCtx) 
    Process each SQL statement against the current message
 abstract protected  void processStatement(Statement query,
    MessageContext msgCtx)
    Subclasses must specify how each SQL statement is processed
 public  void setDataSource(DataSource dataSource)