1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.cluster;
16  
17  import org.jgroups.Address;
18  
19  /**
20   * <a href="AddressImpl.java.html"><b><i>View Source</i></b></a>
21   *
22   * @author Shuyang Zhou
23   */
24  public class AddressImpl implements com.liferay.portal.kernel.cluster.Address {
25  
26      public AddressImpl(Address address) {
27          _address = address;
28      }
29  
30      public boolean equals(Object obj) {
31          if (obj == null) {
32              return false;
33          }
34  
35          AddressImpl addressImpl = null;
36  
37          try {
38              addressImpl = (AddressImpl)obj;
39          }
40          catch (ClassCastException cce) {
41              return false;
42          }
43  
44          if (_address.equals(addressImpl._address)) {
45              return true;
46          }
47          else {
48              return false;
49          }
50      }
51  
52      public String getDescription() {
53          return _address.toString();
54      }
55  
56      public Address getRealAddress() {
57          return _address;
58      }
59  
60      public int hashCode() {
61          return _address.hashCode();
62      }
63  
64      public String toString() {
65          return _address.toString();
66      }
67  
68      private Address _address;
69  
70  }