1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
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  }