001/*
002 * Copyright 2009 Red Hat, Inc.
003 * Red Hat licenses this file to you under the Apache License, version
004 * 2.0 (the "License"); you may not use this file except in compliance
005 * with the License.  You may obtain a copy of the License at
006 *    http://www.apache.org/licenses/LICENSE-2.0
007 * Unless required by applicable law or agreed to in writing, software
008 * distributed under the License is distributed on an "AS IS" BASIS,
009 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
010 * implied.  See the License for the specific language governing
011 * permissions and limitations under the License.
012 */
013package org.hornetq.spi.core.remoting;
014
015import org.hornetq.api.core.HornetQBuffer;
016
017/**
018 * A BufferHandler that will handle buffers received by an acceptor.
019 * <p/>
020 * The Buffer Handler will decode the buffer and take the appropriate action, typically forwarding to the correct channel.
021 *
022 * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
023 */
024public interface BufferHandler
025{
026   /**
027    * called by the remoting connection when a buffer is received.
028    *
029    * @param connectionID the connection the buffer was received on
030    * @param buffer       the buffer to decode
031    */
032   void bufferReceived(Object connectionID, HornetQBuffer buffer);   
033}