01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package org.apache.catalina.tribes;
19:
20: /**
21: * ChannelReceiver Interface<br>
22: * The <code>ChannelReceiver</code> interface is the data receiver component
23: * at the bottom layer, the IO layer (for layers see the javadoc for the {@link Channel} interface).
24: * This class may optionally implement a thread pool for parallel processing of incoming messages.
25: * @author Filip Hanik
26: * @version $Revision: 467222 $, $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $
27: */
28: public interface ChannelReceiver extends Heartbeat {
29: /**
30: * Start listening for incoming messages on the host/port
31: * @throws java.io.IOException
32: */
33: public void start() throws java.io.IOException;
34:
35: /**
36: * Stop listening for messages
37: */
38: public void stop();
39:
40: /**
41: * String representation of the IPv4 or IPv6 address that this host is listening
42: * to.
43: * @return the host that this receiver is listening to
44: */
45: public String getHost();
46:
47: /**
48: * Returns the listening port
49: * @return port
50: */
51: public int getPort();
52:
53: /**
54: * Returns the secure listening port
55: * @return port, -1 if a secure port is not activated
56: */
57: public int getSecurePort();
58:
59: /**
60: * Sets the message listener to receive notification of incoming
61: * @param listener MessageListener
62: * @see MessageListener
63: */
64: public void setMessageListener(MessageListener listener);
65:
66: /**
67: * Returns the message listener that is associated with this receiver
68: * @return MessageListener
69: * @see MessageListener
70: */
71: public MessageListener getMessageListener();
72:
73: }
|