1 20 package org.apache.mina.common.support; 21 22 import java.net.SocketAddress ; 23 import java.util.Set ; 24 25 import org.apache.mina.common.ConnectFuture; 26 import org.apache.mina.common.DefaultIoFilterChainBuilder; 27 import org.apache.mina.common.IoConnector; 28 import org.apache.mina.common.IoFilterChainBuilder; 29 import org.apache.mina.common.IoHandler; 30 import org.apache.mina.common.IoServiceConfig; 31 import org.apache.mina.common.IoServiceListener; 32 import org.apache.mina.common.IoSession; 33 34 40 public class DelegatedIoConnector implements IoConnector { 41 protected IoConnector delegate; 42 43 46 protected DelegatedIoConnector() { 47 } 48 49 53 protected void init(IoConnector delegate) { 54 this.delegate = delegate; 55 } 56 57 public ConnectFuture connect(SocketAddress address, IoHandler handler) { 58 return delegate.connect(address, handler); 59 } 60 61 public ConnectFuture connect(SocketAddress address, IoHandler handler, 62 IoServiceConfig config) { 63 return delegate.connect(address, handler, config); 64 } 65 66 public ConnectFuture connect(SocketAddress address, 67 SocketAddress localAddress, IoHandler handler) { 68 return delegate.connect(address, localAddress, handler); 69 } 70 71 public ConnectFuture connect(SocketAddress address, 72 SocketAddress localAddress, IoHandler handler, 73 IoServiceConfig config) { 74 return delegate.connect(address, localAddress, handler, config); 75 } 76 77 public boolean isManaged(SocketAddress serviceAddress) { 78 return delegate.isManaged(serviceAddress); 79 } 80 81 public Set <SocketAddress > getManagedServiceAddresses() { 82 return delegate.getManagedServiceAddresses(); 83 } 84 85 public Set <IoSession> getManagedSessions(SocketAddress serviceAddress) { 86 return delegate.getManagedSessions(serviceAddress); 87 } 88 89 public IoServiceConfig getDefaultConfig() { 90 return delegate.getDefaultConfig(); 91 } 92 93 public IoFilterChainBuilder getFilterChainBuilder() { 94 return delegate.getFilterChainBuilder(); 95 } 96 97 public void setFilterChainBuilder(IoFilterChainBuilder builder) { 98 delegate.setFilterChainBuilder(builder); 99 } 100 101 public DefaultIoFilterChainBuilder getFilterChain() { 102 return delegate.getFilterChain(); 103 } 104 105 public void addListener(IoServiceListener listener) { 106 delegate.addListener(listener); 107 } 108 109 public void removeListener(IoServiceListener listener) { 110 delegate.removeListener(listener); 111 } 112 } 113 | Popular Tags |