public abstract class GuiceApplication
extends javafx.application.Application
| Constructor and Description |
|---|
GuiceApplication() |
| Modifier and Type | Method and Description |
|---|---|
protected com.google.inject.Injector |
createInjector(Set<com.google.inject.Module> modules)
Internal factory method for creating the the
Injector. |
com.google.inject.Injector |
getInjector()
Returns the Google Guice Injector that is used within the context
of this JavaFX Application.
|
void |
init()
To make sure that the initialization of Guice-based JavaFX application
works flawlessly, the original init method of the base JavaFX Application
class is overwritten here.
|
abstract void |
init(List<com.google.inject.Module> modules)
This method is used to fetch and/or create (Guice) modules necessary
to fully construct this application.
|
public final void init()
throws Exception
This class offers it's own method for custom initialization, which will be called
during the invocation of this overriden method: init(java.util.List).
init in class javafx.application.ApplicationExceptionpublic abstract void init(List<com.google.inject.Module> modules) throws Exception
The modules that are initialized in this method and added to the
passed List will be used to create the Injector instance that is
used in the context of this application.
modules - A list of modules (initially empty) that shall be used to create the
injector to be used in the context of this application.Exception - if anything goes wrong during initialization.getInjector()protected com.google.inject.Injector createInjector(Set<com.google.inject.Module> modules)
Injector. This method
can be overwritten to allow for more control on how the the Injector is created.
This method is only called once after the initialization phase.modules - All modules.Injector that will be used for the the initialization
of this JavaFX Application.public final com.google.inject.Injector getInjector()
init(List)Copyright © 2012-2014 The Cat Hive Developers. All Rights Reserved.