@Accessible( defaultAccessible = false, accessible = {@Authority(name = "admin")}) public void startPinging() { Connection connection = ApplicationContextUtil.getBean(ConnectionProvider.class).get(); logger.info(connection.getId()); RPCService rpcService = ApplicationContextUtil.getBean(RPCService.class); TestClient client = (TestClient) rpcService.getClientInstance("client", connection); PingThread pingThread = new PingThread(client, connection); pingThread.start(); pingThreads.put(connection, pingThread); }
@Accessible( defaultAccessible = false, accessible = {@Authority(name = "admin")}) public void stopPinging() { Connection connection = ApplicationContextUtil.getBean(ConnectionProvider.class).get(); logger.info(connection.getId()); PingThread pingThread = pingThreads.get(connection); pingThread.running = false; try { pingThread.join(); } catch (InterruptedException e) { e.printStackTrace(); } }
private void print(String message) { Connection connection = ApplicationContextUtil.getBean(ConnectionProvider.class).get(); logger.info(connection.getId() + ": " + message); }