org.ow2.jonas.jndi.interceptors.impl.datasource
Class DataSourceLeakDetectorContextInterceptor

java.lang.Object
  extended by org.ow2.jonas.jndi.interceptors.impl.AbsContextInterceptor
      extended by org.ow2.jonas.jndi.interceptors.impl.datasource.DataSourceLeakDetectorContextInterceptor
All Implemented Interfaces:
org.ow2.carol.jndi.intercept.ContextInterceptor

public class DataSourceLeakDetectorContextInterceptor
extends AbsContextInterceptor
implements org.ow2.carol.jndi.intercept.ContextInterceptor

Context interceptor for Datasources.

Author:
Florent Benoit

Constructor Summary
DataSourceLeakDetectorContextInterceptor()
           
 
Method Summary
 Object intercept(org.ow2.carol.jndi.intercept.InterceptionContext context)
          Intercept the lookup on the Datasources.
 boolean isForceClose()
           
 void setForceClose(boolean forceClose)
          Sets the flag for automatically closing or not the connection.
 
Methods inherited from class org.ow2.jonas.jndi.interceptors.impl.AbsContextInterceptor
filterOnJndiName, filterOnMethodName, getJndiRegexp, getResourceCheckerManager, setJndiRegexp, setResourceCheckerManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSourceLeakDetectorContextInterceptor

public DataSourceLeakDetectorContextInterceptor()
Method Detail

intercept

public Object intercept(org.ow2.carol.jndi.intercept.InterceptionContext context)
                 throws Exception
Intercept the lookup on the Datasources.

Specified by:
intercept in interface org.ow2.carol.jndi.intercept.ContextInterceptor
Parameters:
context - the interception context with data
Returns:
the wrapped datasource if intercepted, else it provides the original datasource
Throws:
Exception - if interception fails

isForceClose

public boolean isForceClose()
Returns:
true if the connection will be automatically closed if algorithm detects that the connection is still open.

setForceClose

public void setForceClose(boolean forceClose)
Sets the flag for automatically closing or not the connection.

Parameters:
forceClose - the given boolean value


Copyright © 2010 OW2 Consortium. All Rights Reserved.