Package serp.bytecode

Examples of serp.bytecode.Project


    static final String INTERFACE =
        "com.ibm.websphere.jtaextensions.SynchronizationCallback";

    public static void main(String[] args)
        throws IOException {
        Project project = new Project();
       
        InputStream in = WASManagedRuntime.class.getClassLoader()
            .getResourceAsStream(CLASS.replace('.', '/') + ".class");
        BCClass bcClass = project.loadClass(in);
       
        String [] interfaces = bcClass.getInterfaceNames();
       
        if(interfaces != null) {
          for(int i = 0; i < interfaces.length; i++) {
View Full Code Here


     * Generate the bytecode for a collection proxy for the given type.
     */
    protected BCClass generateProxyCollectionBytecode(Class type,
        boolean runtime) {
        assertNotFinal(type);
        Project project = new Project();
        BCClass bc = AccessController.doPrivileged(J2DoPrivHelper
            .loadProjectClassAction(project, getProxyClassName(type, runtime)));
        bc.setSuperclass(type);
        bc.declareInterface(ProxyCollection.class);
View Full Code Here

    /**
     * Generate the bytecode for a map proxy for the given type.
     */
    protected BCClass generateProxyMapBytecode(Class type, boolean runtime) {
        assertNotFinal(type);
        Project project = new Project();
        BCClass bc = AccessController.doPrivileged(J2DoPrivHelper
            .loadProjectClassAction(project, getProxyClassName(type, runtime)));
        bc.setSuperclass(type);
        bc.declareInterface(ProxyMap.class);
View Full Code Here

    /**
     * Generate the bytecode for a date proxy for the given type.
     */
    protected BCClass generateProxyDateBytecode(Class type, boolean runtime) {
        assertNotFinal(type);
        Project project = new Project();
        BCClass bc = AccessController.doPrivileged(J2DoPrivHelper
            .loadProjectClassAction(project, getProxyClassName(type, runtime)));
        bc.setSuperclass(type);
        bc.declareInterface(ProxyDate.class);
View Full Code Here

     * Generate the bytecode for a calendar proxy for the given type.
     */
    protected BCClass generateProxyCalendarBytecode(Class type,
        boolean runtime) {
        assertNotFinal(type);
        Project project = new Project();
        BCClass bc = AccessController.doPrivileged(J2DoPrivHelper
            .loadProjectClassAction(project, getProxyClassName(type, runtime)));
        bc.setSuperclass(type);
        bc.declareInterface(ProxyCalendar.class);
View Full Code Here

                    cons = cs[i];
            if (cons == null)
                return null;
        }

        Project project = new Project();
        BCClass bc = AccessController.doPrivileged(J2DoPrivHelper
            .loadProjectClassAction(project, getProxyClassName(type, runtime)));
        bc.setSuperclass(type);
        bc.declareInterface(ProxyBean.class);
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

        if (numParams == 0)
            return null;

        // Try to obtain a tt-bytecode class object
        BCClass bclass = (BCClass)ttClassCache.get(c);
        Project project = new Project();
        if(bclass == null) {
            bclass = project.loadClass(c);
            ttClassCache.put(c, bclass);
        }

        // Obtain the exact method we're interested in.
        BCMethod bmeth = bclass.getDeclaredMethod(method.getName(),
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.