1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
package org.mule.config; |
8 | |
|
9 | |
import org.mule.api.MuleContext; |
10 | |
import org.mule.api.config.MuleConfiguration; |
11 | |
import org.mule.api.config.MuleProperties; |
12 | |
import org.mule.api.context.MuleContextAware; |
13 | |
import org.mule.api.lifecycle.FatalException; |
14 | |
import org.mule.api.lifecycle.Initialisable; |
15 | |
import org.mule.api.lifecycle.Startable; |
16 | |
import org.mule.config.i18n.CoreMessages; |
17 | |
import org.mule.util.FileUtils; |
18 | |
import org.mule.util.NumberUtils; |
19 | |
import org.mule.util.StringUtils; |
20 | |
import org.mule.util.UUID; |
21 | |
|
22 | |
import java.io.File; |
23 | |
import java.io.IOException; |
24 | |
import java.net.InetAddress; |
25 | |
import java.net.UnknownHostException; |
26 | |
import java.nio.charset.Charset; |
27 | |
import java.util.HashMap; |
28 | |
import java.util.Map; |
29 | |
|
30 | |
import javax.xml.parsers.SAXParserFactory; |
31 | |
|
32 | |
import org.apache.commons.lang.BooleanUtils; |
33 | |
import org.apache.commons.logging.Log; |
34 | |
import org.apache.commons.logging.LogFactory; |
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
public class DefaultMuleConfiguration implements MuleConfiguration, MuleContextAware |
41 | |
{ |
42 | |
|
43 | 0 | public static final String[] DEFAULT_STACKTRACE_FILTER = ( |
44 | |
"org.mule.processor.AbstractInterceptingMessageProcessor," + |
45 | |
"org.mule.processor.chain") |
46 | |
.split(","); |
47 | |
|
48 | |
|
49 | |
|
50 | |
|
51 | |
|
52 | 0 | public static boolean fullStackTraces = false; |
53 | |
|
54 | |
|
55 | |
|
56 | |
|
57 | |
|
58 | |
|
59 | 0 | public static boolean verboseExceptions = false; |
60 | |
|
61 | |
|
62 | |
|
63 | |
|
64 | |
|
65 | |
|
66 | 0 | public static String[] stackTraceFilter = DEFAULT_STACKTRACE_FILTER; |
67 | |
|
68 | 0 | private boolean synchronous = false; |
69 | |
|
70 | |
|
71 | |
|
72 | |
|
73 | |
|
74 | 0 | private String systemModelType = "seda"; |
75 | |
|
76 | 0 | private String encoding = "UTF-8"; |
77 | |
|
78 | |
|
79 | |
|
80 | |
|
81 | |
|
82 | 0 | private int responseTimeout = 10000; |
83 | |
|
84 | |
|
85 | |
|
86 | |
|
87 | |
|
88 | 0 | private int defaultTransactionTimeout = 30000; |
89 | |
|
90 | |
|
91 | |
|
92 | |
|
93 | 0 | private int defaultQueueTimeout = 200; |
94 | |
|
95 | |
|
96 | |
|
97 | |
|
98 | |
|
99 | 0 | private int shutdownTimeout = 5000; |
100 | |
|
101 | |
|
102 | |
|
103 | |
|
104 | |
|
105 | |
|
106 | |
|
107 | 0 | private String workingDirectory = "./.mule"; |
108 | |
|
109 | |
|
110 | |
|
111 | |
|
112 | |
|
113 | 0 | private boolean clientMode = false; |
114 | |
|
115 | |
|
116 | |
private String id; |
117 | |
|
118 | |
|
119 | |
private String clusterId; |
120 | |
|
121 | |
|
122 | |
private String domainId; |
123 | |
|
124 | |
|
125 | |
|
126 | 0 | private boolean cacheMessageAsBytes = true; |
127 | |
|
128 | 0 | private boolean cacheMessageOriginalPayload = true; |
129 | |
|
130 | 0 | private boolean enableStreaming = true; |
131 | |
|
132 | 0 | private boolean autoWrapMessageAwareTransform = true; |
133 | |
|
134 | 0 | protected transient Log logger = LogFactory.getLog(DefaultMuleConfiguration.class); |
135 | |
|
136 | |
private MuleContext muleContext; |
137 | |
private boolean containerMode; |
138 | |
|
139 | |
|
140 | |
|
141 | |
|
142 | |
|
143 | |
|
144 | |
|
145 | 0 | private boolean validateExpressions = true; |
146 | |
|
147 | |
|
148 | |
|
149 | |
|
150 | |
|
151 | 0 | private Map<String, String> extendedProperties = new HashMap<String, String>(); |
152 | |
|
153 | |
public DefaultMuleConfiguration() |
154 | |
{ |
155 | 0 | this(false); |
156 | 0 | } |
157 | |
|
158 | |
public DefaultMuleConfiguration(boolean containerMode) |
159 | 0 | { |
160 | 0 | this.containerMode = containerMode; |
161 | |
|
162 | |
|
163 | 0 | applySystemProperties(); |
164 | |
|
165 | 0 | if (id == null) |
166 | |
{ |
167 | 0 | id = UUID.getUUID(); |
168 | |
} |
169 | |
|
170 | 0 | if (clusterId == null) |
171 | |
{ |
172 | 0 | clusterId = CoreMessages.notClustered().getMessage(); |
173 | |
} |
174 | |
|
175 | 0 | if (domainId == null) |
176 | |
{ |
177 | |
try |
178 | |
{ |
179 | 0 | domainId = InetAddress.getLocalHost().getHostName(); |
180 | |
} |
181 | 0 | catch (UnknownHostException e) |
182 | |
{ |
183 | 0 | logger.warn(e); |
184 | 0 | domainId = "org.mule"; |
185 | 0 | } |
186 | |
} |
187 | |
|
188 | |
try |
189 | |
{ |
190 | 0 | validateEncoding(); |
191 | 0 | validateXML(); |
192 | |
} |
193 | 0 | catch (FatalException e) |
194 | |
{ |
195 | 0 | throw new RuntimeException(e); |
196 | 0 | } |
197 | 0 | } |
198 | |
|
199 | |
public void setMuleContext(MuleContext context) |
200 | |
{ |
201 | 0 | this.muleContext = context; |
202 | 0 | if (containerMode) |
203 | |
{ |
204 | 0 | final String muleHome = System.getProperty("mule.home"); |
205 | |
|
206 | 0 | if (!isStandalone()) { |
207 | |
|
208 | 0 | this.workingDirectory = String.format("%s/%s", getWorkingDirectory(), getId()); |
209 | |
} |
210 | |
else |
211 | |
{ |
212 | 0 | this.workingDirectory = String.format("%s/%s/%s", muleHome.trim(), getWorkingDirectory(), getId()); |
213 | |
} |
214 | 0 | } |
215 | 0 | else if (isStandalone()) |
216 | |
{ |
217 | 0 | this.workingDirectory = String.format("%s/%s", getWorkingDirectory(), getId()); |
218 | |
} |
219 | 0 | } |
220 | |
|
221 | |
|
222 | |
|
223 | |
|
224 | |
protected void applySystemProperties() |
225 | |
{ |
226 | |
String p; |
227 | |
|
228 | 0 | p = System.getProperty(MuleProperties.MULE_ENCODING_SYSTEM_PROPERTY); |
229 | 0 | if (p != null) |
230 | |
{ |
231 | 0 | encoding = p; |
232 | |
} |
233 | |
else |
234 | |
{ |
235 | 0 | System.setProperty(MuleProperties.MULE_ENCODING_SYSTEM_PROPERTY, encoding); |
236 | |
} |
237 | 0 | p = System.getProperty(MuleProperties.SYSTEM_PROPERTY_PREFIX + "endpoints.synchronous"); |
238 | 0 | if (p != null) |
239 | |
{ |
240 | 0 | synchronous = BooleanUtils.toBoolean(p); |
241 | |
} |
242 | 0 | p = System.getProperty(MuleProperties.SYSTEM_PROPERTY_PREFIX + "systemModelType"); |
243 | 0 | if (p != null) |
244 | |
{ |
245 | 0 | systemModelType = p; |
246 | |
} |
247 | 0 | p = System.getProperty(MuleProperties.SYSTEM_PROPERTY_PREFIX + "timeout.synchronous"); |
248 | 0 | if (p != null) |
249 | |
{ |
250 | 0 | responseTimeout = NumberUtils.toInt(p); |
251 | |
} |
252 | 0 | p = System.getProperty(MuleProperties.SYSTEM_PROPERTY_PREFIX + "timeout.transaction"); |
253 | 0 | if (p != null) |
254 | |
{ |
255 | 0 | defaultTransactionTimeout = NumberUtils.toInt(p); |
256 | |
} |
257 | |
|
258 | 0 | p = System.getProperty(MuleProperties.SYSTEM_PROPERTY_PREFIX + "workingDirectory"); |
259 | 0 | if (p != null) |
260 | |
{ |
261 | 0 | workingDirectory = p; |
262 | |
} |
263 | 0 | p = System.getProperty(MuleProperties.SYSTEM_PROPERTY_PREFIX + "clientMode"); |
264 | 0 | if (p != null) |
265 | |
{ |
266 | 0 | clientMode = BooleanUtils.toBoolean(p); |
267 | |
} |
268 | 0 | p = System.getProperty(MuleProperties.SYSTEM_PROPERTY_PREFIX + "serverId"); |
269 | 0 | if (p != null) |
270 | |
{ |
271 | 0 | id = p; |
272 | |
} |
273 | 0 | p = System.getProperty(MuleProperties.SYSTEM_PROPERTY_PREFIX + "clusterId"); |
274 | 0 | if (p != null) |
275 | |
{ |
276 | 0 | clusterId = p; |
277 | |
} |
278 | 0 | p = System.getProperty(MuleProperties.SYSTEM_PROPERTY_PREFIX + "domainId"); |
279 | 0 | if (p != null) |
280 | |
{ |
281 | 0 | domainId = p; |
282 | |
} |
283 | 0 | p = System.getProperty(MuleProperties.SYSTEM_PROPERTY_PREFIX + "message.cacheBytes"); |
284 | 0 | if (p != null) |
285 | |
{ |
286 | 0 | cacheMessageAsBytes = BooleanUtils.toBoolean(p); |
287 | |
} |
288 | 0 | p = System.getProperty(MuleProperties.SYSTEM_PROPERTY_PREFIX + "message.cacheOriginal"); |
289 | 0 | if (p != null) |
290 | |
{ |
291 | 0 | cacheMessageOriginalPayload = BooleanUtils.toBoolean(p); |
292 | |
} |
293 | 0 | p = System.getProperty(MuleProperties.SYSTEM_PROPERTY_PREFIX + "streaming.enable"); |
294 | 0 | if (p != null) |
295 | |
{ |
296 | 0 | enableStreaming = BooleanUtils.toBoolean(p); |
297 | |
} |
298 | 0 | p = System.getProperty(MuleProperties.SYSTEM_PROPERTY_PREFIX + "transform.autoWrap"); |
299 | 0 | if (p != null) |
300 | |
{ |
301 | 0 | autoWrapMessageAwareTransform = BooleanUtils.toBoolean(p); |
302 | |
} |
303 | 0 | p = System.getProperty(MuleProperties.SYSTEM_PROPERTY_PREFIX + "stacktrace.full"); |
304 | 0 | if (p != null) |
305 | |
{ |
306 | 0 | fullStackTraces = false; |
307 | |
} |
308 | 0 | p = System.getProperty(MuleProperties.SYSTEM_PROPERTY_PREFIX + "stacktrace.filter"); |
309 | 0 | if (p != null) |
310 | |
{ |
311 | 0 | stackTraceFilter = p.split(","); |
312 | |
} |
313 | |
|
314 | 0 | p = System.getProperty(MuleProperties.SYSTEM_PROPERTY_PREFIX + "verbose.exceptions"); |
315 | 0 | if (p != null) |
316 | |
{ |
317 | 0 | verboseExceptions = BooleanUtils.toBoolean(p); |
318 | |
} |
319 | |
else |
320 | |
{ |
321 | 0 | verboseExceptions = logger.isDebugEnabled(); |
322 | |
} |
323 | |
|
324 | 0 | p = System.getProperty(MuleProperties.SYSTEM_PROPERTY_PREFIX + "validate.expressions"); |
325 | 0 | if (p != null) |
326 | |
{ |
327 | 0 | validateExpressions = Boolean.valueOf(p); |
328 | |
} |
329 | 0 | } |
330 | |
|
331 | |
protected void validateEncoding() throws FatalException |
332 | |
{ |
333 | |
|
334 | 0 | if (!Charset.isSupported(encoding)) |
335 | |
{ |
336 | 0 | throw new FatalException(CoreMessages.propertyHasInvalidValue("encoding", encoding), this); |
337 | |
} |
338 | 0 | } |
339 | |
|
340 | |
|
341 | |
|
342 | |
|
343 | |
|
344 | |
|
345 | |
|
346 | |
|
347 | |
|
348 | |
|
349 | |
|
350 | |
protected void validateXML() throws FatalException |
351 | |
{ |
352 | 0 | SAXParserFactory f = SAXParserFactory.newInstance(); |
353 | 0 | if (f == null || f.getClass().getName().indexOf("crimson") != -1) |
354 | |
{ |
355 | 0 | throw new FatalException(CoreMessages.valueIsInvalidFor(f.getClass().getName(), |
356 | |
"javax.xml.parsers.SAXParserFactory"), this); |
357 | |
} |
358 | 0 | } |
359 | |
|
360 | |
public void setDefaultSynchronousEndpoints(boolean synchronous) |
361 | |
{ |
362 | 0 | if (verifyContextNotStarted()) |
363 | |
{ |
364 | 0 | this.synchronous = synchronous; |
365 | |
} |
366 | 0 | } |
367 | |
|
368 | |
public int getDefaultResponseTimeout() |
369 | |
{ |
370 | 0 | return responseTimeout; |
371 | |
} |
372 | |
|
373 | |
public void setDefaultResponseTimeout(int responseTimeout) |
374 | |
{ |
375 | 0 | if (verifyContextNotStarted()) |
376 | |
{ |
377 | 0 | this.responseTimeout = responseTimeout; |
378 | |
} |
379 | 0 | } |
380 | |
|
381 | |
public String getWorkingDirectory() |
382 | |
{ |
383 | 0 | return workingDirectory; |
384 | |
} |
385 | |
|
386 | |
public String getMuleHomeDirectory() |
387 | |
{ |
388 | 0 | return System.getProperty(MuleProperties.MULE_HOME_DIRECTORY_PROPERTY); |
389 | |
} |
390 | |
|
391 | |
public void setWorkingDirectory(String workingDirectory) |
392 | |
{ |
393 | 0 | if (verifyContextNotInitialized()) |
394 | |
{ |
395 | |
try |
396 | |
{ |
397 | 0 | File canonicalFile = FileUtils.openDirectory(workingDirectory); |
398 | 0 | this.workingDirectory = canonicalFile.getCanonicalPath(); |
399 | |
} |
400 | 0 | catch (IOException e) |
401 | |
{ |
402 | 0 | throw new IllegalArgumentException(CoreMessages.initialisationFailure( |
403 | |
"Invalid working directory").getMessage(), e); |
404 | 0 | } |
405 | |
} |
406 | 0 | } |
407 | |
|
408 | |
public int getDefaultTransactionTimeout() |
409 | |
{ |
410 | 0 | return defaultTransactionTimeout; |
411 | |
} |
412 | |
|
413 | |
public void setDefaultTransactionTimeout(int defaultTransactionTimeout) |
414 | |
{ |
415 | 0 | if (verifyContextNotStarted()) |
416 | |
{ |
417 | 0 | this.defaultTransactionTimeout = defaultTransactionTimeout; |
418 | |
} |
419 | 0 | } |
420 | |
|
421 | |
|
422 | |
public boolean isValidateExpressions() |
423 | |
{ |
424 | 0 | return validateExpressions; |
425 | |
} |
426 | |
|
427 | |
public boolean isClientMode() |
428 | |
{ |
429 | 0 | return clientMode; |
430 | |
} |
431 | |
|
432 | |
public String getDefaultEncoding() |
433 | |
{ |
434 | 0 | return encoding; |
435 | |
} |
436 | |
|
437 | |
public void setDefaultEncoding(String encoding) |
438 | |
{ |
439 | 0 | if (verifyContextNotInitialized()) |
440 | |
{ |
441 | 0 | this.encoding = encoding; |
442 | |
} |
443 | 0 | } |
444 | |
|
445 | |
public String getId() |
446 | |
{ |
447 | 0 | return id; |
448 | |
} |
449 | |
|
450 | |
public void setId(String id) |
451 | |
{ |
452 | 0 | if (verifyContextNotInitialized()) |
453 | |
{ |
454 | 0 | if (StringUtils.isBlank(id)) |
455 | |
{ |
456 | 0 | throw new IllegalArgumentException("Cannot set server id to null/blank"); |
457 | |
} |
458 | 0 | this.id = id; |
459 | |
} |
460 | 0 | } |
461 | |
|
462 | |
public String getClusterId() |
463 | |
{ |
464 | 0 | return clusterId; |
465 | |
} |
466 | |
|
467 | |
public void setClusterId(String clusterId) |
468 | |
{ |
469 | 0 | if (verifyContextNotInitialized()) |
470 | |
{ |
471 | 0 | this.clusterId = clusterId; |
472 | |
} |
473 | 0 | } |
474 | |
|
475 | |
public String getDomainId() |
476 | |
{ |
477 | 0 | return domainId; |
478 | |
} |
479 | |
|
480 | |
public void setDomainId(String domainId) |
481 | |
{ |
482 | 0 | if (verifyContextNotInitialized()) |
483 | |
{ |
484 | 0 | this.domainId = domainId; |
485 | |
} |
486 | 0 | } |
487 | |
|
488 | |
public String getSystemModelType() |
489 | |
{ |
490 | 0 | return systemModelType; |
491 | |
} |
492 | |
|
493 | |
public void setSystemModelType(String systemModelType) |
494 | |
{ |
495 | 0 | if (verifyContextNotStarted()) |
496 | |
{ |
497 | 0 | this.systemModelType = systemModelType; |
498 | |
} |
499 | 0 | } |
500 | |
|
501 | |
public void setClientMode(boolean clientMode) |
502 | |
{ |
503 | 0 | if (verifyContextNotStarted()) |
504 | |
{ |
505 | 0 | this.clientMode = clientMode; |
506 | |
} |
507 | 0 | } |
508 | |
|
509 | |
public String getSystemName() |
510 | |
{ |
511 | 0 | return domainId + "." + clusterId + "." + id; |
512 | |
} |
513 | |
|
514 | |
public boolean isAutoWrapMessageAwareTransform() |
515 | |
{ |
516 | 0 | return autoWrapMessageAwareTransform; |
517 | |
} |
518 | |
|
519 | |
public void setAutoWrapMessageAwareTransform(boolean autoWrapMessageAwareTransform) |
520 | |
{ |
521 | 0 | if (verifyContextNotStarted()) |
522 | |
{ |
523 | 0 | this.autoWrapMessageAwareTransform = autoWrapMessageAwareTransform; |
524 | |
} |
525 | 0 | } |
526 | |
|
527 | |
public boolean isCacheMessageAsBytes() |
528 | |
{ |
529 | 0 | return cacheMessageAsBytes; |
530 | |
} |
531 | |
|
532 | |
public void setCacheMessageAsBytes(boolean cacheMessageAsBytes) |
533 | |
{ |
534 | 0 | if (verifyContextNotStarted()) |
535 | |
{ |
536 | 0 | this.cacheMessageAsBytes = cacheMessageAsBytes; |
537 | |
} |
538 | 0 | } |
539 | |
|
540 | |
public boolean isCacheMessageOriginalPayload() |
541 | |
{ |
542 | 0 | return cacheMessageOriginalPayload; |
543 | |
} |
544 | |
|
545 | |
public void setCacheMessageOriginalPayload(boolean cacheMessageOriginalPayload) |
546 | |
{ |
547 | 0 | if (verifyContextNotStarted()) |
548 | |
{ |
549 | 0 | this.cacheMessageOriginalPayload = cacheMessageOriginalPayload; |
550 | |
} |
551 | 0 | } |
552 | |
|
553 | |
public boolean isEnableStreaming() |
554 | |
{ |
555 | 0 | return enableStreaming; |
556 | |
} |
557 | |
|
558 | |
public void setEnableStreaming(boolean enableStreaming) |
559 | |
{ |
560 | 0 | if (verifyContextNotStarted()) |
561 | |
{ |
562 | 0 | this.enableStreaming = enableStreaming; |
563 | |
} |
564 | 0 | } |
565 | |
|
566 | |
protected boolean verifyContextNotInitialized() |
567 | |
{ |
568 | 0 | if (muleContext != null && muleContext.getLifecycleManager().isPhaseComplete(Initialisable.PHASE_NAME)) |
569 | |
{ |
570 | 0 | logger.warn("Cannot modify MuleConfiguration once the MuleContext has been initialized. Modification will be ignored."); |
571 | 0 | return false; |
572 | |
} |
573 | |
else |
574 | |
{ |
575 | 0 | return true; |
576 | |
} |
577 | |
} |
578 | |
|
579 | |
protected boolean verifyContextNotStarted() |
580 | |
{ |
581 | 0 | if (muleContext != null && muleContext.getLifecycleManager().isPhaseComplete(Startable.PHASE_NAME)) |
582 | |
{ |
583 | 0 | logger.warn("Cannot modify MuleConfiguration once the MuleContext has been started. Modification will be ignored."); |
584 | 0 | return false; |
585 | |
} |
586 | |
else |
587 | |
{ |
588 | 0 | return true; |
589 | |
} |
590 | |
} |
591 | |
|
592 | |
public int getDefaultQueueTimeout() |
593 | |
{ |
594 | 0 | return defaultQueueTimeout; |
595 | |
} |
596 | |
|
597 | |
public void setDefaultQueueTimeout(int defaultQueueTimeout) |
598 | |
{ |
599 | 0 | if (verifyContextNotStarted()) |
600 | |
{ |
601 | 0 | this.defaultQueueTimeout = defaultQueueTimeout; |
602 | |
} |
603 | 0 | } |
604 | |
|
605 | |
public int getShutdownTimeout() |
606 | |
{ |
607 | 0 | return shutdownTimeout; |
608 | |
} |
609 | |
|
610 | |
public void setShutdownTimeout(int shutdownTimeout) |
611 | |
{ |
612 | 0 | if (verifyContextNotStarted()) |
613 | |
{ |
614 | 0 | this.shutdownTimeout = shutdownTimeout; |
615 | |
} |
616 | 0 | } |
617 | |
|
618 | |
public boolean isContainerMode() |
619 | |
{ |
620 | 0 | return this.containerMode; |
621 | |
} |
622 | |
|
623 | |
|
624 | |
|
625 | |
|
626 | |
public void setContainerMode(boolean containerMode) |
627 | |
{ |
628 | 0 | if (verifyContextNotInitialized()) |
629 | |
{ |
630 | 0 | this.containerMode = containerMode; |
631 | |
} |
632 | 0 | } |
633 | |
|
634 | |
public boolean isStandalone() |
635 | |
{ |
636 | |
|
637 | 0 | return getMuleHomeDirectory() != null; |
638 | |
} |
639 | |
|
640 | |
public Map<String, String> getExtendedProperties() |
641 | |
{ |
642 | 0 | return extendedProperties; |
643 | |
} |
644 | |
|
645 | |
public void setExtendedProperties(Map<String, String> extendedProperties) |
646 | |
{ |
647 | 0 | this.extendedProperties = extendedProperties; |
648 | 0 | } |
649 | |
|
650 | |
public void setExtendedProperty(String name, String value) |
651 | |
{ |
652 | 0 | this.extendedProperties.put(name, value); |
653 | 0 | } |
654 | |
|
655 | |
public String getExtendedProperty(String name) |
656 | |
{ |
657 | 0 | return this.extendedProperties.get(name); |
658 | |
} |
659 | |
|
660 | |
@Override |
661 | |
public int hashCode() |
662 | |
{ |
663 | 0 | final int prime = 31; |
664 | 0 | int result = 1; |
665 | 0 | result = prime * result + (autoWrapMessageAwareTransform ? 1231 : 1237); |
666 | 0 | result = prime * result + (cacheMessageAsBytes ? 1231 : 1237); |
667 | 0 | result = prime * result + (cacheMessageOriginalPayload ? 1231 : 1237); |
668 | 0 | result = prime * result + (clientMode ? 1231 : 1237); |
669 | 0 | result = prime * result + ((clusterId == null) ? 0 : clusterId.hashCode()); |
670 | 0 | result = prime * result + defaultQueueTimeout; |
671 | 0 | result = prime * result + defaultTransactionTimeout; |
672 | 0 | result = prime * result + ((domainId == null) ? 0 : domainId.hashCode()); |
673 | 0 | result = prime * result + (enableStreaming ? 1231 : 1237); |
674 | 0 | result = prime * result + ((encoding == null) ? 0 : encoding.hashCode()); |
675 | 0 | result = prime * result + ((id == null) ? 0 : id.hashCode()); |
676 | 0 | result = prime * result + responseTimeout; |
677 | 0 | result = prime * result + shutdownTimeout; |
678 | 0 | result = prime * result + (synchronous ? 1231 : 1237); |
679 | 0 | result = prime * result + ((systemModelType == null) ? 0 : systemModelType.hashCode()); |
680 | 0 | result = prime * result + ((workingDirectory == null) ? 0 : workingDirectory.hashCode()); |
681 | 0 | result = prime * result + (containerMode ? 1231 : 1237); |
682 | 0 | return result; |
683 | |
} |
684 | |
|
685 | |
@Override |
686 | |
public boolean equals(Object obj) |
687 | |
{ |
688 | 0 | if (this == obj) return true; |
689 | 0 | if (obj == null) return false; |
690 | 0 | if (getClass() != obj.getClass()) return false; |
691 | 0 | DefaultMuleConfiguration other = (DefaultMuleConfiguration) obj; |
692 | 0 | if (autoWrapMessageAwareTransform != other.autoWrapMessageAwareTransform) return false; |
693 | 0 | if (cacheMessageAsBytes != other.cacheMessageAsBytes) return false; |
694 | 0 | if (cacheMessageOriginalPayload != other.cacheMessageOriginalPayload) return false; |
695 | 0 | if (clientMode != other.clientMode) return false; |
696 | 0 | if (clusterId == null) |
697 | |
{ |
698 | 0 | if (other.clusterId != null) return false; |
699 | |
} |
700 | 0 | else if (!clusterId.equals(other.clusterId)) return false; |
701 | 0 | if (defaultQueueTimeout != other.defaultQueueTimeout) return false; |
702 | 0 | if (defaultTransactionTimeout != other.defaultTransactionTimeout) return false; |
703 | 0 | if (domainId == null) |
704 | |
{ |
705 | 0 | if (other.domainId != null) return false; |
706 | |
} |
707 | 0 | else if (!domainId.equals(other.domainId)) return false; |
708 | 0 | if (enableStreaming != other.enableStreaming) return false; |
709 | 0 | if (encoding == null) |
710 | |
{ |
711 | 0 | if (other.encoding != null) return false; |
712 | |
} |
713 | 0 | else if (!encoding.equals(other.encoding)) return false; |
714 | 0 | if (id == null) |
715 | |
{ |
716 | 0 | if (other.id != null) return false; |
717 | |
} |
718 | 0 | else if (!id.equals(other.id)) return false; |
719 | 0 | if (responseTimeout != other.responseTimeout) return false; |
720 | 0 | if (shutdownTimeout != other.shutdownTimeout) return false; |
721 | 0 | if (synchronous != other.synchronous) return false; |
722 | 0 | if (systemModelType == null) |
723 | |
{ |
724 | 0 | if (other.systemModelType != null) return false; |
725 | |
} |
726 | 0 | else if (!systemModelType.equals(other.systemModelType)) return false; |
727 | 0 | if (workingDirectory == null) |
728 | |
{ |
729 | 0 | if (other.workingDirectory != null) return false; |
730 | |
} |
731 | 0 | else if (!workingDirectory.equals(other.workingDirectory)) return false; |
732 | |
|
733 | 0 | if (containerMode != other.containerMode) return false; |
734 | |
|
735 | 0 | return true; |
736 | |
} |
737 | |
|
738 | |
} |