Package org.apache.openjpa.lib.log

Examples of org.apache.openjpa.lib.log.Log


    /**
     * Parse flush-mode element.
     */
    private boolean startFlushMode(Attributes attrs)
        throws SAXException {
        Log log = getLog();
        if (log.isWarnEnabled())
            log.warn(_loc.get("unsupported", "flush-mode", getSourceName()));
        return false;
    }
View Full Code Here


    protected boolean startSequenceGenerator(Attributes attrs) {
        if (!isMappingOverrideMode())
            return false;

        String name = attrs.getValue("name");
        Log log = getLog();
        if (log.isTraceEnabled())
            log.trace(_loc.get("parse-sequence", name));

        SequenceMetaData meta = getRepository().getCachedSequenceMetaData(name);
        if (meta != null && log.isWarnEnabled())
            log.warn(_loc.get("override-sequence", name));

        meta = getRepository().addSequenceMetaData(name);
        String seq = attrs.getValue("sequence-name");
        // Do not normalize the sequence name if it appears to be a plugin
        if (seq.indexOf('(') == -1){
View Full Code Here

        throws SAXException {
        if (!isQueryMode())
            return false;

        String name = attrs.getValue("name");
        Log log = getLog();
        if (log.isTraceEnabled())
            log.trace(_loc.get("parse-query", name));

        QueryMetaData meta = getRepository().searchQueryMetaDataByName(name);
        if (meta != null) {
          Class<?> defType = meta.getDefiningType();
            if ((defType != _cls) && log.isWarnEnabled()) {
                log.warn(_loc.get("dup-query", name, currentLocation(),
                      defType));
            }
            pushElement(meta);
            return true;
        }
View Full Code Here

        throws SAXException {
        if (!isQueryMode())
            return false;

        String name = attrs.getValue("name");
        Log log = getLog();
        if (log.isTraceEnabled())
            log.trace(_loc.get("parse-native-query", name));

        QueryMetaData meta = getRepository().getCachedQueryMetaData(name);
        if (meta != null && isDuplicateQuery(meta) ) {
            log.warn(_loc.get("override-query", name, currentLocation()));
        }

        meta = getRepository().addQueryMetaData(null, name);
        meta.setDefiningType(_cls);
        meta.setLanguage(QueryLanguages.LANG_SQL);
View Full Code Here

            // security manager might disallow
        }

        _globals = true;
        if (provider == null) {
            Log log = getConfigurationLog();
            if (log.isTraceEnabled())
                log.trace(_loc.get("no-default-providers"));
            return false;
        }
        return true;
    }
View Full Code Here

        if (propName != null &&
           (propName.startsWith("java.") || propName.startsWith("javax.persistence")|| propName.startsWith("sun.")))
            return;
        if (!isInvalidProperty(propName))
            return;
        Log log = getConfigurationLog();
        if (log == null || !log.isWarnEnabled())
            return;

        // try to find the closest string to the invalid property
        // so that we can provide a hint in case of a misspelling
        String closest = StringDistance.getClosestLevenshteinDistance
            (propName, newPropertyList(), 15);

        if (closest == null)
            log.warn(_loc.get("invalid-property", propName));
        else
            log.warn(_loc.get("invalid-property-hint", propName, closest));
    }
View Full Code Here

    {
        Object obj = newInstance(_name, type, conf, fatal);
       
        // ensure plugin value is compatible with plugin type
        if (obj != null && !type.isAssignableFrom(obj.getClass())) {
            Log log = (conf == null || type.equals(LogFactory.class)) ? null : conf.getConfigurationLog();
            String msg = getIncompatiblePluginMessage(obj, type);
            if (log != null && log.isErrorEnabled()) {
              log.error(msg);
            }
            if (fatal) {
              throw new ParseException(msg);
            }
            return null;
View Full Code Here

        }

        if (cls == null) {
            if (fatal)
              throw getCreateException(clsName, val, new ClassNotFoundException(clsName));
            Log log = (conf == null) ? null : conf.getConfigurationLog();
          if (log != null && log.isErrorEnabled())
              log.error(_loc.get("plugin-creation-exception", val));
          return null;
       }

        try {
            return AccessController.doPrivileged(J2DoPrivHelper.newInstanceAction(cls));
        } catch (Exception e) {
            if (e instanceof PrivilegedActionException) {
                e = ((PrivilegedActionException) e).getException();  
            }
            RuntimeException re = new NestableRuntimeException(_loc.get("obj-create", cls).getMessage(), e);
            if (fatal)
                throw re;
            Log log = (conf == null) ? null : conf.getConfigurationLog();
            if (log != null && log.isErrorEnabled())
                log.error(_loc.get("plugin-creation-exception", val), re);
            return null;
        }
    }
View Full Code Here

        for (Iterator itr = pj.joins().iterator(); itr.hasNext();) {
            join = (Join) itr.next();
            if (join.getType() == Join.TYPE_INNER) {
                if (join.getForeignKey() != null
                    && !_dict.canOuterJoin(_joinSyntax, join.getForeignKey())) {
                    Log log = _conf.getLog(JDBCConfiguration.LOG_JDBC);
                    if (log.isWarnEnabled())
                        log.warn(_loc.get("cant-outer-fk",
                            join.getForeignKey()));
                } else
                    join.setType(Join.TYPE_OUTER);
            }
            if (add)
View Full Code Here

    /**
     * Parse table-generator.
     */
    private boolean startTableGenerator(Attributes attrs) {
        String name = attrs.getValue("name");
        Log log = getLog();
        if (log.isTraceEnabled())
            log.trace(_loc.get("parse-gen", name));
        if (getRepository().getCachedSequenceMetaData(name) != null
            && log.isWarnEnabled())
            log.warn(_loc.get("override-gen", name));

        SequenceMapping seq = (SequenceMapping) getRepository().
            addSequenceMetaData(name);
        seq.setSequencePlugin(SequenceMapping.IMPL_VALUE_TABLE);
        seq.setTableIdentifier(toTableIdentifier(attrs.getValue("schema"),
View Full Code Here

TOP

Related Classes of org.apache.openjpa.lib.log.Log

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.