KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > ubik > rmi > server > transport > socket > SocketRmiConnectionFactory


1 package org.sapia.ubik.rmi.server.transport.socket;
2
3 import java.io.IOException JavaDoc;
4 import java.net.Socket JavaDoc;
5
6 import org.sapia.ubik.net.Connection;
7 import org.sapia.ubik.net.SocketConnectionFactory;
8
9
10 /**
11  * Implements a factory of <code>SocketRmiConnection</code> instances.
12  *
13  * @author Yanick Duchesne
14  * <dl>
15  * <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>
16  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
17  * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt>
18  * </dl>
19  */

20 public class SocketRmiConnectionFactory extends SocketConnectionFactory {
21   /**
22    * Constructor for RMIConnectionFactory.
23    */

24   public SocketRmiConnectionFactory() {
25     super();
26   }
27
28   /**
29    * @see org.sapia.ubik.net.SocketConnectionFactory#newConnection(Socket)
30    */

31   public Connection newConnection(Socket JavaDoc sock) throws IOException JavaDoc {
32     SocketRmiConnection conn = new SocketRmiConnection(sock, _loader);
33
34     return conn;
35   }
36
37   /**
38    * @see org.sapia.ubik.net.SocketConnectionFactory#newConnection(String, int)
39    */

40   public Connection newConnection(String JavaDoc host, int port)
41     throws IOException JavaDoc {
42     SocketRmiConnection conn = new SocketRmiConnection(new Socket JavaDoc(host, port),
43         _loader);
44
45     return conn;
46   }
47 }
48
Popular Tags