01: /*
02: * $Id: Connectable.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.api.transport;
12:
13: /**
14: * Interface for objects that should connect to a resource.
15: */
16: public interface Connectable {
17:
18: /**
19: * Make the connection to the underlying transport. The fact that this object is
20: * connected or not should have no influence on the lifecycle, especially the
21: * start / stop state if applicable.
22: *
23: * @throws Exception
24: */
25: void connect() throws Exception;
26:
27: /**
28: * Disconnect the from the underlying transport
29: *
30: * @throws Exception
31: */
32: void disconnect() throws Exception;
33:
34: /**
35: * Determines if this object is connected or not
36: *
37: * @return
38: */
39: boolean isConnected();
40:
41: /**
42: * Returns a string identifying the underlying resource
43: *
44: * @return
45: */
46: String getConnectionDescription();
47: }
|