|
1 | 1 | /* |
2 | | - * Copyright 2002-2008 the original author or authors. |
| 2 | + * Copyright 2002-2013 the original author or authors. |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
|
33 | 33 | import org.springframework.context.ConfigurableApplicationContext; |
34 | 34 | import org.springframework.core.env.ConfigurableEnvironment; |
35 | 35 | import org.springframework.core.env.StandardEnvironment; |
| 36 | +import org.springframework.util.ObjectUtils; |
36 | 37 | import org.springframework.util.StringUtils; |
37 | 38 |
|
38 | 39 | /** |
|
87 | 88 | * Note that "META-INF/applicationContext.xml" is the default context config |
88 | 89 | * location, so it doesn't have to specified unless you intend to specify |
89 | 90 | * different/additional config files. So in the default case, you may remove |
90 | | - * the entire <code>config-property</code> section above. |
| 91 | + * the entire {@code config-property} section above. |
91 | 92 | * |
92 | 93 | * <p><b>For simple deployment needs, all you need to do is the following:</b> |
93 | 94 | * Package all application classes into a RAR file (which is just a standard |
@@ -222,10 +223,23 @@ public void endpointDeactivation(MessageEndpointFactory messageEndpointFactory, |
222 | 223 | } |
223 | 224 |
|
224 | 225 | /** |
225 | | - * This implementation always returns <code>null</code>. |
| 226 | + * This implementation always returns {@code null}. |
226 | 227 | */ |
227 | 228 | public XAResource[] getXAResources(ActivationSpec[] activationSpecs) throws ResourceException { |
228 | 229 | return null; |
229 | 230 | } |
230 | 231 |
|
| 232 | + |
| 233 | + @Override |
| 234 | + public boolean equals(Object obj) { |
| 235 | + return (obj instanceof SpringContextResourceAdapter && |
| 236 | + ObjectUtils.nullSafeEquals(getContextConfigLocation(), |
| 237 | + ((SpringContextResourceAdapter) obj).getContextConfigLocation())); |
| 238 | + } |
| 239 | + |
| 240 | + @Override |
| 241 | + public int hashCode() { |
| 242 | + return ObjectUtils.nullSafeHashCode(getContextConfigLocation()); |
| 243 | + } |
| 244 | + |
231 | 245 | } |
0 commit comments