01: /*
02: * Copyright (C) The MX4J Contributors.
03: * All rights reserved.
04: *
05: * This software is distributed under the terms of the MX4J License version 1.0.
06: * See the terms of the MX4J License in the documentation provided with this software.
07: */
08:
09: package mx4j.remote;
10:
11: import java.io.IOException;
12:
13: /**
14: * A continuous pulse from client to server that gives the information that
15: * the connection is alive and the server is up.
16: *
17: * @version $Revision: 1.4 $
18: */
19: public interface HeartBeat {
20: /**
21: * Starts the heart beat
22: *
23: * @throws IOException If there are problems contacting the server
24: * @see #stop
25: */
26: public void start() throws IOException;
27:
28: /**
29: * Stops the heart beat
30: *
31: * @throws IOException If there are problems contacting the server
32: * @see #start
33: */
34: public void stop() throws IOException;
35:
36: /**
37: * Returns the period of time in milliseconds between two heart beats
38: *
39: * @see MX4JRemoteConstants#CONNECTION_HEARTBEAT_PERIOD
40: * @see #getMaxRetries
41: */
42: public long getPulsePeriod();
43:
44: /**
45: * Returns the maximum number of retries this heart beat attempts after
46: * a first connection failure before declaring the connection or the server
47: * as dead.
48: *
49: * @see MX4JRemoteConstants#CONNECTION_HEARTBEAT_RETRIES
50: * @see #getPulsePeriod
51: */
52: public int getMaxRetries();
53: }
|