01: /*
02: * $Id: SingleAttemptConnectionStrategy.java 10489 2008-01-23 17:53:38Z 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.transport;
12:
13: import org.mule.api.transport.Connectable;
14: import org.mule.config.i18n.CoreMessages;
15:
16: /**
17: * Attempts to make a connection once and fails if there is an exception
18: */
19: public class SingleAttemptConnectionStrategy extends
20: AbstractConnectionStrategy {
21: public void doConnect(Connectable connectable)
22: throws FatalConnectException {
23: try {
24: connectable.connect();
25: } catch (Exception e) {
26: throw new FatalConnectException(CoreMessages
27: .reconnectStrategyFailed(this .getClass(), this
28: .getDescription(connectable)), e,
29: connectable);
30:
31: }
32: }
33:
34: /**
35: * Resets any state stored in the retry strategy
36: */
37: public void resetState() {
38: // no op
39: }
40: }
|