* @throws java.io.FileNotFoundException
* @throws java.rmi.NotBoundException
*/
public static IServiceFacadeSmeny XXXgetInstance() throws RemoteException, FileNotFoundException, NotBoundException {
if (facade == null) {
ConfigParser config = null;
config = new ConfigParser();
if (System.getSecurityManager() == null) {
System.setSecurityManager(new RMISecurityManager());
}
String name = "ServiceFacadeWorkshift";//TODO implementova ServiceFacade pro workshift
facade = null;
Registry reg = null;
try {
reg = LocateRegistry.getRegistry(config.getPrimaryServerIP(), 1099);
String ip = config.getPrimaryServerIP();
String[] list = reg.list();
facade = (IServiceFacadeSmeny) reg.lookup(name);
} catch (Exception e) {
try {
reg = LocateRegistry.getRegistry(config.getSecondaryServerIP(), 1099);
facade = (IServiceFacadeSmeny) reg.lookup(name);
} catch (Exception ex) {
facade = null;
throw new RemoteException();
}