KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > SOFA > Connector > CCNSAccess


1 /*
2  * CCNSAccess.java
3  *
4  * Created on 7. duben 2002, 10:23
5  */

6
7 package SOFA.Connector.CCNSAccess;
8
9 import java.rmi.Naming JavaDoc;
10
11 /**
12  *
13  * @author ghort
14  * @version
15  */

16 public class CCNSAccess {
17
18     public static SOFA.SOFAnode.Run.CCNS.ConnectorCacheNS openCCNS() throws CCNSAccessException {
19         try {
20             System.setSecurityManager(new java.rmi.RMISecurityManager JavaDoc());
21             String JavaDoc rmiport = System.getProperty("sofa.rmiport","1999");
22             String JavaDoc rmihost = System.getProperty("sofa.rmihost","localhost");
23             
24       String JavaDoc rminame="//"+rmihost+":"+rmiport+"/CCNS";
25             return (SOFA.SOFAnode.Run.CCNS.ConnectorCacheNS)Naming.lookup(rminame);
26         } catch (Exception JavaDoc e) {
27             throw new CCNSAccessException("Cannot access CCNS.",e);
28         }
29     }
30 }
31
Popular Tags