public abstract class AbstractGriffonApplication extends AbstractObservable implements GriffonApplication
Modifier and Type | Field and Description |
---|---|
static java.lang.String[] |
EMPTY_ARGS |
protected Injector<?> |
injector |
protected java.util.Locale |
locale |
protected java.lang.Object[] |
lock |
protected org.slf4j.Logger |
log |
protected ApplicationPhase |
phase |
protected java.util.List<ShutdownHandler> |
shutdownHandlers |
protected java.lang.Object |
shutdownLock |
protected java.lang.String[] |
startupArgs |
pcs
PROPERTY_LOCALE, PROPERTY_PHASE
Constructor and Description |
---|
AbstractGriffonApplication() |
AbstractGriffonApplication(java.lang.String[] args) |
Modifier and Type | Method and Description |
---|---|
void |
addShutdownHandler(ShutdownHandler handler)
Registers a ShutdownHandler on this application
|
boolean |
canShutdown()
Queries any available ShutdownHandlers.
|
protected void |
event(ApplicationEvent event,
java.util.List<?> args) |
ActionManager |
getActionManager() |
AddonManager |
getAddonManager() |
ApplicationClassLoader |
getApplicationClassLoader() |
protected ApplicationConfigurer |
getApplicationConfigurer() |
ArtifactManager |
getArtifactManager() |
Configuration |
getConfiguration() |
ConfigurationManager |
getConfigurationManager() |
Context |
getContext() |
EventRouter |
getEventRouter() |
Injector<?> |
getInjector() |
java.util.Locale |
getLocale()
Gets the application locale.
|
org.slf4j.Logger |
getLog()
Returns a Logger instance suitable for this application.
|
MessageSource |
getMessageSource() |
MVCGroupManager |
getMvcGroupManager() |
ApplicationPhase |
getPhase()
Returns the current phase.
|
ResourceHandler |
getResourceHandler() |
ResourceInjector |
getResourceInjector() |
ResourceResolver |
getResourceResolver() |
java.lang.String[] |
getStartupArgs()
Returns the arguments set on the command line (if any).
|
UIThreadManager |
getUIThreadManager() |
<W> WindowManager<W> |
getWindowManager() |
void |
initialize()
Executes the 'Initialize' life cycle phase.
|
void |
ready()
Executes the 'Ready' life cycle phase.
|
void |
removeShutdownHandler(ShutdownHandler handler)
Removes a ShutdownHandler from this application
|
static GriffonApplication |
run(java.lang.Class<? extends GriffonApplication> applicationClass,
java.lang.String[] args) |
void |
setInjector(Injector<?> injector) |
void |
setLocale(java.util.Locale locale)
Sets the application locale.
|
void |
setLocaleAsString(java.lang.String locale)
Sets the application locale.
|
protected void |
setPhase(ApplicationPhase phase) |
protected void |
showStartingWindow() |
boolean |
shutdown()
Executes the 'Shutdown' life cycle phase.
|
void |
startup()
Executes the 'Startup' life cycle phase.
|
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createApplicationContainer
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
public static final java.lang.String[] EMPTY_ARGS
protected final java.lang.Object[] lock
protected final java.util.List<ShutdownHandler> shutdownHandlers
protected final java.lang.String[] startupArgs
protected final java.lang.Object shutdownLock
protected final org.slf4j.Logger log
protected java.util.Locale locale
protected ApplicationPhase phase
protected Injector<?> injector
public AbstractGriffonApplication()
public AbstractGriffonApplication(@Nonnull java.lang.String[] args)
@Nonnull public static GriffonApplication run(@Nonnull java.lang.Class<? extends GriffonApplication> applicationClass, @Nonnull java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
@Nonnull public java.util.Locale getLocale()
GriffonApplication
getLocale
in interface GriffonApplication
public void setLocale(@Nonnull java.util.Locale locale)
GriffonApplication
This is a bound property.
setLocale
in interface GriffonApplication
locale
- the Locale value to use@Nonnull public java.lang.String[] getStartupArgs()
GriffonApplication
getStartupArgs
in interface GriffonApplication
@Nonnull public org.slf4j.Logger getLog()
GriffonApplication
getLog
in interface GriffonApplication
public void setLocaleAsString(@Nullable java.lang.String locale)
GriffonApplication
This is a bound property.
setLocaleAsString
in interface GriffonApplication
locale
- a literal representation of a Localepublic void addShutdownHandler(@Nonnull ShutdownHandler handler)
GriffonApplication
addShutdownHandler
in interface GriffonApplication
handler
- the shutdown handler to be registered; null and/or
duplicated values should be ignoredpublic void removeShutdownHandler(@Nonnull ShutdownHandler handler)
GriffonApplication
removeShutdownHandler
in interface GriffonApplication
handler
- the shutdown handler to be removed; null and/or
duplicated values should be ignored@Nonnull public ApplicationPhase getPhase()
GriffonApplication
getPhase
in interface GriffonApplication
protected void setPhase(@Nonnull ApplicationPhase phase)
@Nonnull public ApplicationClassLoader getApplicationClassLoader()
getApplicationClassLoader
in interface GriffonApplication
@Nonnull public Context getContext()
getContext
in interface GriffonApplication
@Nonnull public Configuration getConfiguration()
getConfiguration
in interface GriffonApplication
@Nonnull public ConfigurationManager getConfigurationManager()
getConfigurationManager
in interface GriffonApplication
@Nonnull public UIThreadManager getUIThreadManager()
getUIThreadManager
in interface GriffonApplication
@Nonnull public EventRouter getEventRouter()
getEventRouter
in interface GriffonApplication
@Nonnull public ArtifactManager getArtifactManager()
getArtifactManager
in interface GriffonApplication
@Nonnull public ActionManager getActionManager()
getActionManager
in interface GriffonApplication
@Nonnull public AddonManager getAddonManager()
getAddonManager
in interface GriffonApplication
@Nonnull public MVCGroupManager getMvcGroupManager()
getMvcGroupManager
in interface GriffonApplication
@Nonnull public MessageSource getMessageSource()
getMessageSource
in interface GriffonApplication
@Nonnull public ResourceResolver getResourceResolver()
getResourceResolver
in interface GriffonApplication
@Nonnull public ResourceHandler getResourceHandler()
getResourceHandler
in interface GriffonApplication
@Nonnull public ResourceInjector getResourceInjector()
getResourceInjector
in interface GriffonApplication
@Nonnull public Injector<?> getInjector()
getInjector
in interface GriffonApplication
public void setInjector(@Nonnull Injector<?> injector)
@Nonnull public <W> WindowManager<W> getWindowManager()
getWindowManager
in interface GriffonApplication
protected ApplicationConfigurer getApplicationConfigurer()
public void initialize()
GriffonApplication
initialize
in interface GriffonApplication
public void ready()
GriffonApplication
ready
in interface GriffonApplication
protected void showStartingWindow()
public boolean canShutdown()
GriffonApplication
canShutdown
in interface GriffonApplication
public boolean shutdown()
GriffonApplication
shutdown
in interface GriffonApplication
public void startup()
GriffonApplication
startup
in interface GriffonApplication
protected void event(@Nonnull ApplicationEvent event, @Nullable java.util.List<?> args)