Class SpincastBootstrapper
java.lang.Object
org.spincast.defaults.bootstrapping.SpincastBootstrapper
Builder to help initialize an application and create its
Guice context.
It is in general started using the static method
Spincast.configure()
.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Class<?>
Adds a module to bind the caller class.protected void
addMainArgsModule
(String[] mainArgs) Adds a module to bind the main args.Bind the specified class as the app class.bindCurrentClass
(boolean bindCallerClass) protected static String
createModulesMapKey
(Class<? extends RequestContext<?>> requestContextImplementationClass, Class<? extends WebsocketContext<?>> websocketContextImplementationClass, boolean addCore) Disable all the default plugins (including the core plugin).Disables the default Core plugin.Disables the default Configuration plugin.Disables the default Cookies plugin.Disables the default Dictionary plugin.Disables the default HTTP Caching plugin.Disables the default Json plugin.Disables the default Locale Resolver plugin.Disables the default Request plugin.Disables the default Response plugin.Disables the default Routing plugin.Disables the default Server plugin.Disables the default Templating add-on plugin.Disables the default Templating plugin.Disables the default TimeZone Resolver plugin.Disables the default Variables add-on plugin.Disables the default XML plugin.protected Class<?>
protected Set<com.google.inject.Module>
protected String
Returns the class name of the caller class.protected static com.google.inject.Module
getCoreAndDefaultModuleInternal
(Class<? extends RequestContext<?>> requestContextImplementationClass, Class<? extends WebsocketContext<?>> websocketContextImplementationClass, boolean addCodePlugin) static com.google.inject.Module
static com.google.inject.Module
getDefaultModule
(boolean includeCoreModule) static com.google.inject.Module
getDefaultModule
(Class<? extends RequestContext<?>> requestContextImplementationClass, Class<? extends WebsocketContext<?>> websocketContextImplementationClass) static com.google.inject.Module
getDefaultModule
(Class<? extends RequestContext<?>> requestContextImplementationClass, Class<? extends WebsocketContext<?>> websocketContextImplementationClass, boolean includeCoreModule) protected List<SpincastPlugin>
Returns the default plugins, except those already bound.protected List<SpincastPlugin>
getDefaultPlugins
(boolean addCodePlugin) Returns the default plugins, except those already bound.protected List<SpincastPlugin>
protected Class<? extends RequestContext<?>>
protected SpincastConfigPlugin
protected SpincastCorePlugin
protected SpincastDictionaryPlugin
protected SpincastHttpCachingPlugin
protected SpincastJacksonJsonPlugin
protected SpincastJacksonXmlPlugin
protected SpincastLocaleResolverPlugin
protected SpincastPebblePlugin
protected SpincastRequestPlugin
protected SpincastResponsePlugin
protected SpincastRoutingPlugin
protected SpincastTemplatingAddonPlugin
protected SpincastTimeZoneResolverPlugin
protected SpincastUndertowPlugin
protected SpincastVariablesPlugin
protected Class<? extends WebsocketContext<?>>
com.google.inject.Injector
Create the Guice context and starts the application.protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
module
(com.google.inject.Module module) Adds a Guice module.Adds some Guice modules.plugin
(SpincastPlugin plugin) Adds a plugin.protected boolean
pluginBound
(Class<? extends SpincastPlugin> clazz) plugins
(List<SpincastPlugin> plugins) Adds some plugin.requestContextImplementationClass
(Class<? extends RequestContext<?>> clazz) protected void
setSpincastContextes
(SpincastContextTypesInterested interested) Sets the request and websocket contexts on a component.websocketContextImplementationClass
(Class<? extends WebsocketContext<?>> clazz)
-
Field Details
-
logger
protected static final org.slf4j.Logger logger
-
-
Constructor Details
-
SpincastBootstrapper
public SpincastBootstrapper()
-
-
Method Details
-
getRequestContextImplementationClass
-
getWebsocketContextImplementationClass
-
getAppClass
-
isBindCallerClass
protected boolean isBindCallerClass() -
isBindCallerClassSet
protected boolean isBindCallerClassSet() -
isDisableAllDefaultPlugins
protected boolean isDisableAllDefaultPlugins() -
isDisableCorePlugin
protected boolean isDisableCorePlugin() -
isDisableDefaultRoutingPlugin
protected boolean isDisableDefaultRoutingPlugin() -
isDisableDefaultJsonPlugin
protected boolean isDisableDefaultJsonPlugin() -
isDisableDefaultXmlPlugin
protected boolean isDisableDefaultXmlPlugin() -
isDisableDefaultRequestPlugin
protected boolean isDisableDefaultRequestPlugin() -
isDisableDefaultResponsePlugin
protected boolean isDisableDefaultResponsePlugin() -
isDisableDefaultTemplatingPlugin
protected boolean isDisableDefaultTemplatingPlugin() -
isDisableDefaultTemplatingAddonPlugin
protected boolean isDisableDefaultTemplatingAddonPlugin() -
isDisableDefaultVariablesPlugin
protected boolean isDisableDefaultVariablesPlugin() -
isDisableDefaultLocaleResolverPlugin
protected boolean isDisableDefaultLocaleResolverPlugin() -
isDisableDefaultTimeZoneResolverPlugin
protected boolean isDisableDefaultTimeZoneResolverPlugin() -
isDisableDefaultHttpCachingPlugin
protected boolean isDisableDefaultHttpCachingPlugin() -
isDisableDefaultCookiesPlugin
protected boolean isDisableDefaultCookiesPlugin() -
isDisableDefaultConfigPlugin
protected boolean isDisableDefaultConfigPlugin() -
isDisableDefaultDictionaryPlugin
protected boolean isDisableDefaultDictionaryPlugin() -
isDisableDefaultServerPlugin
protected boolean isDisableDefaultServerPlugin() -
getDefaultModulesMap
-
getPlugins
-
getAppModules
-
getPluginsToDisable
-
requestContextImplementationClass
public SpincastBootstrapper requestContextImplementationClass(Class<? extends RequestContext<?>> clazz) -
websocketContextImplementationClass
public SpincastBootstrapper websocketContextImplementationClass(Class<? extends WebsocketContext<?>> clazz) -
bindCurrentClass
-
appClass
Bind the specified class as the app class.When this is called the "current class" won't be bound.
-
disableAllDefaultPlugins
Disable all the default plugins (including the core plugin).If you use this, you're going to have to bind implementations for all the components required by a Spincast application, by yourself.
-
disableCorePlugin
Disables the default Core plugin. -
disableDefaultRoutingPlugin
Disables the default Routing plugin. -
disableDefaultJsonPlugin
Disables the default Json plugin. -
disableDefaultXmlPlugin
Disables the default XML plugin. -
disableDefaultRequestPlugin
Disables the default Request plugin. -
disableDefaultResponsePlugin
Disables the default Response plugin. -
disableDefaultTemplatingPlugin
Disables the default Templating plugin. -
disableDefaultTemplatingAddonPlugin
Disables the default Templating add-on plugin. -
disableDefaultVariablesPlugin
Disables the default Variables add-on plugin. -
disableDefaultLocaleResolverPlugin
Disables the default Locale Resolver plugin. -
disableDefaultTimeZoneResolverPlugin
Disables the default TimeZone Resolver plugin. -
disableDefaultHttpCachingPlugin
Disables the default HTTP Caching plugin. -
disableDefaultCookiesPlugin
Disables the default Cookies plugin. -
disableDefaultConfigPlugin
Disables the default Configuration plugin. -
disableDefaultDictionaryPlugin
Disables the default Dictionary plugin. -
disableDefaultServerPlugin
Disables the default Server plugin. -
module
Adds a Guice module. -
modules
Adds some Guice modules. -
plugin
Adds a plugin. Plugins will be applied in the order they are added. -
plugins
Adds some plugin. Plugins will be applied in the order they are added. -
init
Create the Guice context and starts the application.- Parameters:
mainArgs
- the application main arguments. Those will be automatically bound to :@MainArgs String[]
and@MainArgs List<String>
-
addCallerClassModule
Adds a module to bind the caller class.- Returns:
- the caller class
-
getCallerClassName
Returns the class name of the caller class. -
addMainArgsModule
Adds a module to bind the main args. -
getDefaultPlugins
Returns the default plugins, except those already bound. -
getDefaultPlugins
Returns the default plugins, except those already bound. -
pluginBound
-
getSpincastCorePlugin
-
getSpincastConfigPlugin
-
getSpincastRoutingPlugin
-
getSpincastJacksonJsonPlugin
-
getSpincastJacksonXmlPlugin
-
getSpincastRequestPlugin
-
getSpincastResponsePlugin
-
getSpincastPebblePlugin
-
getSpincastTemplatingAddonPlugin
-
getSpincastVariablesPlugin
-
getSpincastLocaleResolverPlugin
-
getSpincastTimeZoneResolverPlugin
-
getSpincastHttpCachingPlugin
-
getSpincastDictionaryPlugin
-
getSpincastUndertowPlugin
-
setSpincastContextes
Sets the request and websocket contexts on a component. -
getDefaultModule
public static com.google.inject.Module getDefaultModule() -
getDefaultModule
public static com.google.inject.Module getDefaultModule(boolean includeCoreModule) -
getDefaultModule
public static com.google.inject.Module getDefaultModule(Class<? extends RequestContext<?>> requestContextImplementationClass, Class<? extends WebsocketContext<?>> websocketContextImplementationClass) -
getDefaultModule
public static com.google.inject.Module getDefaultModule(Class<? extends RequestContext<?>> requestContextImplementationClass, Class<? extends WebsocketContext<?>> websocketContextImplementationClass, boolean includeCoreModule) -
getCoreAndDefaultModuleInternal
protected static com.google.inject.Module getCoreAndDefaultModuleInternal(Class<? extends RequestContext<?>> requestContextImplementationClass, Class<? extends WebsocketContext<?>> websocketContextImplementationClass, boolean addCodePlugin) -
createModulesMapKey
protected static String createModulesMapKey(Class<? extends RequestContext<?>> requestContextImplementationClass, Class<? extends WebsocketContext<?>> websocketContextImplementationClass, boolean addCore)
-