public String restart() {
   Iterable<?> services = module.findServices(first(serviceDescriptor.types()));
   ServiceReference<?> serviceRef =
       (ServiceReference) first(filter(withId(serviceDescriptor.identity()), services));
   if (serviceRef != null) {
     try {
       ((Activation) serviceRef).passivate();
       ((Activation) serviceRef).activate();
       return "Restarted service";
     } catch (Exception e) {
       return "Could not restart service:" + e.getMessage();
     }
   } else {
     return "Could not find service";
   }
 }
 public boolean isAvailable() {
   Class<?> mainType = first(serviceDescriptor.types());
   ServiceReference<?> first =
       first(filter(withId(serviceDescriptor.identity()), module.findServices(mainType)));
   return first != null && first.isAvailable();
 }