jodd.petite.config
Class AutomagicPetiteConfigurator

java.lang.Object
  extended by jodd.io.findfile.FindClass
      extended by jodd.petite.config.AutomagicPetiteConfigurator
All Implemented Interfaces:
PetiteConfigurator

public class AutomagicPetiteConfigurator
extends jodd.io.findfile.FindClass
implements PetiteConfigurator

Auto-magically configures Petite container by analyzing the classpath.

Scans all classes on classpath and in jar files, and scans for PetiteBean annotation (not by loading the class!). If annotation is founded, class will be loaded and registered as Petite bean.


Nested Class Summary
 
Nested classes/interfaces inherited from class jodd.io.findfile.FindClass
jodd.io.findfile.FindClass.EntryData
 
Field Summary
protected  PetiteContainer container
           
protected  long elapsed
           
protected  byte[] petiteBeanAnnotationBytes
           
 
Fields inherited from class jodd.io.findfile.FindClass
excludedEntries, excludedJars, ignoreException, includedEntries, includedJars, includeResources, systemJars
 
Constructor Summary
AutomagicPetiteConfigurator()
           
 
Method Summary
 void configure(PetiteContainer petiteContainer)
          Configures PetiteContainer with default class path.
 void configure(PetiteContainer petiteContainer, java.net.URL[] classpath)
          Configures PetiteContainer with specified class path.
 long getElapsed()
          Return elapsed number of milliseconds for configuration.
protected  java.lang.Class loadClass(java.lang.String className)
          Loads class from classname using default classloader.
protected  void onEntry(jodd.io.findfile.FindClass.EntryData entryData)
          Scans all classes and registers only those annotated with PetiteBean.
 
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

petiteBeanAnnotationBytes

protected final byte[] petiteBeanAnnotationBytes

container

protected PetiteContainer container

elapsed

protected long elapsed
Constructor Detail

AutomagicPetiteConfigurator

public AutomagicPetiteConfigurator()
Method Detail

getElapsed

public long getElapsed()
Return elapsed number of milliseconds for configuration.


configure

public void configure(PetiteContainer petiteContainer,
                      java.net.URL[] classpath)
Configures PetiteContainer with specified class path.

See Also:
configure(jodd.petite.PetiteContainer)

configure

public void configure(PetiteContainer petiteContainer)
Configures PetiteContainer with default class path.

Specified by:
configure in interface PetiteConfigurator
See Also:
configure(jodd.petite.PetiteContainer, java.net.URL[])

onEntry

protected void onEntry(jodd.io.findfile.FindClass.EntryData entryData)
Scans all classes and registers only those annotated with PetiteBean. Because of performance purposes, classes are not dynamically loaded; instead, their file content is examined.

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

loadClass

protected java.lang.Class loadClass(java.lang.String className)
                             throws java.lang.ClassNotFoundException
Loads class from classname using default classloader.

Throws:
java.lang.ClassNotFoundException


Copyright © 2003-2010 Jodd Team