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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Class<?>Adds a module to bind the caller class.protected voidaddMainArgsModule(String[] mainArgs) Adds a module to bind the main args.Bind the specified class as the app class.bindCurrentClass(boolean bindCallerClass) protected static StringcreateModulesMapKey(Class<? extends org.spincast.core.exchange.RequestContext<?>> requestContextImplementationClass, Class<? extends org.spincast.core.websocket.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 StringReturns the class name of the caller class.protected static com.google.inject.ModulegetCoreAndDefaultModuleInternal(Class<? extends org.spincast.core.exchange.RequestContext<?>> requestContextImplementationClass, Class<? extends org.spincast.core.websocket.WebsocketContext<?>> websocketContextImplementationClass, boolean addCodePlugin) static com.google.inject.Modulestatic com.google.inject.ModulegetDefaultModule(boolean includeCoreModule) static com.google.inject.ModulegetDefaultModule(Class<? extends org.spincast.core.exchange.RequestContext<?>> requestContextImplementationClass, Class<? extends org.spincast.core.websocket.WebsocketContext<?>> websocketContextImplementationClass) static com.google.inject.ModulegetDefaultModule(Class<? extends org.spincast.core.exchange.RequestContext<?>> requestContextImplementationClass, Class<? extends org.spincast.core.websocket.WebsocketContext<?>> websocketContextImplementationClass, boolean includeCoreModule) protected List<org.spincast.core.guice.SpincastPlugin>Returns the default plugins, except those already bound.protected List<org.spincast.core.guice.SpincastPlugin>getDefaultPlugins(boolean addCodePlugin) Returns the default plugins, except those already bound.protected List<org.spincast.core.guice.SpincastPlugin>protected Class<? extends org.spincast.core.exchange.RequestContext<?>>protected org.spincast.plugins.config.SpincastConfigPluginprotected org.spincast.core.guice.SpincastCorePluginprotected org.spincast.plugins.dictionary.SpincastDictionaryPluginprotected org.spincast.plugins.httpcaching.SpincastHttpCachingPluginprotected org.spincast.plugins.jacksonjson.SpincastJacksonJsonPluginprotected org.spincast.plugins.jacksonxml.SpincastJacksonXmlPluginprotected org.spincast.plugins.localeresolver.SpincastLocaleResolverPluginprotected org.spincast.plugins.pebble.SpincastPebblePluginprotected org.spincast.plugins.request.SpincastRequestPluginprotected org.spincast.plugins.response.SpincastResponsePluginprotected org.spincast.plugins.routing.SpincastRoutingPluginprotected org.spincast.plugins.templatingaddon.SpincastTemplatingAddonPluginprotected org.spincast.plugins.timezoneresolver.SpincastTimeZoneResolverPluginprotected org.spincast.plugins.undertow.SpincastUndertowPluginprotected org.spincast.plugins.variables.SpincastVariablesPluginprotected Class<? extends org.spincast.core.websocket.WebsocketContext<?>>com.google.inject.InjectorCreate the Guice context and starts the application.protected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanmodule(com.google.inject.Module module) Adds a Guice module.Adds some Guice modules.plugin(org.spincast.core.guice.SpincastPlugin plugin) Adds a plugin.protected booleanpluginBound(Class<? extends org.spincast.core.guice.SpincastPlugin> clazz) Adds some plugin.requestContextImplementationClass(Class<? extends org.spincast.core.exchange.RequestContext<?>> clazz) protected voidsetSpincastContextes(org.spincast.core.guice.SpincastContextTypesInterested interested) Sets the request and websocket contexts on a component.websocketContextImplementationClass(Class<? extends org.spincast.core.websocket.WebsocketContext<?>> clazz)
-
Field Details
-
logger
protected static final org.slf4j.Logger logger
-
-
Constructor Details
-
SpincastBootstrapper
public SpincastBootstrapper()
-
-
Method Details
-
getRequestContextImplementationClass
protected Class<? extends org.spincast.core.exchange.RequestContext<?>> getRequestContextImplementationClass() -
getWebsocketContextImplementationClass
protected Class<? extends org.spincast.core.websocket.WebsocketContext<?>> 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 org.spincast.core.exchange.RequestContext<?>> clazz) -
websocketContextImplementationClass
public SpincastBootstrapper websocketContextImplementationClass(Class<? extends org.spincast.core.websocket.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
protected org.spincast.core.guice.SpincastCorePlugin getSpincastCorePlugin() -
getSpincastConfigPlugin
protected org.spincast.plugins.config.SpincastConfigPlugin getSpincastConfigPlugin() -
getSpincastRoutingPlugin
protected org.spincast.plugins.routing.SpincastRoutingPlugin getSpincastRoutingPlugin() -
getSpincastJacksonJsonPlugin
protected org.spincast.plugins.jacksonjson.SpincastJacksonJsonPlugin getSpincastJacksonJsonPlugin() -
getSpincastJacksonXmlPlugin
protected org.spincast.plugins.jacksonxml.SpincastJacksonXmlPlugin getSpincastJacksonXmlPlugin() -
getSpincastRequestPlugin
protected org.spincast.plugins.request.SpincastRequestPlugin getSpincastRequestPlugin() -
getSpincastResponsePlugin
protected org.spincast.plugins.response.SpincastResponsePlugin getSpincastResponsePlugin() -
getSpincastPebblePlugin
protected org.spincast.plugins.pebble.SpincastPebblePlugin getSpincastPebblePlugin() -
getSpincastTemplatingAddonPlugin
protected org.spincast.plugins.templatingaddon.SpincastTemplatingAddonPlugin getSpincastTemplatingAddonPlugin() -
getSpincastVariablesPlugin
protected org.spincast.plugins.variables.SpincastVariablesPlugin getSpincastVariablesPlugin() -
getSpincastLocaleResolverPlugin
protected org.spincast.plugins.localeresolver.SpincastLocaleResolverPlugin getSpincastLocaleResolverPlugin() -
getSpincastTimeZoneResolverPlugin
protected org.spincast.plugins.timezoneresolver.SpincastTimeZoneResolverPlugin getSpincastTimeZoneResolverPlugin() -
getSpincastHttpCachingPlugin
protected org.spincast.plugins.httpcaching.SpincastHttpCachingPlugin getSpincastHttpCachingPlugin() -
getSpincastDictionaryPlugin
protected org.spincast.plugins.dictionary.SpincastDictionaryPlugin getSpincastDictionaryPlugin() -
getSpincastUndertowPlugin
protected org.spincast.plugins.undertow.SpincastUndertowPlugin getSpincastUndertowPlugin() -
setSpincastContextes
protected void setSpincastContextes(org.spincast.core.guice.SpincastContextTypesInterested interested) 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
-
getDefaultModule
-
getCoreAndDefaultModuleInternal
-
createModulesMapKey
-