GriffonApplicationHelper (Griffon 0.9.5-rc2)
Date: 2012-03-09

Overview | Package | Class | Deprecated | Index | Help
| Griffon 0.9.5-rc2
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.griffon.runtime.util
[Java] Class GriffonApplicationHelper

    java.lang.Object
      org.codehaus.griffon.runtime.util.GriffonApplicationHelper

    public class GriffonApplicationHelper
    extends Object

Utility class for bootstrapping an application and handling of MVC groups.

Authors:
  Danno Ferrin
  Andres Almiray

Field Summary
`private static String` | `DEFAULT_ADDON_MANAGER_FACTORY`
`private static String` | `DEFAULT_ARTIFACT_MANAGER_FACTORY`
`private static String` | `DEFAULT_MVCGROUP_MANAGER_FACTORY`
`private static Map` | `DEFAULT_PLATFORM_HANDLERS`
`private static String` | `KEY_ADDON_MANAGER_FACTORY`
`private static String` | `KEY_ARTIFACT_MANAGER_FACTORY`
`private static String` | `KEY_MVCGROUP_MANAGER_FACTORY`
`private static org.slf4j.Logger` | `LOG`

Constructor Summary
`GriffonApplicationHelper()`

Method Summary
`static void` | `applyPlatformTweaks(GriffonApplication app)`
`private static void` | `doRunLifecycleHandler(String handlerName, Class handlerClass, GriffonApplication app)`
`private static void` | `doRunScript(String scriptName, Class handlerClass, GriffonApplication app)`
`static void` | `enhance(GriffonApplication app, Class klass, MetaClass mc, Object instance)`
`static MetaClass` | `expandoMetaClassFor(Class clazz)` Creates, register and assigns an ExpandoMetaClass for a target class.
`private static void` | `initializeAddonManager(GriffonApplication app)`
`private static void` | `initializeArtifactManager(GriffonApplication app)`
`private static void` | `initializeMvcManager(GriffonApplication app)`
`private static void` | `loadArtifactHandlers(GriffonApplication app)`
`static Class` | `loadClass(String className)`
`private static ConfigObject` | `loadConfig(ConfigSlurper configSlurper, Class configClass, String configFileName)`
`static Object` | `newInstance(GriffonApplication app, Class klass)` Creates a new instance of the specified class.
`static Object` | `newInstance(GriffonApplication app, Class klass, String type)` Creates a new instance of the specified class.
`static void` | `prepare(GriffonApplication app)` Setups an application.
`private static void` | `readAndSetConfiguration(GriffonApplication app)`
`static void` | `runLifecycleHandler(String handlerName, GriffonApplication app)` Executes a script inside the UI Thread.
`static void` | `runScriptInsideUIThread(String scriptName, GriffonApplication app)` Executes a script inside the UI Thread.
`private static Object` | `safeNewInstance(String className)`
`private static Object` | `safeNewInstance(Class clazz)`

Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll

Field Detail

### DEFAULT_ADDON_MANAGER_FACTORY

    private static final String DEFAULT_ADDON_MANAGER_FACTORY

### DEFAULT_ARTIFACT_MANAGER_FACTORY

    private static final String DEFAULT_ARTIFACT_MANAGER_FACTORY

### DEFAULT_MVCGROUP_MANAGER_FACTORY

    private static final String DEFAULT_MVCGROUP_MANAGER_FACTORY

### DEFAULT_PLATFORM_HANDLERS

    private static final Map DEFAULT_PLATFORM_HANDLERS

### KEY_ADDON_MANAGER_FACTORY

    private static final String KEY_ADDON_MANAGER_FACTORY

### KEY_ARTIFACT_MANAGER_FACTORY

    private static final String KEY_ARTIFACT_MANAGER_FACTORY

### KEY_MVCGROUP_MANAGER_FACTORY

    private static final String KEY_MVCGROUP_MANAGER_FACTORY

### LOG

    private static final org.slf4j.Logger LOG

Constructor Detail

### GriffonApplicationHelper

    GriffonApplicationHelper()

Method Detail

### applyPlatformTweaks

    public static void applyPlatformTweaks(GriffonApplication app)

### doRunLifecycleHandler

    private static void doRunLifecycleHandler(String handlerName, Class handlerClass, GriffonApplication app)

### doRunScript

    private static void doRunScript(String scriptName, Class handlerClass, GriffonApplication app)

### enhance

    public static void enhance(GriffonApplication app, Class klass, MetaClass mc, Object instance)

### expandoMetaClassFor

    public static MetaClass expandoMetaClassFor(Class clazz)

  Creates, register and assigns an ExpandoMetaClass for a target class.

  The newly created metaClass will accept changes after initialization.

  Parameters:
    `clazz` - the target class
  Returns:
    an ExpandoMetaClass

### initializeAddonManager

    private static void initializeAddonManager(GriffonApplication app)

### initializeArtifactManager

    private static void initializeArtifactManager(GriffonApplication app)

### initializeMvcManager

    private static void initializeMvcManager(GriffonApplication app)

### loadArtifactHandlers

    private static void loadArtifactHandlers(GriffonApplication app)

### loadClass

    public static Class loadClass(String className)

### loadConfig

    private static ConfigObject loadConfig(ConfigSlurper configSlurper, Class configClass, String configFileName)

### newInstance

    public static Object newInstance(GriffonApplication app, Class klass)

  Creates a new instance of the specified class.

  Publishes a NewInstance event with the following arguments

  - klass - the target Class
  - type - the type of the instance (i.e, 'controller','service')
  - instance - the newly created instance
  Parameters:
    `app` - the current GriffonApplication
    `klass` - the target Class from which the instance will be created
  Returns:
    a newly created instance of type klass

### newInstance

    public static Object newInstance(GriffonApplication app, Class klass, String type)

  Creates a new instance of the specified class.

  Publishes a NewInstance event with the following arguments

  - klass - the target Class
  - type - the type of the instance (i.e, 'controller','service')
  - instance - the newly created instance
  Parameters:
    `app` - the current GriffonApplication
    `klass` - the target Class from which the instance will be created
    `type` - optional type parameter, used when publishing a 'NewInstance' event
  Returns:
    a newly created instance of type klass

### prepare

    public static void prepare(GriffonApplication app)

  Setups an application.

  This method performs the following tasks

  - Sets "griffon.start.dir" as system property.
  - Calls the Initialize life cycle script.
  - Reads runtime and builder configuration.
  - Setups basic artifact handlers.
  - Initializes available addons.
  Parameters:
    `app` - the current Griffon application

### readAndSetConfiguration

    private static void readAndSetConfiguration(GriffonApplication app)

### runLifecycleHandler

    public static void runLifecycleHandler(String handlerName, GriffonApplication app)

  Executes a script inside the UI Thread.

  On Swing this would be the Event Dispatch Thread.

### runScriptInsideUIThread

    @Deprecated
    public static void runScriptInsideUIThread(String scriptName, GriffonApplication app)

  Executes a script inside the UI Thread.

  On Swing this would be the Event Dispatch Thread.

  deprecated:
    use runLifecycleHandler instead

### safeNewInstance

    private static Object safeNewInstance(String className)

### safeNewInstance

    private static Object safeNewInstance(Class clazz)

Groovy Documentation