KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > ubik > net > ConnectionFactory


1 package org.sapia.ubik.net;
2
3 import java.io.IOException JavaDoc;
4
5
6 /**
7  * This interface specifies the behavior of a factory of <code>Connection</code>
8  * instances.
9  *
10  * @author Yanick Duchesne
11  * <dl>
12  * <dt><b>Copyright:</b><dd>Copyright &#169; 2002-2003 <a HREF="http://www.sapia-oss.org">Sapia Open Source Software</a>. All Rights Reserved.</dd></dt>
13  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
14  * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt>
15  * </dl>
16  */

17 public interface ConnectionFactory {
18   /**
19    * Returns a client <code>Connection</code> instance that connects to the
20    * server at the given host and port.
21    *
22    * @param host the host to connect to.
23    * @param port the port on which the server is listening at the given host.
24    * @throws IOException if the connection instance could not be created.
25    */

26   public Connection newConnection(String JavaDoc host, int port)
27     throws IOException JavaDoc;
28
29   /**
30    * Returns a <code>Connection</code> instance that should wrap the given
31    * <code>Socket</code> instance. The latter can be a client-side socket, are
32    * an instance that is returned by <code>ServerSocket.accept()</code>
33    * method on the server-side.
34    *
35    * @param sock a <code>Socket</code> instance.
36    * @throws IOException if the connection instance could not be created.
37    */

38
39   // public Connection newConnection(java.net.Socket sock)
40
// throws IOException, UnsupportedOperationException;
41
}
42
Popular Tags