1 /* 2 * $Id: Connectable.java 10489 2008-01-23 17:53:38Z dfeist $ 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 CPAL v1.0 7 * license, a copy of which has been included with this distribution in the 8 * LICENSE.txt file. 9 */ 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 /** 20 * Make the connection to the underlying transport. The fact that this object is 21 * connected or not should have no influence on the lifecycle, especially the 22 * start / stop state if applicable. 23 * 24 * @throws Exception 25 */ 26 void connect() throws Exception; 27 28 /** 29 * Disconnect the from the underlying transport 30 * 31 * @throws Exception 32 */ 33 void disconnect() throws Exception; 34 35 /** 36 * Determines if this object is connected or not 37 * 38 * @return 39 */ 40 boolean isConnected(); 41 42 /** 43 * Returns a string identifying the underlying resource 44 * 45 * @return 46 */ 47 String getConnectionDescription(); 48 }