KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mx4j > tools > remote > rmi > SSLRMIClientSocketFactory


1 /*
2  * Copyright (C) The MX4J Contributors.
3  * All rights reserved.
4  *
5  * This software is distributed under the terms of the MX4J License version 1.0.
6  * See the terms of the MX4J License in the documentation provided with this software.
7  */

8
9 package mx4j.tools.remote.rmi;
10
11 import java.io.IOException JavaDoc;
12 import java.io.Serializable JavaDoc;
13 import java.net.Socket JavaDoc;
14 import java.rmi.server.RMIClientSocketFactory JavaDoc;
15 import javax.net.ssl.SSLSocketFactory;
16
17 /**
18  * @version $Revision: 1.3 $
19  */

20 public class SSLRMIClientSocketFactory implements RMIClientSocketFactory JavaDoc, Serializable JavaDoc
21 {
22    public Socket JavaDoc createSocket(String JavaDoc host, int port) throws IOException JavaDoc
23    {
24       return SSLSocketFactory.getDefault().createSocket(host, port);
25    }
26
27    public boolean equals(Object JavaDoc obj)
28    {
29       if (obj == null) return false;
30       if (this == obj) return true;
31       return getClass() == obj.getClass();
32    }
33
34    public int hashCode()
35    {
36       return 13;
37    }
38 }
39
Popular Tags