org.milyn.db
Class AbstractDataSource

java.lang.Object
  extended by org.milyn.db.AbstractDataSource
All Implemented Interfaces:
ContentHandler, DOMVisitBefore, DOMVisitor, ExecutionLifecycleCleanable, Producer, SAXVisitBefore, SAXVisitor, VisitLifecycleCleanable, Visitor
Direct Known Subclasses:
DirectDataSource, JndiDataSource

public abstract class AbstractDataSource
extends Object
implements SAXVisitBefore, DOMVisitBefore, Producer, VisitLifecycleCleanable, ExecutionLifecycleCleanable

DataSource management resource.

Author:
tom.fennelly@gmail.com

Constructor Summary
AbstractDataSource()
           
 
Method Summary
 void executeExecutionLifecycleCleanup(ExecutionContext executionContext)
          Cleanup the resources allocated by this resource for the specified ExecutionContext.
 void executeVisitLifecycleCleanup(ExecutionContext executionContext)
          Cleanup the resources allocated by this resource for the specified ExecutionContext.
abstract  Connection getConnection()
           
static Connection getConnection(String dataSourceName, ExecutionContext executionContext)
           
abstract  String getName()
           
 Set<String> getProducts()
          Get the set of products produced by this producer instance.
abstract  boolean isAutoCommit()
           
protected  void unbind(ExecutionContext executionContext)
           
 void visitBefore(Element element, ExecutionContext executionContext)
          Visit the supplied element before visiting its child elements.
 void visitBefore(SAXElement element, ExecutionContext executionContext)
          Visit the supplied element before visiting its child elements.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDataSource

public AbstractDataSource()
Method Detail

visitBefore

public final void visitBefore(SAXElement element,
                              ExecutionContext executionContext)
                       throws SmooksException,
                              IOException
Description copied from interface: SAXVisitBefore
Visit the supplied element before visiting its child elements.

Specified by:
visitBefore in interface SAXVisitBefore
Parameters:
element - The SAX element being visited.
executionContext - Execution context.
Throws:
SmooksException - Event processing failure.
IOException - Error writing event to output writer.

visitBefore

public final void visitBefore(Element element,
                              ExecutionContext executionContext)
                       throws SmooksException
Description copied from interface: DOMVisitBefore
Visit the supplied element before visiting its child elements.

Specified by:
visitBefore in interface DOMVisitBefore
Parameters:
element - The DOM element being visited.
executionContext - Request relative instance.
Throws:
SmooksException - Element processing failure.

executeVisitLifecycleCleanup

public final void executeVisitLifecycleCleanup(ExecutionContext executionContext)
Description copied from interface: VisitLifecycleCleanable
Cleanup the resources allocated by this resource for the specified ExecutionContext.

Executes the cleanup at the end of the fragment visit.

Specified by:
executeVisitLifecycleCleanup in interface VisitLifecycleCleanable
Parameters:
executionContext - The ExecutionContext.

executeExecutionLifecycleCleanup

public final void executeExecutionLifecycleCleanup(ExecutionContext executionContext)
Description copied from interface: ExecutionLifecycleCleanable
Cleanup the resources allocated by this resource for the specified ExecutionContext.

Executes the cleanup at the end of the filter execution.

Specified by:
executeExecutionLifecycleCleanup in interface ExecutionLifecycleCleanable
Parameters:
executionContext - The ExecutionContext.

unbind

protected void unbind(ExecutionContext executionContext)

getConnection

public static Connection getConnection(String dataSourceName,
                                       ExecutionContext executionContext)
                                throws SmooksException
Throws:
SmooksException

getProducts

public Set<String> getProducts()
Description copied from interface: Producer
Get the set of products produced by this producer instance.

Specified by:
getProducts in interface Producer
Returns:
The set the set of products produced by this producer instance.

getName

public abstract String getName()

getConnection

public abstract Connection getConnection()
                                  throws SQLException
Throws:
SQLException

isAutoCommit

public abstract boolean isAutoCommit()


Copyright © 2009. All Rights Reserved.