View Javadoc

1   /*
2    * Copyright (c) 1998-2002 The Jgroup Team.
3    *
4    * This program is free software; you can redistribute it and/or modify
5    * it under the terms of the GNU Lesser General Public License version 2 as
6    * published by the Free Software Foundation.
7    *
8    * This program is distributed in the hope that it will be useful,
9    * but WITHOUT ANY WARRANTY; without even the implied warranty of
10   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11   * GNU Lesser General Public License for more details.
12   *
13   * You should have received a copy of the GNU Lesser General Public License
14   * along with this program; if not, write to the Free Software
15   * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16   *
17   */
18  
19  package jgroup.core;
20  
21  import java.io.Externalizable;
22  import java.net.InetAddress;
23  
24  /**
25   *  Interface <code>EndPoint</code> represents a communication endpoint.
26   *  It is composed of an IP address together with a port number.
27   *  Objects implementing this interface are used to identify JVM
28   *  machines hosting Jgroup applications.
29   *
30   *  @author Alberto Montresor
31   *  @author Hein Meling
32   *  @since Jgroup 1.2
33   */
34  public interface EndPoint
35    extends Externalizable, Comparable
36  {
37  
38    /**
39     *  Returns the IP address contained in this endpoint
40     */
41    public InetAddress getAddress();
42  
43    /**
44     *  Returns the IP address contained in this endpoint, enclosed
45     *  in an integer value.
46     */
47    public int getIntAddress();
48  
49    /**
50     *  Returns the port number contained in this endpoint.
51     */
52    public int getPort();
53  
54    /**
55     *  Returns true if this endpoint is the local endpoint.
56     */
57    public boolean isLocal();
58  
59    /**
60     *  Return true if this endpoint is a multicast endpoint.
61     */
62    public boolean isMulticastEndPoint();
63  
64  } // END EndPoint