|
Griffon 0.9.5-rc2 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD |
griffon.core.ResourceHandlergriffon.core.GriffonApplication
griffon.core.MVCHandler
griffon.core.ThreadingHandler
public interface GriffonApplication extends MVCHandler, ResourceHandler, ThreadingHandler
Defines the basic contract of a Griffon application.
Nested Class Summary | |
---|---|
enum |
GriffonApplication.Configuration
Defines the names of the configuration scripts. |
enum |
GriffonApplication.Event
Defines all the events triggered by the application. |
enum |
GriffonApplication.Lifecycle
Defines the names of the lifecycle scripts. |
Method Summary | |
---|---|
void
|
addApplicationEventListener(Object listener)
Adds an application event listener. |
void
|
addApplicationEventListener(String eventName, Closure listener)
Adds a closure as an application event listener. |
void
|
addApplicationEventListener(String eventName, RunnableWithArgs listener)
Adds a runnable as an application event listener. |
void
|
addShutdownHandler(ShutdownHandler handler)
Registers a ShutdownHandler on this application |
boolean
|
canShutdown()
Queries any available ShutdownHandlers. |
Object
|
createApplicationContainer()
|
void
|
event(String eventName)
Publishes an application event. |
void
|
event(String eventName, List params)
Publishes an application event. |
void
|
eventAsync(String eventName)
Publishes an application event asynchronously off the publisher's thread. |
void
|
eventAsync(String eventName, List params)
Publishes an application event asynchronously off the publisher's thread. |
void
|
eventOutside(String eventName)
Publishes an application event asynchronously off the UI thread. |
void
|
eventOutside(String eventName, List params)
Publishes an application event asynchronously off the UI thread. |
void
|
eventOutsideUI(String eventName)
Publishes an application event asynchronously off the UI thread. |
void
|
eventOutsideUI(String eventName, List params)
Publishes an application event asynchronously off the UI thread. |
AddonManager
|
getAddonManager()
Returns the application's AddonManager instance. |
Class
|
getAppConfigClass()
Gets the script class that holds the MVC configuration (i.e. |
ArtifactManager
|
getArtifactManager()
Returns the application's ArtifactManager instance. |
Binding
|
getBindings()
|
Class
|
getBuilderClass()
Gets the script class that holds builder configuration (i.e. |
ConfigObject
|
getBuilderConfig()
Returns the runtime configuration required for instantiating a CompositeBuilder |
Map
|
getBuilders()
Returns all currently available builder instances, keyed by group name. |
ConfigObject
|
getConfig()
Returns the merged runtime configuration from appConfig and config |
Class
|
getConfigClass()
Gets the script class that holds additional configuration (i.e. |
Map
|
getControllers()
Returns all currently available controller instances, keyed by group name. |
Class
|
getEventsClass()
Gets the script class that holds global event handler configuration (i.e. |
Object
|
getEventsConfig()
Returns the runtime configuration for global event handlers. |
Map
|
getGroups()
Returns all currently available groups, keyed by group name. |
Locale
|
getLocale()
Gets the application locale. |
org.slf4j.Logger
|
getLog()
Returns a Logger instance suitable for this application. |
Metadata
|
getMetadata()
Gets the application's configuration set on 'application.properties'. |
Map
|
getModels()
Returns all currently available model instances, keyed by group name. |
MVCGroupManager
|
getMvcGroupManager()
Returns the application's MVCGroupManager instance. |
ApplicationPhase
|
getPhase()
Returns the current phase. |
ServiceManager
|
getServiceManager()
Returns the application's ServiceManager instance. |
Map
|
getServices()
Returns all currently available service instances, keyed by group name. |
String[]
|
getStartupArgs()
Returns the arguments set on the command line (if any). |
Map
|
getViews()
Returns all currently available view instances, keyed by group name. |
void
|
initialize()
Executes the 'Initialize' life cycle phase. |
boolean
|
isEventPublishingEnabled()
Returns whether events will be published by the application's event bus or not. |
Object
|
newInstance(Class clazz, String type)
Creates a new instance of the specified class and type. |
void
|
ready()
Executes the 'Ready' life cycle phase. |
void
|
removeApplicationEventListener(Object listener)
Removes an application event listener. |
void
|
removeApplicationEventListener(String eventName, Closure listener)
Removes a closure as an application event listener. |
void
|
removeApplicationEventListener(String eventName, RunnableWithArgs listener)
Removes a runnable as an application event listener. |
void
|
removeShutdownHandler(ShutdownHandler handler)
Removes a ShutdownHandler from this application |
void
|
setBindings(Binding bindings)
|
void
|
setBuilderConfig(ConfigObject builderConfig)
|
void
|
setConfig(ConfigObject config)
|
void
|
setEventPublishingEnabled(boolean enabled)
Sets the enabled state for event publishing. |
void
|
setEventsConfig(Object eventsConfig)
|
void
|
setLocale(Locale locale)
Sets the application locale. |
boolean
|
shutdown()
Executes the 'Shutdown' life cycle phase. |
void
|
startup()
Executes the 'Startup' life cycle phase. |
GriffonApplication
|
valueOf(String name)
Returns the enum constant of this type with the specified name. |
GriffonApplication
|
valueOf(String name)
Returns the enum constant of this type with the specified name. |
GriffonApplication
|
valueOf(String name)
Returns the enum constant of this type with the specified name. |
GriffonApplication[]
|
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
GriffonApplication[]
|
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
GriffonApplication[]
|
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from interface ResourceHandler | |
---|---|
getResourceAsStream, getResourceAsURL, getResources |
Methods inherited from interface ThreadingHandler | |
---|---|
execAsync, execFuture, execFuture, execFuture, execFuture, execInsideUIAsync, execInsideUISync, execOutside, execOutsideUI, execSync, isUIThread |
Method Detail |
---|
public void addApplicationEventListener(Object listener)
Accepted types are: Script, Map and Object.
listener
- an application event listener
public void addApplicationEventListener(String eventName, Closure listener)
eventName
- the name of the eventlistener
- an application event listener
public void addApplicationEventListener(String eventName, RunnableWithArgs listener)
eventName
- the name of the eventlistener
- an application event listener
public void addShutdownHandler(ShutdownHandler handler)
handler
- the shutdown handler to be registered; null and/or
duplicated values should be ignored
public boolean canShutdown()
public Object createApplicationContainer()
public void event(String eventName)
eventName
- the name of the event
public void event(String eventName, List params)
eventName
- the name of the eventparams
- event arguments sent to listeners
public void eventAsync(String eventName)
eventName
- the name of the event
public void eventAsync(String eventName, List params)
eventName
- the name of the eventparams
- event arguments sent to listeners
@Deprecated public void eventOutside(String eventName)
eventName
- the name of the event
@Deprecated public void eventOutside(String eventName, List params)
eventName
- the name of the eventparams
- event arguments sent to listeners
public void eventOutsideUI(String eventName)
eventName
- the name of the event
public void eventOutsideUI(String eventName, List params)
eventName
- the name of the eventparams
- event arguments sent to listeners
public AddonManager getAddonManager()
public Class getAppConfigClass()
public ArtifactManager getArtifactManager()
public Binding getBindings()
public Class getBuilderClass()
public ConfigObject getBuilderConfig()
public Map getBuilders()
public ConfigObject getConfig()
public Class getConfigClass()
public Map getControllers()
public Class getEventsClass()
public Object getEventsConfig()
public Map getGroups()
public Locale getLocale()
public org.slf4j.Logger getLog()
public Metadata getMetadata()
public Map getModels()
public MVCGroupManager getMvcGroupManager()
public ApplicationPhase getPhase()
public ServiceManager getServiceManager()
public Map getServices()
public String[] getStartupArgs()
public Map getViews()
public void initialize()
public boolean isEventPublishingEnabled()
public Object newInstance(Class clazz, String type)
clazz
- the Class for which an instance must be createdtype
- a symbolical type, for example 'controller' or 'service'. May be null.
public void ready()
public void removeApplicationEventListener(Object listener)
Accepted types are: Script, Map and Object.
listener
- an application event listener
public void removeApplicationEventListener(String eventName, Closure listener)
eventName
- the name of the eventlistener
- an application event listener
public void removeApplicationEventListener(String eventName, RunnableWithArgs listener)
eventName
- the name of the eventlistener
- an application event listener
public void removeShutdownHandler(ShutdownHandler handler)
handler
- the shutdown handler to be removed; null and/or
duplicated values should be ignored
public void setBindings(Binding bindings)
public void setBuilderConfig(ConfigObject builderConfig)
public void setConfig(ConfigObject config)
public void setEventPublishingEnabled(boolean enabled)
enabled
- the value fot the enabled state.
public void setEventsConfig(Object eventsConfig)
public void setLocale(Locale locale)
This is a bound property.
locale
- the Locale value to use
public boolean shutdown()
public void startup()
GriffonApplication valueOf(String name)
GriffonApplication valueOf(String name)
GriffonApplication valueOf(String name)
GriffonApplication[] values()
GriffonApplication[] values()
GriffonApplication[] values()
Groovy Documentation