/** * Adapt a <code>KeyedObjectPool</code> instance to work where an <code>ObjectPool</code> is needed. This is the * equivalent of calling {@link #adapt(KeyedObjectPool, Object) PoolUtils.adapt(aKeyedObjectPool, new Object())}. * * @param <V> the type of object * @param keyedPool the {@link KeyedObjectPool} to delegate to. * @return an {@link ObjectPool} that delegates to <code>keyedPool</code> with an internal key. * @throws IllegalArgumentException when <code>keyedPool</code> is <code>null</code>. * @see #adapt(KeyedObjectPool, Object) * @since Pool 1.3 */ public static <V> ObjectPool<V> adapt(final KeyedObjectPool<Object, V> keyedPool) throws IllegalArgumentException { return adapt(keyedPool, new Object()); }
/** * Adapt a <code>KeyedPoolableObjectFactory</code> instance to work where a <code>PoolableObjectFactory</code> is * needed. This method is the equivalent of calling * {@link #adapt(KeyedPoolableObjectFactory, Object) PoolUtils.adapt(aKeyedPoolableObjectFactory, new Object())}. * * @param <V> the type of object * @param keyedFactory the {@link KeyedPoolableObjectFactory} to delegate to. * @return a {@link PoolableObjectFactory} that delegates to <code>keyedFactory</code> with an internal key. * @throws IllegalArgumentException when <code>keyedFactory</code> is <code>null</code>. * @see #adapt(KeyedPoolableObjectFactory, Object) * @since Pool 1.3 */ public static <V> PoolableObjectFactory<V> adapt(final KeyedPoolableObjectFactory<Object, V> keyedFactory) throws IllegalArgumentException { return adapt(keyedFactory, new Object()); }
/** * Sets the PoolableObjectFactory for the pool. * * @param factory new PoolableObjectFactory * @deprecated to be removed in version 2.0 */ @Deprecated public void setFactory(final PoolableObjectFactory<V> factory) throws IllegalStateException, UnsupportedOperationException { keyedPool.setFactory(adapt(factory)); }
/** * Sets the factory used to manage objects. * * @param factory new factory to use managing object instances * @deprecated to be removed in version 2.0 */ @Deprecated @SuppressWarnings("unchecked") public void setFactory(final KeyedPoolableObjectFactory<K, V> factory) throws IllegalStateException, UnsupportedOperationException { pool.setFactory(adapt((KeyedPoolableObjectFactory<Object, V>)factory)); }
/** * Adapt a <code>KeyedPoolableObjectFactory</code> instance to work where a <code>PoolableObjectFactory</code> is * needed. This method is the equivalent of calling * {@link #adapt(KeyedPoolableObjectFactory, Object) PoolUtils.adapt(aKeyedPoolableObjectFactory, new Object())}. * * @param keyedFactory the {@link KeyedPoolableObjectFactory} to delegate to. * @return a {@link PoolableObjectFactory} that delegates to <code>keyedFactory</code> with an internal key. * @throws IllegalArgumentException when <code>keyedFactory</code> is <code>null</code>. * @see #adapt(KeyedPoolableObjectFactory, Object) * @since Pool 1.3 */ public static PoolableObjectFactory adapt(final KeyedPoolableObjectFactory keyedFactory) throws IllegalArgumentException { return adapt(keyedFactory, new Object()); }
/** * Adapt a <code>KeyedObjectPool</code> instance to work where an <code>ObjectPool</code> is needed. This is the * equivalent of calling {@link #adapt(KeyedObjectPool, Object) PoolUtils.adapt(aKeyedObjectPool, new Object())}. * * @param keyedPool the {@link KeyedObjectPool} to delegate to. * @return an {@link ObjectPool} that delegates to <code>keyedPool</code> with an internal key. * @throws IllegalArgumentException when <code>keyedPool</code> is <code>null</code>. * @see #adapt(KeyedObjectPool, Object) * @since Pool 1.3 */ public static ObjectPool adapt(final KeyedObjectPool keyedPool) throws IllegalArgumentException { return adapt(keyedPool, new Object()); }
/** * Adapt a <code>KeyedObjectPool</code> instance to work where an <code>ObjectPool</code> is needed. This is the * equivalent of calling {@link #adapt(KeyedObjectPool, Object) PoolUtils.adapt(aKeyedObjectPool, new Object())}. * * @param keyedPool the {@link KeyedObjectPool} to delegate to. * @return an {@link ObjectPool} that delegates to <code>keyedPool</code> with an internal key. * @throws IllegalArgumentException when <code>keyedPool</code> is <code>null</code>. * @see #adapt(KeyedObjectPool, Object) * @since Pool 1.3 */ public static ObjectPool adapt(final KeyedObjectPool keyedPool) throws IllegalArgumentException { return adapt(keyedPool, new Object()); }
/** * Adapt a <code>KeyedObjectPool</code> instance to work where an <code>ObjectPool</code> is needed. This is the * equivalent of calling {@link #adapt(KeyedObjectPool, Object) PoolUtils.adapt(aKeyedObjectPool, new Object())}. * * @param <V> the type of object * @param keyedPool the {@link KeyedObjectPool} to delegate to. * @return an {@link ObjectPool} that delegates to <code>keyedPool</code> with an internal key. * @throws IllegalArgumentException when <code>keyedPool</code> is <code>null</code>. * @see #adapt(KeyedObjectPool, Object) * @since Pool 1.3 */ public static <V> ObjectPool<V> adapt(final KeyedObjectPool<Object, V> keyedPool) throws IllegalArgumentException { return adapt(keyedPool, new Object()); }
/** * Adapt a <code>KeyedPoolableObjectFactory</code> instance to work where a <code>PoolableObjectFactory</code> is * needed. This method is the equivalent of calling * {@link #adapt(KeyedPoolableObjectFactory, Object) PoolUtils.adapt(aKeyedPoolableObjectFactory, new Object())}. * * @param <V> the type of object * @param keyedFactory the {@link KeyedPoolableObjectFactory} to delegate to. * @return a {@link PoolableObjectFactory} that delegates to <code>keyedFactory</code> with an internal key. * @throws IllegalArgumentException when <code>keyedFactory</code> is <code>null</code>. * @see #adapt(KeyedPoolableObjectFactory, Object) * @since Pool 1.3 */ public static <V> PoolableObjectFactory<V> adapt(final KeyedPoolableObjectFactory<Object, V> keyedFactory) throws IllegalArgumentException { return adapt(keyedFactory, new Object()); }
/** * Adapt a <code>KeyedObjectPool</code> instance to work where an <code>ObjectPool</code> is needed. This is the * equivalent of calling {@link #adapt(KeyedObjectPool, Object) PoolUtils.adapt(aKeyedObjectPool, new Object())}. * * @param <V> the type of object * @param keyedPool the {@link KeyedObjectPool} to delegate to. * @return an {@link ObjectPool} that delegates to <code>keyedPool</code> with an internal key. * @throws IllegalArgumentException when <code>keyedPool</code> is <code>null</code>. * @see #adapt(KeyedObjectPool, Object) * @since Pool 1.3 */ public static <V> ObjectPool<V> adapt(final KeyedObjectPool<Object, V> keyedPool) throws IllegalArgumentException { return adapt(keyedPool, new Object()); }
/** * Adapt a <code>KeyedPoolableObjectFactory</code> instance to work where a <code>PoolableObjectFactory</code> is * needed. This method is the equivalent of calling * {@link #adapt(KeyedPoolableObjectFactory, Object) PoolUtils.adapt(aKeyedPoolableObjectFactory, new Object())}. * * @param keyedFactory the {@link KeyedPoolableObjectFactory} to delegate to. * @return a {@link PoolableObjectFactory} that delegates to <code>keyedFactory</code> with an internal key. * @throws IllegalArgumentException when <code>keyedFactory</code> is <code>null</code>. * @see #adapt(KeyedPoolableObjectFactory, Object) * @since Pool 1.3 */ public static PoolableObjectFactory adapt(final KeyedPoolableObjectFactory keyedFactory) throws IllegalArgumentException { return adapt(keyedFactory, new Object()); }
/** * Sets the factory used to manage objects. * * @param factory new factory to use managing object instances * @deprecated to be removed in version 2.0 */ @Deprecated @SuppressWarnings("unchecked") public void setFactory(final KeyedPoolableObjectFactory<K, V> factory) throws IllegalStateException, UnsupportedOperationException { pool.setFactory(adapt((KeyedPoolableObjectFactory<Object, V>)factory)); }
/** * Sets the PoolableObjectFactory for the pool. * * @param factory new PoolableObjectFactory * @deprecated to be removed in version 2.0 */ @Deprecated public void setFactory(final PoolableObjectFactory<V> factory) throws IllegalStateException, UnsupportedOperationException { keyedPool.setFactory(adapt(factory)); }
/** * Sets the PoolableObjectFactory for the pool. * * @param factory new PoolableObjectFactory * @deprecated to be removed in version 2.0 */ @Deprecated public void setFactory(final PoolableObjectFactory<V> factory) throws IllegalStateException, UnsupportedOperationException { keyedPool.setFactory(adapt(factory)); }
public void setFactory(final PoolableObjectFactory factory) throws IllegalStateException, UnsupportedOperationException { keyedPool.setFactory(adapt(factory)); }
@Nonnull public RaftClient get(@Nonnull Replica replica) { checkNotNull(replica); return new ProtoRpcRaftClient(PoolUtils.adapt(connectionPools, replica)); }
/** * Sets the factory used to manage objects. * * @param factory new factory to use managing object instances * @deprecated to be removed in version 2.0 */ @Deprecated @SuppressWarnings("unchecked") public void setFactory(final KeyedPoolableObjectFactory<K, V> factory) throws IllegalStateException, UnsupportedOperationException { pool.setFactory(adapt((KeyedPoolableObjectFactory<Object, V>)factory)); }
public void setFactory(final PoolableObjectFactory factory) throws IllegalStateException, UnsupportedOperationException { keyedPool.setFactory(adapt(factory)); }
public void setFactory(final KeyedPoolableObjectFactory factory) throws IllegalStateException, UnsupportedOperationException { pool.setFactory(adapt(factory)); }
public void setFactory(final KeyedPoolableObjectFactory factory) throws IllegalStateException, UnsupportedOperationException { pool.setFactory(adapt(factory)); }