@Test public void testWrap() { JdbcDataSource h2DataSource = new JdbcDataSource(); h2DataSource.setURL("jdbc:h2:mem:"); XADataSource wrap = SniffyDataSource.wrap(h2DataSource); assertNotNull(wrap); }
@SuppressWarnings("unchecked") public static < T extends CommonDataSource, R extends DataSource & XADataSource & ConnectionPoolDataSource> R wrap(T target) { return (R) new SniffyDataSource(target); }
SniffyDataSource implements DataSource, XADataSource, ConnectionPoolDataSource { @SuppressWarnings("unchecked") public static < T extends CommonDataSource, R extends DataSource & XADataSource & ConnectionPoolDataSource> R wrap(T target) { return (R) new SniffyDataSource(target); } }
SniffyDataSource implements DataSource, XADataSource, ConnectionPoolDataSource { @SuppressWarnings("unchecked") public static < T extends CommonDataSource, R extends DataSource & XADataSource & ConnectionPoolDataSource> R wrap(T target) { return (R) new SniffyDataSource(target); } <T extends CommonDataSource> SniffyDataSource(T target); }
SniffyDataSource implements DataSource, XADataSource, ConnectionPoolDataSource { @SuppressWarnings("unchecked") public static < T extends CommonDataSource, R extends DataSource & XADataSource & ConnectionPoolDataSource> R wrap(T target) { return (R) new SniffyDataSource(target); } <T extends CommonDataSource> SniffyDataSource(T target); @SuppressWarnings("unchecked") static R wrap(T target); @Override Connection getConnection(); @Override Connection getConnection(String userName, String password); @Override XAConnection getXAConnection(); @Override XAConnection getXAConnection(String user, String password); @Override PooledConnection getPooledConnection(); @Override PooledConnection getPooledConnection(String user, String password); @Override PrintWriter getLogWriter(); @Override void setLogWriter(PrintWriter out); @Override void setLoginTimeout(int seconds); @Override int getLoginTimeout(); @Override @IgnoreJRERequirement @SuppressWarnings("Since15") Logger getParentLogger(); @Override T unwrap(Class<T> iface); @Override boolean isWrapperFor(Class<?> iface); }
SniffyDataSource implements DataSource, XADataSource, ConnectionPoolDataSource { @SuppressWarnings("unchecked") public static < T extends CommonDataSource, R extends DataSource & XADataSource & ConnectionPoolDataSource> R wrap(T target) { return (R) new SniffyDataSource(target); } <T extends CommonDataSource> SniffyDataSource(T target); @SuppressWarnings("unchecked") static R wrap(T target); @Override Connection getConnection(); @Override Connection getConnection(String userName, String password); @Override XAConnection getXAConnection(); @Override XAConnection getXAConnection(String user, String password); @Override PooledConnection getPooledConnection(); @Override PooledConnection getPooledConnection(String user, String password); @Override PrintWriter getLogWriter(); @Override void setLogWriter(PrintWriter out); @Override void setLoginTimeout(int seconds); @Override int getLoginTimeout(); @Override @IgnoreJRERequirement @SuppressWarnings("Since15") Logger getParentLogger(); @Override T unwrap(Class<T> iface); @Override boolean isWrapperFor(Class<?> iface);  }