Package serp.bytecode

Examples of serp.bytecode.Project


        ApplicationIdTool tool;
        Class cls;
        ClassMetaData meta;
        BCClassLoader bc = AccessController
            .doPrivileged(J2DoPrivHelper.newBCClassLoaderAction(new Project()));
        for (Iterator itr = classes.iterator(); itr.hasNext();) {
            cls = (Class) itr.next();
            log.info(_loc.get("appid-running", cls));

            meta = repos.getMetaData(cls, null, false);
View Full Code Here


     * up the metadata for <code>type</code> from <code>conf</code>'s
     * repository.
     */
    public PCEnhancer(OpenJPAConfiguration conf, Class type) {
        this(conf, AccessController.doPrivileged(J2DoPrivHelper
            .loadProjectClassAction(new Project(), type)),
            (MetaDataRepository) null);
    }
View Full Code Here

     * up the metadata for <code>meta</code> by converting back to a class
     * and then loading from <code>conf</code>'s repository.
     */
    public PCEnhancer(OpenJPAConfiguration conf, ClassMetaData meta) {
        this(conf, AccessController.doPrivileged(J2DoPrivHelper
            .loadProjectClassAction(new Project(), meta.getDescribedType())),
            meta.getRepository());
    }
View Full Code Here

            classes = new HashSet();
            for (int i = 0; i < args.length; i++)
                classes.addAll(Arrays.asList(cap.parseTypes(args[i])));
        }

        Project project = new Project();
        BCClass bc;
        PCEnhancer enhancer;
        int status;
        for (Iterator itr = classes.iterator(); itr.hasNext();) {
            Object o = itr.next();
            if (log.isTraceEnabled())
                log.trace(_loc.get("enhance-running", o));

            if (o instanceof String)
                bc = project.loadClass((String) o, loader);
            else
                bc = project.loadClass((Class) o);
            enhancer = new PCEnhancer(conf, bc, repos, loader);
            if (writer != null)
                enhancer.setBytecodeWriter(writer);
            enhancer.setDirectory(flags.directory);
            enhancer.setAddDefaultConstructor(flags.addDefaultConstructor);
            status = enhancer.run();
            if (status == ENHANCE_NONE) {
                if (log.isTraceEnabled())
                    log.trace(_loc.get("enhance-norun"));
            } else if (status == ENHANCE_INTERFACE) {
                if (log.isTraceEnabled())
                    log.trace(_loc.get("enhance-interface"));
            } else if (status == ENHANCE_AWARE) {
                if (log.isTraceEnabled())
                    log.trace(_loc.get("enhance-aware"));
                enhancer.record();
            } else
                enhancer.record();
            project.clear();
        }
        return true;
    }
View Full Code Here

     * up the metadata for <code>type</code> from <code>conf</code>'s
     * repository.
     */
    public PCEnhancer(OpenJPAConfiguration conf, Class type) {
        this(conf, AccessController.doPrivileged(J2DoPrivHelper
            .loadProjectClassAction(new Project(), type)),
            (MetaDataRepository) null);
    }
View Full Code Here

     * up the metadata for <code>meta</code> by converting back to a class
     * and then loading from <code>conf</code>'s repository.
     */
    public PCEnhancer(OpenJPAConfiguration conf, ClassMetaData meta) {
        this(conf, AccessController.doPrivileged(J2DoPrivHelper
            .loadProjectClassAction(new Project(), meta.getDescribedType())),
            meta.getRepository());
    }
View Full Code Here

            classes = new HashSet();
            for (int i = 0; i < args.length; i++)
                classes.addAll(Arrays.asList(cap.parseTypes(args[i])));
        }

        Project project = new Project();
        BCClass bc;
        PCEnhancer enhancer;
        Collection persAwareClasses = new HashSet();
       
        int status;
        for (Iterator itr = classes.iterator(); itr.hasNext();) {
            Object o = itr.next();
            if (log.isInfoEnabled())
                log.info(_loc.get("enhance-running", o));

            if (o instanceof String)
                bc = project.loadClass((String) o, loader);
            else
                bc = project.loadClass((Class) o);
            enhancer = new PCEnhancer(conf, bc, repos, loader);
            if (writer != null)
                enhancer.setBytecodeWriter(writer);
            enhancer.setDirectory(flags.directory);
            enhancer.setAddDefaultConstructor(flags.addDefaultConstructor);
            status = enhancer.run();
            if (status == ENHANCE_NONE) {
                if (log.isTraceEnabled())
                    log.trace(_loc.get("enhance-norun"));
            } else if (status == ENHANCE_INTERFACE) {
                if (log.isTraceEnabled())
                    log.trace(_loc.get("enhance-interface"));
            } else if (status == ENHANCE_AWARE) {
                persAwareClasses.add(o);
                enhancer.record();
            } else {
                enhancer.record();
            }
            project.clear();
        }
        if(log.isInfoEnabled() && !persAwareClasses.isEmpty()){
          log.info(_loc.get("pers-aware-classes", persAwareClasses.size(), persAwareClasses));
        }
        return true;
View Full Code Here

     * the order (relative to the field metadata) of the constructor parameters.  If a match
     * is not found, returns null.
    */
    private int[] getIdClassConstructorParmOrder(Class<?> oidType, ArrayList<Integer> pkfields,
            FieldMetaData[] fmds) {
        Project project = new Project();
        BCClass bc = project.loadClass(oidType);
        BCMethod[] methods = bc.getDeclaredMethods("<init>");
        if (methods == null || methods.length == 0) {
            return null;
        }
       
View Full Code Here

                    enhance));
            if (enhance != Boolean.TRUE)
                return null;

            PCEnhancer enhancer = new PCEnhancer(_repos.getConfiguration(),
                new Project().loadClass(new ByteArrayInputStream(bytes),
                    _tmpLoader), _repos);
            enhancer.setAddDefaultConstructor(_flags.addDefaultConstructor);
            enhancer.setEnforcePropertyRestrictions
                (_flags.enforcePropertyRestrictions);
View Full Code Here

        ApplicationIdTool tool;
        Class cls;
        ClassMetaData meta;
        BCClassLoader bc = AccessController
            .doPrivileged(J2DoPrivHelper.newBCClassLoaderAction(new Project()));
        for (Iterator itr = classes.iterator(); itr.hasNext();) {
            cls = (Class) itr.next();
            log.info(_loc.get("appid-running", cls));

            meta = repos.getMetaData(cls, null, false);
View Full Code Here

TOP

Related Classes of serp.bytecode.Project

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.