Class GenericServer

java.lang.Object
com.qwazr.server.GenericServer
All Implemented Interfaces:
java.lang.AutoCloseable

public class GenericServer
extends java.lang.Object
implements java.lang.AutoCloseable
  • Method Details

    • getContextAttribute

      public static <T> T getContextAttribute​(javax.servlet.ServletContext context, java.lang.String name, java.lang.Class<T> type)
      Returns the named attribute. The method checks the type of the object.
      Type Parameters:
      T - the expected object
      Parameters:
      context - the context to request
      name - the name of the attribute
      type - the expected type
      Returns:
      the expected object
    • getContextAttribute

      public static <T> T getContextAttribute​(javax.servlet.ServletContext context, java.lang.Class<T> cls)
      Returns an attribute where the name of the attribute in the name of the class
      Type Parameters:
      T - the expected object
      Parameters:
      context - the context to request
      cls - the type of the object
      Returns:
      the expected object
    • stopAll

      @Deprecated public void stopAll()
      Deprecated.
      Uses close()
    • close

      public void close()
      Specified by:
      close in interface java.lang.AutoCloseable
    • start

      public final void start​(boolean shutdownHook) throws java.io.IOException, javax.servlet.ServletException, javax.management.JMException
      Call this method to start the server
      Parameters:
      shutdownHook - pass true to install the StopAll method as Runtime shutdown hook
      Throws:
      java.io.IOException - if any IO error occurs
      javax.servlet.ServletException - if the servlet configuration failed
      javax.management.JMException - if any JMX error occurs
    • getConnectorsStatistics

      public java.util.Collection<ConnectorStatisticsMXBean> getConnectorsStatistics()
    • of

      public static GenericServerBuilder of​(ServerConfiguration config, java.util.concurrent.ExecutorService executorService, java.lang.ClassLoader classLoader, com.qwazr.utils.reflection.ConstructorParameters constructorParameters)
    • of

      public static GenericServerBuilder of​(ServerConfiguration config, java.util.concurrent.ExecutorService executorService, java.lang.ClassLoader classLoader)
    • of

      public static GenericServerBuilder of​(ServerConfiguration config, java.util.concurrent.ExecutorService executorService)
    • of

      public static GenericServerBuilder of​(ServerConfiguration config)