org.jboss.varia.stats
Class DataSourceInterceptor

java.lang.Object
  extended by org.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended by org.jboss.system.ServiceMBeanSupport
          extended by org.jboss.varia.stats.DataSourceInterceptor
All Implemented Interfaces:
Wrapper, MBeanRegistration, NotificationBroadcaster, NotificationEmitter, CommonDataSource, DataSource, org.jboss.kernel.spi.dependency.KernelControllerContextAware, Service, ServiceMBean, DataSourceInterceptorMBean
Direct Known Subclasses:
DataSourceInterceptorJDK5, DataSourceInterceptorJDK6

public abstract class DataSourceInterceptor
extends ServiceMBeanSupport
implements DataSource, DataSourceInterceptorMBean

Version:
$Revision: 81038 $
Author:
Alexey Loubyansky

Field Summary
protected  DataSource target
          target DataSource
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.varia.stats.DataSourceInterceptorMBean
OBJECT_NAME
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
DataSourceInterceptor()
           
 
Method Summary
 String getBindName()
           
abstract  Connection getConnection()
           
abstract  Connection getConnection(String username, String password)
           
 int getLoginTimeout()
           
 PrintWriter getLogWriter()
           
 ObjectName getStatsCollector()
           
 String getTargetName()
           
protected  void logSql(String sql)
           
 void setBindName(String bindName)
           
 void setLoginTimeout(int seconds)
           
 void setLogWriter(PrintWriter out)
           
 void setStatsCollector(ObjectName statsCollector)
           
 void setTargetName(String targetName)
           
 void startService()
           
 void stopService()
           
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
create, createService, destroy, destroyService, getDeploymentInfo, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, pojoChange, pojoCreate, pojoDestroy, pojoStart, pojoStop, postDeregister, postRegister, preDeregister, preRegister, setKernelControllerContext, start, stop, unsetKernelControllerContext
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, nextNotificationSequenceNumber, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
 
Methods inherited from interface org.jboss.system.ServiceMBean
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 

Field Detail

target

protected DataSource target
target DataSource

Constructor Detail

DataSourceInterceptor

public DataSourceInterceptor()
Method Detail

getStatsCollector

public ObjectName getStatsCollector()
Specified by:
getStatsCollector in interface DataSourceInterceptorMBean

setStatsCollector

public void setStatsCollector(ObjectName statsCollector)
Specified by:
setStatsCollector in interface DataSourceInterceptorMBean

getBindName

public String getBindName()
Specified by:
getBindName in interface DataSourceInterceptorMBean

setBindName

public void setBindName(String bindName)
                 throws NamingException
Specified by:
setBindName in interface DataSourceInterceptorMBean
Throws:
NamingException

getTargetName

public String getTargetName()
Specified by:
getTargetName in interface DataSourceInterceptorMBean

setTargetName

public void setTargetName(String targetName)
                   throws NamingException
Specified by:
setTargetName in interface DataSourceInterceptorMBean
Throws:
NamingException

startService

public void startService()
                  throws Exception
Overrides:
startService in class ServiceMBeanSupport
Throws:
Exception

stopService

public void stopService()
                 throws Exception
Overrides:
stopService in class ServiceMBeanSupport
Throws:
Exception

getLoginTimeout

public int getLoginTimeout()
                    throws SQLException
Specified by:
getLoginTimeout in interface CommonDataSource
Throws:
SQLException

setLoginTimeout

public void setLoginTimeout(int seconds)
                     throws SQLException
Specified by:
setLoginTimeout in interface CommonDataSource
Throws:
SQLException

getLogWriter

public PrintWriter getLogWriter()
                         throws SQLException
Specified by:
getLogWriter in interface CommonDataSource
Throws:
SQLException

setLogWriter

public void setLogWriter(PrintWriter out)
                  throws SQLException
Specified by:
setLogWriter in interface CommonDataSource
Throws:
SQLException

getConnection

public abstract Connection getConnection()
                                  throws SQLException
Specified by:
getConnection in interface DataSource
Throws:
SQLException

getConnection

public abstract Connection getConnection(String username,
                                         String password)
                                  throws SQLException
Specified by:
getConnection in interface DataSource
Throws:
SQLException

logSql

protected void logSql(String sql)


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.