netty5/src/main/java/org/jboss/netty/channel/AbstractServerChannel.java

102 lines
3.1 KiB
Java
Raw Normal View History

/*
* JBoss, Home of Professional Open Source
*
* Copyright 2008, Red Hat Middleware LLC, and individual contributors
* by the @author tags. See the COPYRIGHT.txt in the distribution for a
* full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.netty.channel;
import java.net.SocketAddress;
/**
2008-09-02 09:13:20 +02:00
* A skeletal server-side {@link Channel} implementation. A server-side
2008-11-14 08:45:53 +01:00
* {@link Channel} does not allow the following operations:
2008-09-02 09:13:20 +02:00
* <ul>
* <li>{@link #connect(SocketAddress)}</li>
* <li>{@link #disconnect()}</li>
* <li>{@link #getInterestOps()}</li>
* <li>{@link #setInterestOps(int)}</li>
* <li>{@link #write(Object)}</li>
* <li>{@link #write(Object, SocketAddress)}</li>
* <li>and the shortcut methods which calls the methods mentioned above
* </ul>
*
* @author The Netty Project (netty-dev@lists.jboss.org)
* @author Trustin Lee (tlee@redhat.com)
*
* @version $Rev$, $Date$
*
*/
public abstract class AbstractServerChannel extends AbstractChannel {
2008-09-02 09:13:20 +02:00
/**
* Creates a new instance.
*
* @param factory
* the factory which created this channel
* @param pipeline
* the pipeline which is going to be attached to this channel
* @param sink
* the sink which will receive downstream events from the pipeline
* and send upstream events to the pipeline
*/
protected AbstractServerChannel(
ChannelFactory factory,
ChannelPipeline pipeline,
ChannelSink sink) {
super(null, factory, pipeline, sink);
}
@Override
public ChannelFuture connect(SocketAddress remoteAddress) {
return getUnsupportedOperationFuture();
}
@Override
public ChannelFuture disconnect() {
return getUnsupportedOperationFuture();
}
@Override
public int getInterestOps() {
return OP_NONE;
}
@Override
public ChannelFuture setInterestOps(int interestOps) {
return getUnsupportedOperationFuture();
}
@Override
protected void setInterestOpsNow(int interestOps) {
// Ignore.
}
@Override
public ChannelFuture write(Object message) {
return getUnsupportedOperationFuture();
}
@Override
public ChannelFuture write(Object message, SocketAddress remoteAddress) {
return getUnsupportedOperationFuture();
}
}