View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.module.jca;
8   
9   import javax.resource.spi.endpoint.MessageEndpointFactory;
10  
11  /**
12   * <code>MuleEndpointKey</code> TODO
13   */
14  public class MuleEndpointKey
15  {
16      final private MessageEndpointFactory messageEndpointFactory;
17      final private MuleActivationSpec activationSpec;
18  
19      /**
20       * @param messageEndpointFactory
21       * @param activationSpec
22       */
23      public MuleEndpointKey(MessageEndpointFactory messageEndpointFactory, MuleActivationSpec activationSpec)
24      {
25          this.messageEndpointFactory = messageEndpointFactory;
26          this.activationSpec = activationSpec;
27      }
28  
29      /**
30       * @return Returns the activationSpec.
31       */
32      public MuleActivationSpec getActivationSpec()
33      {
34          return activationSpec;
35      }
36  
37      /**
38       * @return Returns the messageEndpointFactory.
39       */
40      public MessageEndpointFactory getMessageEndpointFactory()
41      {
42          return messageEndpointFactory;
43      }
44  
45      /**
46       * @see java.lang.Object#hashCode()
47       */
48      public int hashCode()
49      {
50          return messageEndpointFactory.hashCode() ^ activationSpec.hashCode();
51      }
52  
53      /**
54       * @see java.lang.Object#equals(java.lang.Object)
55       */
56      public boolean equals(Object obj)
57      {
58          if (this == obj)
59          {
60              return true;
61          }
62  
63          if (obj == null)
64          {
65              return false;
66          }
67  
68          if (this.getClass() != obj.getClass())
69          {
70              return false;
71          }
72  
73          MuleEndpointKey o = (MuleEndpointKey)obj;
74          return o.activationSpec == activationSpec && o.messageEndpointFactory == messageEndpointFactory;
75      }
76  
77      public String toString()
78      {
79          return "MuleEndpointKey{" + "messageEndpointFactory=" + messageEndpointFactory + ", activationSpec="
80                 + activationSpec + "}";
81      }
82  }