/** * removes if there is a RMI local registry instance * * @param port The port of the RMI registry to be removed */ public void removeLocalRegistry(int port) { String key = toKey(port); synchronized (registriesCache) { if (registriesCache.containsKey(key)) { removeRegistry(key, registriesCache.get(key)); } else { if (log.isDebugEnabled()) { log.debug("There is no RMi registry for port : " + port); } } } }
/** * removes if there is a RMI local registry instance * * @param port The port of the RMI registry to be removed */ public void removeLocalRegistry(int port) { String key = toKey(port); synchronized (registriesCache) { if (registriesCache.containsKey(key)) { removeRegistry(key, registriesCache.get(key)); } else { if (log.isDebugEnabled()) { log.debug("There is no RMi registry for port : " + port); } } } }
/** * Creates a RMI local registry with given port * * @param port The port of the RMI registry to be created */ public void createLocalRegistry(int port) { try { String key = toKey(port); synchronized (registriesCache) { if (registriesCache.containsKey(key)) { if (log.isDebugEnabled()) { log.debug("There is an RMI registry bound to given port :" + port); } return; } Registry locateRegistry = LocateRegistry.createRegistry(port); if (locateRegistry == null) { handleException("Unable to create a RMI registry with port : " + port); } registriesCache.put(key, locateRegistry); } } catch (RemoteException e) { String msg = "Couldn't create a local registry(RMI) : port " + port + " already in use."; handleException(msg, e); } }
/** * Creates a RMI local registry with given port * * @param port The port of the RMI registry to be created */ public void createLocalRegistry(int port) { try { String key = toKey(port); synchronized (registriesCache) { if (registriesCache.containsKey(key)) { if (log.isDebugEnabled()) { log.debug("There is an RMI registry bound to given port :" + port); } return; } Registry locateRegistry = LocateRegistry.createRegistry(port); if (locateRegistry == null) { handleException("Unable to create a RMI registry with port : " + port); } registriesCache.put(key, locateRegistry); } } catch (RemoteException e) { String msg = "Couldn't create a local registry(RMI) : port " + port + " already in use."; handleException(msg, e); } }