Examples of EnhancerUserException


Examples of org.apache.jdo.impl.enhancer.EnhancerUserException

            cc = new Controller(cf, env);

            // get real class name
            final String className = cf.classNameString();
        } catch (ClassFormatError ex) {
            throw new EnhancerUserException(
                getI18N("enhancer.class_format_error"),
                ex);
        }

        // enhance class
        cc.enhanceClass();
        if (env.errorCount() > 0) {
            // retrieve error messages
            env.getErrorWriter().flush();

            throw new EnhancerUserException(env.getLastErrorMessage());
        }
        affirm(env.errorCount() == 0);

        // write class
        boolean changed = cc.updated();
        try {
            if (changed) {
                env.message("writing enhanced class " + cf.userClassName()
                            + " to output stream");
            } else {
                env.message("no changes to class " + cf.userClassName());
            }
            outClassFile.setClassName(cf.userClassName());
            final DataOutputStream dos
                = new DataOutputStream(outClassFile.getStream());
            cf.write(dos);
            dos.flush();
        } catch (IOException ex) {
            throw new EnhancerUserException(
                getI18N("enhancer.io_error_while_writing_stream"),
                ex);
        }
        return changed;
    }
View Full Code Here

Examples of org.apache.jdo.impl.enhancer.EnhancerUserException

        } catch (EnhancerMetaDataUserException ex) {
            // note: catch EnhancerMetaDataUserException before RuntimeException

            // reset environment to clear class map etc.
            env.reset();
            throw new EnhancerUserException(
                getI18N("enhancer.error", ex.getMessage()),
                ex);
        } catch (RuntimeException ex) {
            // reset environment to clear class map etc.
            env.reset();
View Full Code Here

Examples of org.apache.jdo.impl.enhancer.EnhancerUserException

            cc = new Controller(cf, env);

            // get real class name
            final String className = cf.classNameString();
        } catch (ClassFormatError ex) {
            throw new EnhancerUserException(
                getI18N("enhancer.class_format_error"),
                ex);
        }

        // enhance class
        cc.enhanceClass();
        if (env.errorCount() > 0) {
            // retrieve error messages
            env.getErrorWriter().flush();

            throw new EnhancerUserException(env.getLastErrorMessage());
        }
        affirm(env.errorCount() == 0);

        // write class
        boolean changed = cc.updated();
        try {
            if (changed) {
                env.message("writing enhanced class " + cf.userClassName()
                            + " to output stream");
            } else {
                env.message("no changes to class " + cf.userClassName());
            }
            outClassFile.setClassName(cf.userClassName());
            final DataOutputStream dos
                = new DataOutputStream(outClassFile.getStream());
            cf.write(dos);
            dos.flush();
        } catch (IOException ex) {
            throw new EnhancerUserException(
                getI18N("enhancer.io_error_while_writing_stream"),
                ex);
        }
        return changed;
    }
View Full Code Here

Examples of org.apache.jdo.impl.enhancer.EnhancerUserException

        } catch (EnhancerMetaDataUserException ex) {
            // note: catch EnhancerMetaDataUserException before RuntimeException

            // reset environment to clear class map etc.
            env.reset();
            throw new EnhancerUserException(
                getI18N("enhancer.error", ex.getMessage()),
                ex);
        } catch (RuntimeException ex) {
            // reset environment to clear class map etc.
            env.reset();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.