Пример #1
0
  @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);
  }
Пример #2
0
 @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();
   }
 }
Пример #3
0
 private void print(String message) {
   Connection connection = ApplicationContextUtil.getBean(ConnectionProvider.class).get();
   logger.info(connection.getId() + ": " + message);
 }