Package org.apache.openjpa.enhance

Examples of org.apache.openjpa.enhance.PCEnhancer


                loader), t).setFatal(true);
        }
        // copy the BCClass into the enhancer project.
        bc = _enhProject.loadClass(new ByteArrayInputStream(bc.toByteArray()),
            loader);
        PCEnhancer enhancer = new PCEnhancer(_repos.getConfiguration(), bc,
            meta);

        int result = enhancer.run();
        if (result != PCEnhancer.ENHANCE_PC)
            throw new InternalException(_loc.get("interface-badenhance",
                iface)).setFatal(true);
        try{
            // load the class for real.
View Full Code Here


                loader), t).setFatal(true);
        }
        // copy the BCClass<?> into the enhancer project.
        bc = _enhProject.loadClass(new ByteArrayInputStream(bc.toByteArray()),
            loader);
        PCEnhancer enhancer = new PCEnhancer(_repos, bc, meta);

        int result = enhancer.run();
        if (result != PCEnhancer.ENHANCE_PC)
            throw new InternalException(_loc.get("interface-badenhance",
                iface)).setFatal(true);
        try {
            // load the Class<?> for real.
View Full Code Here

                loader), t).setFatal(true);
        }
        // copy the BCClass into the enhancer project.
        bc = _enhProject.loadClass(new ByteArrayInputStream(bc.toByteArray()),
            loader);
        PCEnhancer enhancer = new PCEnhancer(_repos, bc, meta);

        int result = enhancer.run();
        if (result != PCEnhancer.ENHANCE_PC)
            throw new InternalException(_loc.get("interface-badenhance",
                iface)).setFatal(true);
        try {
            // load the class for real.
View Full Code Here

                            final MetaDataRepository repos = new MetaDataRepository();
                            repos.setConfiguration(new OpenJPAConfigurationImpl());
                            repos.setMetaDataFactory(factory);

                            final BCClass type = new Project().loadClass(new ByteArrayInputStream(buffer), new URLClassLoader(new URL[0], getParent()));
                            final PCEnhancer enhancer = new PCEnhancer(repos.getConfiguration(), type, repos, this);
                            enhancer.setAddDefaultConstructor(true);
                            enhancer.setEnforcePropertyRestrictions(true);

                            if (enhancer.run() != PCEnhancer.ENHANCE_NONE) {
                                final BCClass pcb = enhancer.getPCBytecode();
                                final byte[] transformed = AsmAdaptor.toByteArray(pcb, pcb.toByteArray());
                                if (transformed != null) {
                                    buffer = transformed;
                                }
                            }
View Full Code Here

                loader), t).setFatal(true);
        }
        // copy the BCClass into the enhancer project.
        bc = _enhProject.loadClass(new ByteArrayInputStream(bc.toByteArray()),
            loader);
        PCEnhancer enhancer = new PCEnhancer(_repos, bc, meta);

        int result = enhancer.run();
        if (result != PCEnhancer.ENHANCE_PC)
            throw new InternalException(_loc.get("interface-badenhance",
                iface)).setFatal(true);
        try {
            // load the class for real.
View Full Code Here

TOP

Related Classes of org.apache.openjpa.enhance.PCEnhancer

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.