/** * Creates a new proxy connector. */ public ProxyConnector() { super(new DefaultSocketSessionConfig(), null); }
/** * Creates a new proxy connector. * * @param connector Connector used to establish proxy connections. */ public ProxyConnector(final SocketConnector connector) { this(connector, new DefaultSocketSessionConfig(), null); }
/** * Constructor for {@link NioSocketConnector} with default configuration with default configuration which will use a built-in * thread pool executor to manage the default number of processor instances. The processor class must have * a constructor that accepts ExecutorService or Executor as its single argument, or, failing that, a * no-arg constructor. The default number of instances is equal to the number of processor cores * in the system, plus one. * * @param processorClass the processor class. * @see SimpleIoProcessorPool#SimpleIoProcessorPool(Class, Executor, int, java.nio.channels.spi.SelectorProvider) * @since 2.0.0-M4 */ public NioSocketConnector(Class<? extends IoProcessor<NioSession>> processorClass) { super(new DefaultSocketSessionConfig(), processorClass); }
/** * Creates a new proxy connector. * * @param connector Connector used to establish proxy connections. */ public ProxyConnector(final SocketConnector connector) { this(connector, new DefaultSocketSessionConfig(), null); }
/** * Creates a new proxy connector. */ public ProxyConnector() { super(new DefaultSocketSessionConfig(), null); }
/** * Constructor for {@link NioSocketConnector} with default configuration, and * given number of {@link NioProcessor} for multithreading I/O operations * @param processorCount the number of processor to create and place in a * {@link SimpleIoProcessorPool} */ public NioSocketConnector(int processorCount) { super(new DefaultSocketSessionConfig(), NioProcessor.class, processorCount); ((DefaultSocketSessionConfig) getSessionConfig()).init(this); }
/** * Constructor for {@link NioSocketAcceptor} using default parameters (multiple thread model). */ public NioSocketAcceptor() { super(new DefaultSocketSessionConfig(), NioProcessor.class); ((DefaultSocketSessionConfig) getSessionConfig()).init(this); }
private SocketSessionConfig getSessionConfig() { SocketSessionConfig config = new DefaultSocketSessionConfig(); config.setKeepAlive(true); config.setReuseAddress(true); return config; }
/** * Constructor for {@link NioSocketAcceptor} using default parameters, and * given number of {@link NioProcessor} for multithreading I/O operations. * * @param processorCount the number of processor to create and place in a * {@link SimpleIoProcessorPool} */ public NioSocketAcceptor(int processorCount) { super(new DefaultSocketSessionConfig(), NioProcessor.class, processorCount); ((DefaultSocketSessionConfig) getSessionConfig()).init(this); }
/** * Constructor for {@link NioSocketConnector} with default configuration (multiple thread model). */ public NioSocketConnector() { super(new DefaultSocketSessionConfig(), NioProcessor.class); ((DefaultSocketSessionConfig) getSessionConfig()).init(this); }
/** * Constructor for {@link NioSocketConnector} with default configuration but a * specific {@link IoProcessor}, useful for sharing the same processor over multiple * {@link IoService} of the same type. * @param processor the processor to use for managing I/O events */ public NioSocketConnector(IoProcessor<NioSession> processor) { super(new DefaultSocketSessionConfig(), processor); ((DefaultSocketSessionConfig) getSessionConfig()).init(this); }
/** * Constructor for {@link NioSocketAcceptor} with default configuration but a * specific {@link IoProcessor}, useful for sharing the same processor over multiple * {@link IoService} of the same type. * @param processor the processor to use for managing I/O events */ public NioSocketAcceptor(IoProcessor<NioSession> processor) { super(new DefaultSocketSessionConfig(), processor); ((DefaultSocketSessionConfig) getSessionConfig()).init(this); }
/** * Constructor for {@link NioSocketAcceptor} with a given {@link Executor} for handling * connection events and a given {@link IoProcessor} for handling I/O events, useful for * sharing the same processor and executor over multiple {@link IoService} of the same type. * @param executor the executor for connection * @param processor the processor for I/O operations */ public NioSocketAcceptor(Executor executor, IoProcessor<NioSession> processor) { super(new DefaultSocketSessionConfig(), executor, processor); ((DefaultSocketSessionConfig) getSessionConfig()).init(this); }
/** * Constructor for {@link NioSocketConnector} with a given {@link Executor} for handling * connection events and a given {@link IoProcessor} for handling I/O events, useful for sharing * the same processor and executor over multiple {@link IoService} of the same type. * @param executor the executor for connection * @param processor the processor for I/O operations */ public NioSocketConnector(Executor executor, IoProcessor<NioSession> processor) { super(new DefaultSocketSessionConfig(), executor, processor); ((DefaultSocketSessionConfig) getSessionConfig()).init(this); }
/** * Constructor for {@link NioSocketAcceptor} using default parameters, and * given number of {@link NioProcessor} for multithreading I/O operations. * * @param processorCount the number of processor to create and place in a * {@link SimpleIoProcessorPool} */ public NioSocketAcceptor(int processorCount) { super(new DefaultSocketSessionConfig(), NioProcessor.class, processorCount); ((DefaultSocketSessionConfig) getSessionConfig()).init(this); }
/** * Constructor for {@link NioSocketAcceptor} using default parameters, and * given number of {@link NioProcessor} for multithreading I/O operations, and * a custom SelectorProvider for NIO * * @param processorCount the number of processor to create and place in a * @param selectorProvider teh SelectorProvider to use * {@link SimpleIoProcessorPool} */ public NioSocketAcceptor(int processorCount, SelectorProvider selectorProvider) { super(new DefaultSocketSessionConfig(), NioProcessor.class, processorCount, selectorProvider); ((DefaultSocketSessionConfig) getSessionConfig()).init(this); this.selectorProvider = selectorProvider; }
/** * Constructor for {@link NioSocketAcceptor} with a given {@link Executor} for handling * connection events and a given {@link IoProcessor} for handling I/O events, useful for * sharing the same processor and executor over multiple {@link IoService} of the same type. * @param executor the executor for connection * @param processor the processor for I/O operations */ public NioSocketAcceptor(Executor executor, IoProcessor<NioSession> processor) { super(new DefaultSocketSessionConfig(), executor, processor); ((DefaultSocketSessionConfig) getSessionConfig()).init(this); }
/** * Constructor for {@link NioSocketConnector} with default configuration, and * given number of {@link NioProcessor} for multithreading I/O operations * @param processorCount the number of processor to create and place in a * {@link SimpleIoProcessorPool} */ public NioSocketConnector(int processorCount) { super(new DefaultSocketSessionConfig(), NioProcessor.class, processorCount); ((DefaultSocketSessionConfig) getSessionConfig()).init(this); }
/** * Constructor for {@link NioSocketConnector} with default configuration (multiple thread model). */ public NioSocketConnector() { super(new DefaultSocketSessionConfig(), NioProcessor.class); ((DefaultSocketSessionConfig) getSessionConfig()).init(this); }
/** * Constructor for {@link NioSocketConnector} with a given {@link Executor} for handling * connection events and a given {@link IoProcessor} for handling I/O events, useful for sharing * the same processor and executor over multiple {@link IoService} of the same type. * @param executor the executor for connection * @param processor the processor for I/O operations */ public NioSocketConnector(Executor executor, IoProcessor<NioSession> processor) { super(new DefaultSocketSessionConfig(), executor, processor); ((DefaultSocketSessionConfig) getSessionConfig()).init(this); }