jodd.madvoc.config
Class AutomagicMadvocConfigurator

java.lang.Object
  extended by jodd.io.findfile.FindClass
      extended by jodd.madvoc.config.AutomagicMadvocConfigurator
All Implemented Interfaces:
MadvocConfigurator

public class AutomagicMadvocConfigurator
extends jodd.io.findfile.FindClass
implements MadvocConfigurator

Default Madvoc configurator uses auto-magic to configure WebApplication. It searches the class path for all classes which names ends with 'Action' and 'Result' suffixes. Each such class will be loaded and introspected to determine if it represents valid Madvoc entity and then registered into the web application.

Action class is scanned for the MadvocAction. All public methods with Action are registered as Madvoc actions.


Nested Class Summary
 
Nested classes/interfaces inherited from class jodd.io.findfile.FindClass
jodd.io.findfile.FindClass.EntryData
 
Field Summary
protected  java.lang.String actionClassSuffix
           
protected  ActionsManager actionsManager
           
protected  long elapsed
           
protected  java.lang.String resultClassSuffix
           
protected  ResultsManager resultsManager
           
 
Fields inherited from class jodd.io.findfile.FindClass
excludedEntries, excludedJars, ignoreException, includedEntries, includedJars, includeResources, systemJars
 
Constructor Summary
AutomagicMadvocConfigurator()
           
 
Method Summary
 boolean checkClass(java.lang.Class clazz)
          Determines if class should be examined for Madvoc annotations.
 void configure()
          Configures web application from system classpath
 void configure(java.net.URL[] classpath)
          Configures web application from specified classpath.
protected  void onActionClass(java.lang.String className)
          Builds action configuration on founded action class.
protected  void onEntry(jodd.io.findfile.FindClass.EntryData entryData)
          Parses class name that matches madvoc-related names.
protected  void onResultClass(java.lang.String className)
          Loads madvoc result from founded ActionResult instance.
 
Methods inherited from class jodd.io.findfile.FindClass
acceptEntry, acceptJar, getExcludedEntries, getExcludedJars, getIncludedEntries, getIncludedJars, getSystemJars, getTypeSignatureBytes, isTypeSignatureInUse, prepareEntryName, scanClassFile, scanClassPath, scanEntry, scanJarFile, scanPath, scanPath, scanPaths, scanPaths, scanUrl, scanUrls, setExcludedEntries, setExcludedJars, setIncludedEntries, setIncludedJars, setSystemJars
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

actionsManager

@PetiteInject
protected ActionsManager actionsManager

resultsManager

@PetiteInject
protected ResultsManager resultsManager

actionClassSuffix

protected java.lang.String actionClassSuffix

resultClassSuffix

protected java.lang.String resultClassSuffix

elapsed

protected long elapsed
Constructor Detail

AutomagicMadvocConfigurator

public AutomagicMadvocConfigurator()
Method Detail

configure

public void configure()
Configures web application from system classpath

Specified by:
configure in interface MadvocConfigurator
See Also:
configure(java.net.URL[])

configure

public void configure(java.net.URL[] classpath)
Configures web application from specified classpath. The whole process is done in the following steps:
  1. scanning web application classpath
  2. invoking external configurations, if exist
  3. applying defaults

See Also:
configure()

onEntry

protected void onEntry(jodd.io.findfile.FindClass.EntryData entryData)
Parses class name that matches madvoc-related names.

Specified by:
onEntry in class jodd.io.findfile.FindClass

checkClass

public boolean checkClass(java.lang.Class clazz)
Determines if class should be examined for Madvoc annotations. Array, anonymouse, primitive, interfaces and so on should be ignored.


onActionClass

protected void onActionClass(java.lang.String className)
                      throws java.lang.ClassNotFoundException
Builds action configuration on founded action class. Action classes are annotated with MadvocAction annotation or extends a class annotated with the same annotation.

Throws:
java.lang.ClassNotFoundException

onResultClass

protected void onResultClass(java.lang.String className)
                      throws java.lang.ClassNotFoundException
Loads madvoc result from founded ActionResult instance.

Throws:
java.lang.ClassNotFoundException


Copyright © 2003-2010 Jodd Team