Class SimpleContainer

  • All Implemented Interfaces:
    Container, org.simpleframework.http.core.Container

    public final class SimpleContainer
    extends java.lang.Object
    implements org.simpleframework.http.core.Container, Container
    Jersey Container implementation based on Simple framework Container.
    • Field Detail

      • RequestTYPE

        private final java.lang.reflect.Type RequestTYPE
      • ResponseTYPE

        private final java.lang.reflect.Type ResponseTYPE
      • scheduler

        private volatile java.util.concurrent.ScheduledExecutorService scheduler
    • Constructor Detail

      • SimpleContainer

        SimpleContainer​(javax.ws.rs.core.Application application,
                        java.lang.Object parentContext)
        Create a new Simple framework HTTP container.
        Parameters:
        application - JAX-RS / Jersey application to be deployed on Simple framework HTTP container.
        parentContext - DI provider specific context with application's registered bindings.
      • SimpleContainer

        SimpleContainer​(javax.ws.rs.core.Application application)
        Create a new Simple framework HTTP container.
        Parameters:
        application - JAX-RS / Jersey application to be deployed on Simple framework HTTP container.
    • Method Detail

      • handle

        public void handle​(org.simpleframework.http.Request request,
                           org.simpleframework.http.Response response)
        Specified by:
        handle in interface org.simpleframework.http.core.Container
      • getRequestUri

        private java.net.URI getRequestUri​(org.simpleframework.http.Request request,
                                           java.net.URI baseUri)
      • getServerAddress

        private java.lang.String getServerAddress​(java.net.URI baseUri)
                                           throws java.net.URISyntaxException
        Throws:
        java.net.URISyntaxException
      • getBaseUri

        private java.net.URI getBaseUri​(org.simpleframework.http.Request request)
      • getSecurityContext

        private javax.ws.rs.core.SecurityContext getSecurityContext​(org.simpleframework.http.Request request)
      • close

        private void close​(org.simpleframework.http.Response response)
      • reload

        public void reload()
        Description copied from interface: Container
        Reload the hosted Jersey application using the current configuration.
        Specified by:
        reload in interface Container
      • reload

        public void reload​(ResourceConfig configuration)
        Description copied from interface: Container
        Reload the hosted Jersey application using a new configuration.
        Specified by:
        reload in interface Container
        Parameters:
        configuration - new configuration used for the reload.
      • getApplicationHandler

        public ApplicationHandler getApplicationHandler()
        Description copied from interface: Container
        Get the Jersey server-side application handler associated with the container.
        Specified by:
        getApplicationHandler in interface Container
        Returns:
        Jersey server-side application handler associated with the container.
      • onServerStart

        void onServerStart()
        Inform this container that the server has been started.

        This method must be implicitly called after the server containing this container is started.

      • onServerStop

        void onServerStop()
        Inform this container that the server is being stopped.

        This method must be implicitly called before the server containing this container is stopped.