FileDocCategorySizeDatePackage
StaticWeaver.javaAPI DocGlassfish v2 API3920Tue May 22 16:54:18 BST 2007oracle.toplink.essentials.ejb.cmp3

StaticWeaver

public class StaticWeaver extends Object
Utility used to statically weave entities for use in TopLink EJB 3.0 The main method of this class should be invoked with the -javaagent tag to initiate weaving. The following system arguments should be provided: -javaagent: -Dtoplink.weaving.output.path= -Dtoplink.validation-only=true -Dtoplink.weaving.overwrite.existing=true if you wish the output of static weaving to overwrite existing classes Weaving will occur for all persistence units found on the classpath.

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)
This method will search for all of the persistence archives on the classpath and weave all the classes associated with those persistence units.

        Set<Archive> pars = PersistenceUnitProcessor.findPersistenceArchives();
        Iterator<Archive> parIterator = pars.iterator();
        while (parIterator.hasNext()){
            List<SEPersistenceUnitInfo> puInfoList = PersistenceUnitProcessor.getPersistenceUnits(parIterator.next(), Thread.currentThread().getContextClassLoader());
            Iterator<SEPersistenceUnitInfo> puInfoListIterator = puInfoList.iterator();
            while (puInfoListIterator.hasNext()){
                Persistence.createEntityManagerFactory(puInfoListIterator.next().getPersistenceUnitName());
            }
        }