Class ServiceUtils


  • public final class ServiceUtils
    extends java.lang.Object
    A utility class for service actions.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ServiceUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isServiceThread​(java.lang.Thread thread)
      Determine whether the given thread is a service thread.
      static boolean isServiceThread​(java.lang.Thread thread, ServiceContainer container)
      Determine whether the given thread is a service thread which is associated with the given container.
      static void undeployAll​(java.lang.Runnable completeTask, java.util.List<ServiceController<?>> controllers)
      Undeploy all the controllers and call the given runnable task when complete.
      static void undeployAll​(java.lang.Runnable completeTask, ServiceController<?>... controllers)
      Undeploy all the controllers and call the given runnable task when complete.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ServiceUtils

        private ServiceUtils()
    • Method Detail

      • undeployAll

        public static void undeployAll​(java.lang.Runnable completeTask,
                                       ServiceController<?>... controllers)
        Undeploy all the controllers and call the given runnable task when complete.
        Parameters:
        completeTask - the complete task
        controllers - the controllers to undeploy
      • undeployAll

        public static void undeployAll​(java.lang.Runnable completeTask,
                                       java.util.List<ServiceController<?>> controllers)
        Undeploy all the controllers and call the given runnable task when complete. The given controllers list should not be modified while this method runs, or the results will be undefined.
        Parameters:
        completeTask - the complete task
        controllers - the controllers to undeploy
      • isServiceThread

        public static boolean isServiceThread​(java.lang.Thread thread)
        Determine whether the given thread is a service thread.
        Parameters:
        thread - the thread to test
        Returns:
        true if it is a service thread, false otherwise
      • isServiceThread

        public static boolean isServiceThread​(java.lang.Thread thread,
                                              ServiceContainer container)
        Determine whether the given thread is a service thread which is associated with the given container.
        Parameters:
        thread - the thread to test
        container - the container to compare to
        Returns:
        true if it is a service thread, false otherwise