executeTaskWithDefaultCardManager(task, allowDummySC, helloMsg, useOldCommandLineStyle);
return;
}
System.out.println("codebase: " + System.getProperty("java.rmi.server.codebase"));
String serverAddress = InetAddress.getLocalHost().getHostAddress();
Registry registry = LocateRegistry.getRegistry(serverAddress);
try {
//list bounded name in this registry: if rmiregistry is not running, this will throw an exception
String[] a = registry.list();
for (int i = 0; i < a.length; i++) {
System.out.println(a[i]);
}
} catch (Exception e) { //need to start card reader manager
System.out.println(e.getMessage());
//start basic card reader manager in this process
System.out.println("-->start default card reader manager in this process\n");
executeTaskWithDefaultCardManager(task, allowDummySC, helloMsg, requireConfirmationToDisconnect, useOldCommandLineStyle);
return;
//start it as rmi server
/*System.out.println("start default card manager");
startDefaultCardManager();
registry = LocateRegistry.getRegistry(serverAddress);*/
}
try {
reader = (SmartCardTaskProcessor) registry.lookup(SmartCardTaskProcessor.registryId);
reader.exist();//if card reader manager is not running, this will throw an exception
} catch (Exception ex) {
System.out.println("Exception: " + ex.getMessage());
System.out.println("start default card manager\n");
startDefaultCardManager();
try {
reader = (SmartCardTaskProcessor) registry.lookup(SmartCardTaskProcessor.registryId);
} catch (RemoteException ex1) {
Logger.getLogger(Utilities.class.getName()).log(Level.SEVERE, null, ex1);
} catch (NotBoundException ex1) {
Logger.getLogger(Utilities.class.getName()).log(Level.SEVERE, null, ex1);
}