예제 #1
0
 @Override
 public void stop() {
   try {
     URI baseUri = managementApiUri();
     server.removeJAXRSClasses(getClassNames(), baseUri.toString());
   } catch (UnknownHostException e) {
     log.warn(e);
   }
 }
예제 #2
0
  @Override
  public void start(StringLogger logger) {
    try {
      URI baseUri = managementApiUri();
      server.addJAXRSClasses(getClassNames(), baseUri.toString(), null);

      log.info("Mounted REST API at: " + baseUri.toString());
      if (logger != null) {
        logger.logMessage("Mounted REST API at: " + baseUri.toString());
      }
    } catch (UnknownHostException e) {
      log.warn(e);
    }
  }