org.yasl.arch.application
Interface YASLApplication

All Known Subinterfaces:
YASLGUIApplication, YASLSwingApplication
All Known Implementing Classes:
YASLApplicationImpl, YASLGUIApplicationImpl, YASLSwingApplicationImpl

public interface YASLApplication

Base interface for all application types.

See Also:
YASLApplicationType

Field Summary
static String KEY_ACTION_APPLICATION_EXIT
          Standard key used for storing and accessing the action invoked for application exit.
static String KEY_ACTION_APPLICATION_START
          Standard key used for storing and accessing the action invoked for application initialization.
static String KEY_ACTION_HANDLER
          Standard key used for storing and accessing the action handler.
static String KEY_APPLICATION
          Standard key used for storing and accessing the application instance.
static String KEY_ERROR_HANDLER
          Standard key used for storing and accessing the error handler.
static String KEY_GUI_APP_ROOTPANE
          Standard key used for storing and accessing the JRootPane object.
static String KEY_PREFERENCES_MANAGER
          Standard key used for storing and accessing the preferences manager.
static String KEY_RESOURCE_MANAGER
          Standard key used for storing and accessing the resource manager.
static String KEY_SWING_APP_FRAME
          Standard key used for storing and accessing the swing app frame object.
 
Method Summary
 YASLActionHandler getActionHandler()
          Returns the action handler using the standard action handler key.
 YASLApplicationType getApplicationType()
          Returns application type, either gui, command line, or applet.
 YASLErrorHandler getErrorHandler()
          Returns the error handler using the standard error handler key.
 YASLResourceManager getResourceManager()
          Returns the resource manager using the standard resource manager key.
 Object getSingleton(String key)
          Singletons are stored in a map with items accessed via a key.
 Set getSingletonKeys()
          Returns a non-modifiable set of the keys used to map singletons in the application.
 boolean isInitialized(StringBuffer errBuf)
          Returns true if the application object is fully initialized.
 boolean isSingletonMapped(String key)
          Returns true if a singleton is mapped to the passed key.
 void setResourceManager(YASLResourceManager rmanager)
          Sets the resource manager using the standard resource manager key.
 void setSingleton(String key, Object singleton)
          Maps an application-specific object to a key.
 

Field Detail

KEY_GUI_APP_ROOTPANE

public static final String KEY_GUI_APP_ROOTPANE
Standard key used for storing and accessing the JRootPane object.

See Also:
Constant Field Values

KEY_SWING_APP_FRAME

public static final String KEY_SWING_APP_FRAME
Standard key used for storing and accessing the swing app frame object.

See Also:
Constant Field Values

KEY_PREFERENCES_MANAGER

public static final String KEY_PREFERENCES_MANAGER
Standard key used for storing and accessing the preferences manager.

See Also:
Constant Field Values

KEY_ACTION_HANDLER

public static final String KEY_ACTION_HANDLER
Standard key used for storing and accessing the action handler.

See Also:
Constant Field Values

KEY_RESOURCE_MANAGER

public static final String KEY_RESOURCE_MANAGER
Standard key used for storing and accessing the resource manager.

See Also:
Constant Field Values

KEY_APPLICATION

public static final String KEY_APPLICATION
Standard key used for storing and accessing the application instance.

See Also:
Constant Field Values

KEY_ERROR_HANDLER

public static final String KEY_ERROR_HANDLER
Standard key used for storing and accessing the error handler.

See Also:
Constant Field Values

KEY_ACTION_APPLICATION_EXIT

public static final String KEY_ACTION_APPLICATION_EXIT
Standard key used for storing and accessing the action invoked for application exit.

See Also:
Constant Field Values

KEY_ACTION_APPLICATION_START

public static final String KEY_ACTION_APPLICATION_START
Standard key used for storing and accessing the action invoked for application initialization. This action will be invoked after singletons and actions have been set.

See Also:
Constant Field Values
Method Detail

getActionHandler

public YASLActionHandler getActionHandler()
Returns the action handler using the standard action handler key. If the action handler has not been set when this method is called, the default action handler will be set.

For most applications the default action handler is sufficient.

Returns:
YASLActionHandler

getSingleton

public Object getSingleton(String key)
                    throws YASLApplicationException
Singletons are stored in a map with items accessed via a key. These can be any type of application-specific object.

Parameters:
key - String
Returns:
Object
Throws:
YASLApplicationException

getResourceManager

public YASLResourceManager getResourceManager()
Returns the resource manager using the standard resource manager key. If the resource manager has not been set when this method is called, a default resource manager will be set.

Returns:
YASLResourceManager

setResourceManager

public void setResourceManager(YASLResourceManager rmanager)
                        throws YASLApplicationException
Sets the resource manager using the standard resource manager key.

Parameters:
rmanager - YASLResourceManager
Throws:
YASLApplicationException

isSingletonMapped

public boolean isSingletonMapped(String key)
Returns true if a singleton is mapped to the passed key.

Parameters:
key - String
Returns:
boolean

setSingleton

public void setSingleton(String key,
                         Object singleton)
                  throws YASLApplicationException
Maps an application-specific object to a key.

Parameters:
key - String
singleton - Object
Throws:
YASLApplicationException

getSingletonKeys

public Set getSingletonKeys()
Returns a non-modifiable set of the keys used to map singletons in the application.

Returns:
Set

getApplicationType

public YASLApplicationType getApplicationType()
Returns application type, either gui, command line, or applet.

Returns:
YASLApplicationType

getErrorHandler

public YASLErrorHandler getErrorHandler()
Returns the error handler using the standard error handler key. If the error handler has not been set when this method is called, a default error handler will be set.

Returns:
YASLErrorHandler

isInitialized

public boolean isInitialized(StringBuffer errBuf)
Returns true if the application object is fully initialized. Error information will be written to the errBuf.

Parameters:
errBuf - StringBuffer
Returns:
boolean