IMessageHandler.java
01 /*
02  *
03  * Licensed to the Apache Software Foundation (ASF) under one
04  * or more contributor license agreements.  See the NOTICE file
05  * distributed with this work for additional information
06  * regarding copyright ownership.  The ASF licenses this file
07  * to you under the Apache License, Version 2.0 (the
08  * "License"); you may not use this file except in compliance
09  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  */
21 package org.apache.qpid.management.domain.handler.base;
22 
23 import org.apache.qpid.management.domain.model.DomainModel;
24 import org.apache.qpid.transport.codec.Decoder;
25 
26 /**
27  * Interface definition for a processor able to deal with a specific message.
28  * The concrete implementor must define what has to be done with the supplied (incoming) stream and the sequence 
29  * number.
30  
31  @author Andrea Gazzarini.
32  */
33 public interface IMessageHandler
34 {
35     /**
36      * Processes the (incoming) stream message.
37      * Note that the main controller (the component that is controlling this handler) has already read the magic number and 
38      * the sequence number so here concrete implementors must start from that point (that is, just after the  sequence 
39      * number).
40      
41      @param decoder the stream decoder.
42      @param sequenceNumber the sequence number of the message.
43      */
44     void process (Decoder decoder, int sequenceNumber);
45     
46     /**
47      * Injects the domain model into this handler.
48      
49      @param domainModel the domain model.
50      */
51     void setDomainModel(DomainModel domainModel);
52 }