/* * 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; /** * A skeletal server-side {@link Channel} implementation. A server-side * {@link Channel} does not allow the following operations: * * * @author The Netty Project (netty-dev@lists.jboss.org) * @author Trustin Lee (tlee@redhat.com) * * @version $Rev$, $Date$ * */ public abstract class AbstractServerChannel extends AbstractChannel implements ServerChannel { /** * 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(); } public boolean isConnected() { return false; } }