KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > SOFA > Connector > TIRAccess


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

6
7 package SOFA.Connector.TIRAccess;
8
9 import java.rmi.Naming JavaDoc;
10
11 import SOFA.SOFAnode.Made.TIR.Repository;
12
13 /**
14  *
15  * @author ghort
16  * @version
17  */

18 public class TIRAccess {
19
20     public static Repository repository;
21
22     public static void openTIR() throws TIRAccessException {
23         try {
24             System.setSecurityManager(new java.rmi.RMISecurityManager JavaDoc());
25             String JavaDoc rmiport = System.getProperty("sofa.rmiport","1099");
26             String JavaDoc rmihost = System.getProperty("sofa.rmihost","localhost");
27             
28             repository = (Repository) Naming.lookup("//"+rmihost+":"+rmiport+"/Repository");
29         } catch (Exception JavaDoc e) {
30             throw new TIRAccessException("Cannot access TIR.",e);
31         }
32     }
33 }
34
Popular Tags