/**
* Creates a new instance.
*/
public DummySession() {
// Initialize dummy service.
IoAcceptor acceptor = new AbstractIoAcceptor(
new AbstractIoSessionConfig() {
@Override
protected void doSetAll(IoSessionConfig config) {}
},
new Executor() {
public void execute(Runnable command) {}
}) {
@Override
protected Set<SocketAddress> bindInternal(List<? extends SocketAddress> localAddresses) throws Exception {
throw new UnsupportedOperationException();
}
@Override
protected void unbind0(List<? extends SocketAddress> localAddresses) throws Exception {
throw new UnsupportedOperationException();
}
public IoSession newSession(SocketAddress remoteAddress, SocketAddress localAddress) {
throw new UnsupportedOperationException();
}
public TransportMetadata getTransportMetadata() {
return TRANSPORT_METADATA;
}
@Override
protected IoFuture dispose0() throws Exception {
return null;
}
};
// Set meaningless default values.
acceptor.setHandler(new IoHandlerAdapter());
service = acceptor;
processor = new IoProcessor<AbstractIoSession>() {
public void add(AbstractIoSession session) {