Class BootstrapBag


  • public class BootstrapBag
    extends Object
    A holder that is used only during Jersey bootstrap to keep the instances of the given types and then use them during the bootstrap. This works as a replacement of an injection framework during a bootstrap and intentionally keeps all needed types in separate fields to make strong type nature and to preserve a clear view which types are needed to inject to other services.
    Author:
    Petr Bouda
    • Constructor Detail

      • BootstrapBag

        public BootstrapBag()
    • Method Detail

      • getAutoDiscoverables

        public List<org.glassfish.jersey.internal.spi.AutoDiscoverable> getAutoDiscoverables()
        Gets a list of AutoDiscoverable.
        Returns:
        list of AutoDiscoverable.
      • setAutoDiscoverables

        public void setAutoDiscoverables​(List<org.glassfish.jersey.internal.spi.AutoDiscoverable> autoDiscoverables)
        Sets a list of AutoDiscoverable.
        Parameters:
        autoDiscoverables - list of AutoDiscoverable.
      • setManagedObjectsFinalizer

        public void setManagedObjectsFinalizer​(ManagedObjectsFinalizer managedObjectsFinalizer)
        Sets an instance of ManagedObjectsFinalizer.
        Parameters:
        managedObjectsFinalizer - ManagedObjectsFinalizer instance.
      • getRequestScope

        public RequestScope getRequestScope()
        Gets an instance of RequestScope.
        Returns:
        RequestScope instance.
      • setRequestScope

        public void setRequestScope​(RequestScope requestScope)
        Sets an instance of RequestScope.
        Parameters:
        requestScope - RequestScope instance.
      • setMessageBodyWorkers

        public void setMessageBodyWorkers​(MessageBodyWorkers messageBodyWorkers)
        Sets an instance of MessageBodyWorkers.
        Parameters:
        messageBodyWorkers - MessageBodyWorkers instance.
      • getConfiguration

        public jakarta.ws.rs.core.Configuration getConfiguration()
        Gets an instance of Configuration.
        Returns:
        Configuration instance.
      • setConfiguration

        public void setConfiguration​(jakarta.ws.rs.core.Configuration configuration)
        Sets an instance of Configuration.
        Parameters:
        configuration - Configuration instance.
      • setExceptionMappers

        public void setExceptionMappers​(ExceptionMappers exceptionMappers)
        Sets an instance of ExceptionMappers.
        Parameters:
        exceptionMappers - ExceptionMappers instance.
      • setContextResolvers

        public void setContextResolvers​(ContextResolvers contextResolvers)
        Sets an instance of ContextResolvers.
        Parameters:
        contextResolvers - ContextResolvers instance.
      • requireNonNull

        protected static void requireNonNull​(Object object,
                                             Type type)
        Check whether the value is not null that means that the proper BootstrapConfigurator has not been configured or in a wrong order.
        Parameters:
        object - tested object.
        type - type of the tested object.