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