Package org.glassfish.jersey.internal
Class BootstrapBag
- java.lang.Object
-
- org.glassfish.jersey.internal.BootstrapBag
-
- Direct Known Subclasses:
ServerBootstrapBag
public class BootstrapBag extends java.lang.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.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<AutoDiscoverable>
autoDiscoverables
private javax.ws.rs.core.Configuration
configuration
private ContextResolvers
contextResolvers
private ExceptionMappers
exceptionMappers
private ManagedObjectsFinalizer
managedObjectsFinalizer
private MessageBodyWorkers
messageBodyWorkers
private RequestScope
requestScope
-
Constructor Summary
Constructors Constructor Description BootstrapBag()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<AutoDiscoverable>
getAutoDiscoverables()
Gets a list ofAutoDiscoverable
.javax.ws.rs.core.Configuration
getConfiguration()
Gets an instance ofConfiguration
.ContextResolvers
getContextResolvers()
Gets an instance ofContextResolvers
.ExceptionMappers
getExceptionMappers()
Gets an instance ofExceptionMappers
.ManagedObjectsFinalizer
getManagedObjectsFinalizer()
Gets an instance ofManagedObjectsFinalizer
.MessageBodyWorkers
getMessageBodyWorkers()
Gets an instance ofMessageBodyWorkers
.RequestScope
getRequestScope()
Gets an instance ofRequestScope
.protected static void
requireNonNull(java.lang.Object object, java.lang.reflect.Type type)
Check whether the value is notnull
that means that the properBootstrapConfigurator
has not been configured or in a wrong order.void
setAutoDiscoverables(java.util.List<AutoDiscoverable> autoDiscoverables)
Sets a list ofAutoDiscoverable
.void
setConfiguration(javax.ws.rs.core.Configuration configuration)
Sets an instance ofConfiguration
.void
setContextResolvers(ContextResolvers contextResolvers)
Sets an instance ofContextResolvers
.void
setExceptionMappers(ExceptionMappers exceptionMappers)
Sets an instance ofExceptionMappers
.void
setManagedObjectsFinalizer(ManagedObjectsFinalizer managedObjectsFinalizer)
Sets an instance ofManagedObjectsFinalizer
.void
setMessageBodyWorkers(MessageBodyWorkers messageBodyWorkers)
Sets an instance ofMessageBodyWorkers
.void
setRequestScope(RequestScope requestScope)
Sets an instance ofRequestScope
.
-
-
-
Field Detail
-
configuration
private javax.ws.rs.core.Configuration configuration
-
requestScope
private RequestScope requestScope
-
messageBodyWorkers
private MessageBodyWorkers messageBodyWorkers
-
exceptionMappers
private ExceptionMappers exceptionMappers
-
contextResolvers
private ContextResolvers contextResolvers
-
managedObjectsFinalizer
private ManagedObjectsFinalizer managedObjectsFinalizer
-
autoDiscoverables
private java.util.List<AutoDiscoverable> autoDiscoverables
-
-
Method Detail
-
getAutoDiscoverables
public java.util.List<AutoDiscoverable> getAutoDiscoverables()
Gets a list ofAutoDiscoverable
.- Returns:
- list of
AutoDiscoverable
.
-
setAutoDiscoverables
public void setAutoDiscoverables(java.util.List<AutoDiscoverable> autoDiscoverables)
Sets a list ofAutoDiscoverable
.- Parameters:
autoDiscoverables
- list ofAutoDiscoverable
.
-
getManagedObjectsFinalizer
public ManagedObjectsFinalizer getManagedObjectsFinalizer()
Gets an instance ofManagedObjectsFinalizer
.- Returns:
ManagedObjectsFinalizer
instance.
-
setManagedObjectsFinalizer
public void setManagedObjectsFinalizer(ManagedObjectsFinalizer managedObjectsFinalizer)
Sets an instance ofManagedObjectsFinalizer
.- Parameters:
managedObjectsFinalizer
-ManagedObjectsFinalizer
instance.
-
getRequestScope
public RequestScope getRequestScope()
Gets an instance ofRequestScope
.- Returns:
RequestScope
instance.
-
setRequestScope
public void setRequestScope(RequestScope requestScope)
Sets an instance ofRequestScope
.- Parameters:
requestScope
-RequestScope
instance.
-
getMessageBodyWorkers
public MessageBodyWorkers getMessageBodyWorkers()
Gets an instance ofMessageBodyWorkers
.- Returns:
MessageBodyWorkers
instance.
-
setMessageBodyWorkers
public void setMessageBodyWorkers(MessageBodyWorkers messageBodyWorkers)
Sets an instance ofMessageBodyWorkers
.- Parameters:
messageBodyWorkers
-MessageBodyWorkers
instance.
-
getConfiguration
public javax.ws.rs.core.Configuration getConfiguration()
Gets an instance ofConfiguration
.- Returns:
Configuration
instance.
-
setConfiguration
public void setConfiguration(javax.ws.rs.core.Configuration configuration)
Sets an instance ofConfiguration
.- Parameters:
configuration
-Configuration
instance.
-
getExceptionMappers
public ExceptionMappers getExceptionMappers()
Gets an instance ofExceptionMappers
.- Returns:
ExceptionMappers
instance.
-
setExceptionMappers
public void setExceptionMappers(ExceptionMappers exceptionMappers)
Sets an instance ofExceptionMappers
.- Parameters:
exceptionMappers
-ExceptionMappers
instance.
-
getContextResolvers
public ContextResolvers getContextResolvers()
Gets an instance ofContextResolvers
.- Returns:
ContextResolvers
instance.
-
setContextResolvers
public void setContextResolvers(ContextResolvers contextResolvers)
Sets an instance ofContextResolvers
.- Parameters:
contextResolvers
-ContextResolvers
instance.
-
requireNonNull
protected static void requireNonNull(java.lang.Object object, java.lang.reflect.Type type)
Check whether the value is notnull
that means that the properBootstrapConfigurator
has not been configured or in a wrong order.- Parameters:
object
- tested object.type
- type of the tested object.
-
-