KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > providers > SingleAttemptConnectionStrategy


1 /*
2  * $Id: SingleAttemptConnectionStrategy.java 3798 2006-11-04 04:07:14Z aperepel $
3  * --------------------------------------------------------------------------------------
4  * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
5  *
6  * The software in this package is published under the terms of the MuleSource MPL
7  * license, a copy of which has been included with this distribution in the
8  * LICENSE.txt file.
9  */

10
11 package org.mule.providers;
12
13 import org.mule.config.i18n.Message;
14 import org.mule.config.i18n.Messages;
15 import org.mule.umo.provider.UMOConnectable;
16
17 /**
18  * Attempts to make a connection once and fails if there is an exception
19  *
20  * @author <a HREF="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
21  * @version $Revision: 3798 $
22  */

23 public class SingleAttemptConnectionStrategy extends AbstractConnectionStrategy
24 {
25     public void doConnect(UMOConnectable connectable) throws FatalConnectException
26     {
27         try
28         {
29             connectable.connect();
30         }
31         catch (Exception JavaDoc e)
32         {
33             throw new FatalConnectException(new Message(Messages.RECONNECT_STRATEGY_X_FAILED_ENDPOINT_X,
34                 getClass().getName(), getDescription(connectable)), e, connectable);
35
36         }
37     }
38
39     /**
40      * Resets any state stored in the retry strategy
41      */

42     public void resetState()
43     {
44         // no op
45
}
46 }
47
Popular Tags