1 6 7 package SOFA.SOFAnet; 8 9 import java.io.*; 10 import java.util.*; 11 import SOFA.SOFAnode.TR.Impl.*; 12 import SOFA.SOFAnode.TR.*; 13 import SOFA.Util.VMProperties; 14 import java.rmi.*; 15 16 import SOFA.SOFAnet.Repository.*; 17 18 import SOFA.SOFAnet.TR.*; 19 import SOFA.SOFAnet.TR.Local.*; 20 21 import SOFA.SOFAnet.Core.*; 22 import SOFA.SOFAnet.Transport.*; 23 import SOFA.SOFAnet.Transport.RMI.*; 24 25 import java.rmi.Naming ; 26 import java.net.MalformedURLException ; 27 28 import SOFA.SOFAnet.NetNode; 29 import SOFA.SOFAnet.Local.RMI.*; 30 31 35 public class Test 36 { 37 38 39 public Test() 40 { 41 } 42 43 46 public static void main(String [] args) 47 { 48 try 49 { 50 if (args.length == 0 || args[0].length() == 0) 51 { 52 System.setProperty(VMProperties.NODE_NAME, "safir:1099"); 54 System.setProperty("java.security.policy", "X:/SOFACVS/sofa/templates/conf/.java.policy"); 55 System.setProperty("java.rmi.server.codebase", "file:///X:/SOFACVS/sofa/src"); 56 57 System.setProperty("sofa.net.searchtimeout", "20000"); 58 59 NetNode instance = new NetNode( 60 new File("x:/tmp/TRdir"), 61 new File("x:/tmp/info"), 62 new File("x:/tmp/info/bin_bundles"), 63 new File("x:/tmp/info/share_client_cache") 64 ); 65 instance.start(); 66 67 String bundleName = "my-bundle[1]"; 68 79 101 } 102 else 103 if (args[0].toLowerCase().compareTo("s") == 0) 104 { 105 System.setProperty(VMProperties.NODE_NAME, "safir:2000"); 107 System.setProperty("java.security.policy", "X:/SOFACVS/sofa/templates/conf/.java.policy"); 108 System.setProperty("java.rmi.server.codebase", "file:///X:/SOFACVS/sofa/src"); 109 110 NetNode instance = new NetNode( 111 new File("x:/tmp/TRdir_server"), 112 new File("x:/tmp/info_server"), 113 new File("x:/tmp/info_server/bin_bundles"), 114 new File("x:/tmp/info_server/share_client_cache") 115 ); 116 Reporter.setShowDetailedExceptions(true); 117 118 instance.start(); 119 120 143 } 144 else 145 if (args[0].toLowerCase().compareTo("c") == 0) 146 { 147 System.setProperty(VMProperties.NODE_NAME, "safir:2001"); 149 System.setProperty("java.security.policy", "X:/SOFACVS/sofa/templates/conf/.java.policy"); 150 System.setProperty("java.rmi.server.codebase", "file:///X:/SOFACVS/sofa/src"); 151 152 System.setProperty("sofa.net.searchtimeout", "20000"); 153 154 NetNode instance = new NetNode( 155 new File("x:/tmp/TRdir2"), 156 new File("x:/tmp/info2"), 157 new File("x:/tmp/info2/bin_bundles"), 158 new File("x:/tmp/info2/share_client_cache") 159 ); 160 instance.start(); 161 162 String bundleName = "my-bundle[1]"; 163 174 196 197 } 198 else 199 if (args[0].toLowerCase().compareTo("c2") == 0) 200 { 201 RMILocalInterface localServer = null; 202 try 203 { 204 localServer = (RMILocalInterface)Naming.lookup("rmi://safir:2000/SOFAnet/RMILocalServer"); 205 } 206 catch (Exception e) 207 { 208 e.printStackTrace(); 209 } 210 211 212 String componentFullName = "::CUNI::SOFA::demos::logdemo::Logger[0.0.1]"; 213 try 214 { 215 if (false) localServer.obtainMissingComponent(componentFullName); 216 localServer.acquireComponent(componentFullName); 217 } 220 catch (RMILocalException e) 221 { 222 e.printStackTrace(); 223 } 224 225 } 226 } 227 catch (Exception e) 228 { 229 e.printStackTrace(); 230 } 231 232 353 394 395 442 443 515 516 552 } 553 554 } 555 | Popular Tags |