mirror of
https://github.com/iterate-ch/cyberduck.git
synced 2026-05-26 19:10:49 +00:00
Add type information.
This commit is contained in:
@@ -55,9 +55,9 @@ public class DefaultSessionPool implements SessionPool {
|
||||
|
||||
private final VaultRegistry registry;
|
||||
|
||||
private final GenericObjectPool<Session> pool;
|
||||
private final GenericObjectPool<Session<?>> pool;
|
||||
|
||||
private static final GenericObjectPoolConfig<Session> configuration = new GenericObjectPoolConfig<>();
|
||||
private static final GenericObjectPoolConfig<Session<?>> configuration = new GenericObjectPoolConfig<>();
|
||||
|
||||
static {
|
||||
configuration.setJmxEnabled(false);
|
||||
@@ -74,12 +74,12 @@ public class DefaultSessionPool implements SessionPool {
|
||||
|
||||
public DefaultSessionPool(final ConnectionService connect, final X509TrustManager trust, final X509KeyManager key,
|
||||
final VaultRegistry registry, final TranscriptListener transcript, final Host bookmark) {
|
||||
this(connect, registry, transcript, bookmark,
|
||||
this(registry, transcript, bookmark,
|
||||
new GenericObjectPool<>(new PooledSessionFactory(connect, trust, key, bookmark, registry), configuration, abandon));
|
||||
}
|
||||
|
||||
public DefaultSessionPool(final ConnectionService connect, final VaultRegistry registry, final TranscriptListener transcript,
|
||||
final Host bookmark, final GenericObjectPool<Session> pool) {
|
||||
public DefaultSessionPool(final VaultRegistry registry, final TranscriptListener transcript,
|
||||
final Host bookmark, final GenericObjectPool<Session<?>> pool) {
|
||||
this.transcript = transcript;
|
||||
this.bookmark = bookmark;
|
||||
this.registry = registry;
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.apache.commons.pool2.impl.DefaultPooledObject;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
public class PooledSessionFactory extends BasePooledObjectFactory<Session> {
|
||||
public class PooledSessionFactory extends BasePooledObjectFactory<Session<?>> {
|
||||
private static final Logger log = LogManager.getLogger(PooledSessionFactory.class);
|
||||
|
||||
private final ConnectionService connect;
|
||||
@@ -52,32 +52,32 @@ public class PooledSessionFactory extends BasePooledObjectFactory<Session> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Session create() {
|
||||
public Session<?> create() {
|
||||
log.debug("Create new session for host {} in pool", bookmark);
|
||||
return SessionFactory.create(bookmark, trust, key).withRegistry(registry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PooledObject<Session> wrap(final Session session) {
|
||||
public PooledObject<Session<?>> wrap(final Session<?> session) {
|
||||
return new DefaultPooledObject<>(session);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void activateObject(final PooledObject<Session> p) throws BackgroundException {
|
||||
final Session session = p.getObject();
|
||||
public void activateObject(final PooledObject<Session<?>> p) throws BackgroundException {
|
||||
final Session<?> session = p.getObject();
|
||||
log.debug("Activate session {}", session);
|
||||
connect.check(session, CancelCallback.noop);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void passivateObject(final PooledObject<Session> p) {
|
||||
final Session session = p.getObject();
|
||||
public void passivateObject(final PooledObject<Session<?>> p) {
|
||||
final Session<?> session = p.getObject();
|
||||
log.debug("Pause session {}", session);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroyObject(final PooledObject<Session> p) throws BackgroundException {
|
||||
final Session session = p.getObject();
|
||||
public void destroyObject(final PooledObject<Session<?>> p) throws BackgroundException {
|
||||
final Session<?> session = p.getObject();
|
||||
log.debug("Destroy session {}", session);
|
||||
connect.close(session);
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public class DefaultSessionPoolTest {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
final DefaultSessionPool pool = new DefaultSessionPool(connect,
|
||||
final DefaultSessionPool pool = new DefaultSessionPool(
|
||||
new DefaultVaultRegistry(new DisabledPasswordCallback()), new DisabledTranscriptListener(), bookmark,
|
||||
new GenericObjectPool<>(new PooledSessionFactory(connect, new DisabledX509TrustManager(), new DefaultX509KeyManager(),
|
||||
bookmark, new DefaultVaultRegistry(new DisabledPasswordCallback())) {
|
||||
@@ -102,7 +102,7 @@ public class DefaultSessionPoolTest {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
final DefaultSessionPool pool = new DefaultSessionPool(connect,
|
||||
final DefaultSessionPool pool = new DefaultSessionPool(
|
||||
new DefaultVaultRegistry(new DisabledPasswordCallback()), new DisabledTranscriptListener(), bookmark,
|
||||
new GenericObjectPool<>(new PooledSessionFactory(connect, new DisabledX509TrustManager(), new DefaultX509KeyManager(),
|
||||
bookmark, new DefaultVaultRegistry(new DisabledPasswordCallback())) {
|
||||
|
||||
Reference in New Issue
Block a user