Exemple #1
0
 private void startSamp() {
   logger.log(Level.INFO, "Initializing Hub Connector");
   sampClient = new HubConnector(sampClientProfile);
   sampClient.declareMetadata(metadata);
   sampClient.declareSubscriptions(sampClient.computeSubscriptions());
   sampClient.setActive(true);
   Runnable sampMonitor =
       new Runnable() {
         @Override
         public void run() {
           monitorSampOnce();
         }
       };
   if (resourceServer != null) {
     resourceServer.start();
     logger.log(Level.INFO, "Starting SAMP resource server");
   }
   logger.log(Level.INFO, "Starting SAMP monitor thread");
   sampMonitorHandle = executor.scheduleAtFixedRate(sampMonitor, 0, 3, TimeUnit.SECONDS);
 }
Exemple #2
0
 public URL addResource(String filename, ServerResource serverResource) {
   return resourceServer.addResource(filename, serverResource);
 }