All Downloads are FREE. Search and download functionalities are using the official Maven repository.

public.javadoc.org.spincast.defaults.bootstrapping.Spincast.html Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version






Spincast (org.spincast:spincast-framework 1.0.0 API)












org.spincast.defaults.bootstrapping

Class Spincast



  • public class Spincast
    extends Object
    Starts the initialization of a Spincast application.

    Will create the final Guice Injector and return it when the init() method is called.

    In addition to the methods directly provided by this bootstrapper, it is possible to tweak the resulting Guice context by using the GuiceTweaker class. The main use case where a tweaker may be useful, is to write test classes : the tweaker allows you to reuse the exact same code that bootstraps your application (often by calling its main(...) method), but to tweak some bindings, mock some components.

    • Constructor Detail

      • Spincast

        public Spincast()
    • Method Detail

      • configure

        public static SpincastBootstrapper configure()
        Starts the bootsrapping of a Spincast application, using the default plugins.

        When the configuration is done, call the init() method to initialize the Guice context.

        By default, the caller class is going to be bound in the Guice context. If you want to disable this, call ".bindCallerClass(false)"!

        Returns:
        The bootstrapper
      • init

        public static com.google.inject.Injector init(String[] args)
        Initialize a default Spincast application.

        The caller class is going to be bound in the Guice context. You may want to add some kind of "@Inject init()" method in it and start your application there!

        The default Request Context type and the default Websocket Context type will be used.

        Parameters:
        args - The parameters received in the main method. Those will be bound in the Guice context and you will be able to inject them wherever you need, using the @MainArgs annotation.
        Returns:
        The create Guice Injector (context).
      • getDefaultModule

        public static com.google.inject.Module getDefaultModule()
        Returns a module combining all the default plugins implementations, parametrized with the default Request and Websocket contextes.

        The SpincastCoreGuiceModule module is included.

      • getDefaultModule

        public static com.google.inject.Module getDefaultModule(boolean includeCoreModule)
        Returns a module combining all the default plugins implementations, parametrized with the default Request and Websocket contextes.

        The SpincastCoreGuiceModule module is not included.

        Parameters:
        includeCoreModule - Should the Core module being added too?
      • getDefaultModule

        public static com.google.inject.Module getDefaultModule(Class<? extends RequestContext<?>> requestContextImplementationClass,
                                                                Class<? extends WebsocketContext<?>> websocketContextImplementationClass)
        Returns a module combining all the default plugins implementations.

        The SpincastCoreGuiceModule module is not included.

      • getDefaultModule

        public static com.google.inject.Module getDefaultModule(Class<? extends RequestContext<?>> requestContextImplementationClass,
                                                                Class<? extends WebsocketContext<?>> websocketContextImplementationClass,
                                                                boolean includeCoreModule)
        Returns a module combining all the default plugins implementations.

        The SpincastCoreGuiceModule module is not included.

        Parameters:
        includeCoreModule - Should the Core module being added too?

Copyright © 2019. All rights reserved.





© 2015 - 2024 Weber Informatics LLC | Privacy Policy