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