* Since newProxyInstance performs the same operation, over and over
* again, it is much more optimized if we simply store the constructor ourselves.
*/
- private Constructor proxyClassConstructor;
+ private Constructor<?> proxyClassConstructor;
/**
* Executor service used to cancel Futures
* @return constructor used to instantiate the wrapper object
* @throws NoSuchMethodException
*/
- public Constructor getProxyConstructor() throws NoSuchMethodException {
+ public Constructor<?> getProxyConstructor() throws NoSuchMethodException {
//cache the constructor
if (proxyClassConstructor == null ) {
- Class proxyClass = Proxy.getProxyClass(ConnectionPool.class.getClassLoader(), new Class[] {java.sql.Connection.class,javax.sql.PooledConnection.class});
+ Class<?> proxyClass = Proxy.getProxyClass(ConnectionPool.class.getClassLoader(), new Class[] {java.sql.Connection.class,javax.sql.PooledConnection.class});
proxyClassConstructor = proxyClass.getConstructor(new Class[] { InvocationHandler.class });
}
return proxyClassConstructor;
//return the members as idle to the pool
for (int i = 0; i < initialPool.length; i++) {
if (initialPool[i] != null) {
- try {this.returnConnection(initialPool[i]);}catch(Exception x){}
+ try {this.returnConnection(initialPool[i]);}catch(Exception x){/*NOOP*/}
} //end if
} //for
} //catch
* @param con
*/
protected void finalize(PooledConnection con) {
-
+ // NOOP
}
/**
* {@inheritDoc}
*/
public void postRegister(Boolean registrationDone) {
+ // NOOP
}
* {@inheritDoc}
*/
public void preDeregister() throws Exception {
+ // NOOP
}
/**
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
mbs.unregisterMBean(oname);
} catch (InstanceNotFoundException ignore) {
+ // NOOP
} catch (Exception e) {
log.error("Unable to unregister JDBC pool with JMX",e);
}
try {
java.util.Properties prop = DataSourceFactory
.getProperties(properties);
- Iterator i = prop.keySet().iterator();
+ Iterator<?> i = prop.keySet().iterator();
while (i.hasNext()) {
String key = (String) i.next();
String value = prop.getProperty(key);
* {@link javax.sql.DataSource#setLogWriter(PrintWriter)}
*/
public void setLogWriter(PrintWriter out) throws SQLException {
+ // NOOP
}
/**
* {@inheritDoc}
*/
public boolean addAll(Collection<? extends E> c) {
- Iterator i = c.iterator();
+ Iterator<? extends E> i = c.iterator();
while (i.hasNext()) {
- E e = (E)i.next();
+ E e = i.next();
offer(e);
}
return true;
* Public constructor for instantation through reflection
*/
public JdbcInterceptor() {
+ // NOOP
}
/**
* @param pool - the pool that is being closed.
*/
public void poolClosed(ConnectionPool pool) {
+ // NOOP
}
/**
* @param pool - the pool that is being closed.
*/
public void poolStarted(ConnectionPool pool) {
+ // NOOP
}
}
*/
@Override
public void setAccessToUnderlyingConnectionAllowed(boolean accessToUnderlyingConnectionAllowed) {
+ // NOOP
}
/**
if (log.isDebugEnabled())
log.debug("Unable to validate object:",ignore);
if (stmt!=null)
- try { stmt.close();} catch (Exception ignore2){}
+ try { stmt.close();} catch (Exception ignore2){/*NOOP*/}
}
return false;
} //validate
}
- public Object unwrap(Class iface) throws SQLException {
+ public Object unwrap(Class<?> iface) throws SQLException {
if (isWrapperFor(iface)) {
return connection.getConnection();
} else {
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
if (compare(ISCLOSED_VAL,method)) {
- return isClosed();
+ return Boolean.valueOf(isClosed());
}
if (compare(CLOSE_VAL,method)) {
if (isClosed()) return null; //noop for already closed.
*/
@Override
public void reset(ConnectionPool parent, PooledConnection con) {
-
+ // NOOP
}
}
//allow close to be called multiple times
if (close && closed) return null;
//are we calling isClosed?
- if (compare(JdbcInterceptor.ISCLOSED_VAL,name)) return closed;
+ if (compare(JdbcInterceptor.ISCLOSED_VAL,name)) return Boolean.valueOf(closed);
//if we are calling anything else, bail out
if (closed) throw new SQLException("Statement closed.");
boolean process = false;
try {
if (transactionIsolation==null || transactionIsolation.intValue()!=poolProperties.getDefaultTransactionIsolation()) {
con.getConnection().setTransactionIsolation(poolProperties.getDefaultTransactionIsolation());
- transactionIsolation = poolProperties.getDefaultTransactionIsolation();
+ transactionIsolation = Integer.valueOf(poolProperties.getDefaultTransactionIsolation());
}
}catch (SQLException x) {
transactionIsolation = null;
public CompositeDataSupport getCompositeData(final CompositeType type) throws OpenDataException{
Object[] values = new Object[] {
query,
- nrOfInvocations,
- maxInvocationTime,
- maxInvocationDate,
- minInvocationTime,
- minInvocationDate,
- totalInvocationTime,
- failures,
- prepareCount,
- prepareTime,
- lastInvocation
+ Integer.valueOf(nrOfInvocations),
+ Long.valueOf(maxInvocationTime),
+ Long.valueOf(maxInvocationDate),
+ Long.valueOf(minInvocationTime),
+ Long.valueOf(minInvocationDate),
+ Long.valueOf(totalInvocationTime),
+ Long.valueOf(failures),
+ Integer.valueOf(prepareCount),
+ Long.valueOf(prepareTime),
+ Long.valueOf(lastInvocation)
};
return new CompositeDataSupport(type,FIELD_NAMES,values);
}