org.yasl.arch.impl.application
Class YASLApplicationImpl

java.lang.Object
  extended byorg.yasl.arch.impl.application.YASLApplicationImpl
All Implemented Interfaces:
YASLApplication
Direct Known Subclasses:
YASLGUIApplicationImpl

public class YASLApplicationImpl
extends Object
implements YASLApplication

Implements the YASLApplication interface.


Field Summary
 
Fields inherited from interface org.yasl.arch.application.YASLApplication
KEY_ACTION_APPLICATION_EXIT, KEY_ACTION_APPLICATION_START, KEY_ACTION_HANDLER, KEY_APPLICATION, KEY_ERROR_HANDLER, KEY_GUI_APP_ROOTPANE, KEY_PREFERENCES_MANAGER, KEY_RESOURCE_MANAGER, KEY_SWING_APP_FRAME
 
Constructor Summary
YASLApplicationImpl(YASLApplicationType appType)
          Creates a YASLApplication instance and sets the application type.
 
Method Summary
protected  YASLActionHandler createActionHandler()
          Creates an action handler that implements YASLActionHandler.
protected  YASLErrorHandler createErrorHandler()
          Creates an error handler that implements YASLErrorHandler.
 YASLActionHandler getActionHandler()
          Accessor for the actionhandler interface.
 YASLApplicationType getApplicationType()
          Returns application type, either gui, command line, or applet.
 YASLErrorHandler getErrorHandler()
          Returns the error handler for this application.
 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 keys used to map singletons.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

YASLApplicationImpl

public YASLApplicationImpl(YASLApplicationType appType)
Creates a YASLApplication instance and sets the application type.

Parameters:
appType - YASLApplicationType
Method Detail

createErrorHandler

protected YASLErrorHandler createErrorHandler()
Creates an error handler that implements YASLErrorHandler.

Returns:
YASLErrorHandler

createActionHandler

protected YASLActionHandler createActionHandler()
Creates an action handler that implements YASLActionHandler.

Returns:
YASLActionHandler

isInitialized

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

Specified by:
isInitialized in interface YASLApplication
Parameters:
errBuf - StringBuffer
Returns:
boolean

getActionHandler

public YASLActionHandler getActionHandler()
Accessor for the actionhandler interface.

Specified by:
getActionHandler in interface YASLApplication
Returns:
YASLActionHandler

getApplicationType

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

Specified by:
getApplicationType in interface YASLApplication
Returns:
YASLApplicationType

getErrorHandler

public YASLErrorHandler getErrorHandler()
Returns the error handler for this application.

Specified by:
getErrorHandler in interface YASLApplication
Returns:
YASLErrorHandler

getSingleton

public Object getSingleton(String key)
                    throws YASLApplicationException
Singletons are stored in a map with items accessed via a key.

Specified by:
getSingleton in interface YASLApplication
Parameters:
key - String
Returns:
Object
Throws:
YASLApplicationException

isSingletonMapped

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

Specified by:
isSingletonMapped in interface YASLApplication
Parameters:
key - String
Returns:
boolean

getSingletonKeys

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

Specified by:
getSingletonKeys in interface YASLApplication
Returns:
Set

setSingleton

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

Specified by:
setSingleton in interface YASLApplication
Parameters:
key - String
singleton - 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.

Specified by:
getResourceManager in interface YASLApplication
Returns:
YASLResourceManager

setResourceManager

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

Specified by:
setResourceManager in interface YASLApplication
Parameters:
rmanager - YASLResourceManager
Throws:
YASLApplicationException