protected void log(int level, String msg, Object[] params) { ((oracle.toplink.essentials.internal.sessions.AbstractSession)session).log(level, SessionLog.WEAVER, msg, params); } }
/** * Log a untranslated message to the TopLink log at FINER level. */ public void logMessage(String message) { log(SessionLog.FINER, message, (Object[])null, null, false); }
/** * PUBLIC: * <p> * This method is called when a fine level message needs to be logged. * The message will be translated * </p><p> * * @param message the message key * </p> */ public void fine(String message, String category) { log(SessionLog.FINE, category, message); }
void logDefault(AbstractSession session, String suffix) { if(session != null) { String propertyName = name; if(suffix != null) { propertyName = propertyName + suffix; } if(defaultValue != defaultValueToApply) { session.log(SessionLog.FINEST, SessionLog.PROPERTIES, "handler_property_value_default", new Object[]{propertyName, defaultValue, defaultValueToApply}); } else { session.log(SessionLog.FINEST, SessionLog.PROPERTIES, "property_value_default", new Object[]{propertyName, defaultValue}); } } }
/** * PUBLIC: * <p> * This method is called when a info level message needs to be logged. * The message will be translated * </p><p> * * @param message the message key * </p> */ public void info(String message, String category) { log(SessionLog.INFO, category, message); }
/** * PUBLIC: * <p> * This method is called when a config level message needs to be logged. * The message will be translated * </p><p> * * @param message the message key * </p> */ public void config(String message, String category) { log(SessionLog.CONFIG, category, message); }
/** * PUBLIC: * <p> * This method is called when a warning level message needs to be logged. * The message will be translated * </p><p> * * @param message the message key * </p> */ public void warning(String message, String category) { log(SessionLog.WARNING, category, message); }
/** * PUBLIC: * <p> * This method is called when a finer level message needs to be logged. * The message will be translated * </p><p> * * @param message the message key * </p> */ public void finer(String message, String category) { log(SessionLog.FINER, category, message); }
public static void warnOldProperties(Map m, AbstractSession session) { for(int i=0; i < oldPropertyNames.length; i++) { Object value = m.get(oldPropertyNames[i][1]); if(value != null) { session.log(SessionLog.INFO, SessionLog.TRANSACTION, "deprecated_property", oldPropertyNames[i]); } } }
/** * INTERNAL: * Logging utility method. */ public void log(int level, String ctx, Object[] params) { session.log(level, SessionLog.EJB_OR_METADATA, getLoggingContextString(ctx), params); }
public static String getConfigPropertyAsStringLogDebug(String propertyKey, Map overrides, String defaultValue, AbstractSession session){ String value = getConfigPropertyAsStringLogDebug(propertyKey, overrides, session); if (value == null){ value = defaultValue; session.log(SessionLog.FINEST, SessionLog.PROPERTIES, "property_value_default", new Object[]{propertyKey, value}); } return value; }
protected void logDebugLocalPreallocation(AbstractSession writeSession, String seqName, Vector sequences, Accessor accessor) { if (writeSession.shouldLog(SessionLog.FINEST, SessionLog.SEQUENCING)) { Object[] args = { seqName, new Integer(sequences.size()), sequences.firstElement(), sequences.lastElement() }; writeSession.log(SessionLog.FINEST, SessionLog.SEQUENCING, "sequencing_localPreallocation", args, accessor); } }
static void verify(String hintName, boolean shouldUseDefault, Object hintValue, String queryName, AbstractSession session) { Hint hint = (Hint)mainMap.get(hintName); if(hint == null) { if(session != null) { session.log(SessionLog.FINEST, SessionLog.QUERY, "unknown_query_hint", new Object[]{getPrintValue(queryName), hintName}); } return; } hint.verify(hintValue, shouldUseDefault, queryName, session); }
public void logTxStateTrace(AbstractSession session, String msgInd, Object status) { if (session.shouldLog(SessionLog.FINER, SessionLog.TRANSACTION)) { String statusString = statusToString_impl(status); Object[] args = { statusString }; session.log(SessionLog.FINER, SessionLog.TRANSACTION, msgInd, args); } }
public void iterate(Object object) { if (!containsObjectInIdentityMap(IdentityMapAccessor.this.session.getDescriptor(object.getClass()).getObjectBuilder().extractPrimaryKeyFromObject(object, IdentityMapAccessor.this.getSession()), object.getClass())) { IdentityMapAccessor.this.session.log(SessionLog.FINEST, SessionLog.CACHE, "stack_of_visited_objects_that_refer_to_the_corrupt_object", getVisitedStack()); IdentityMapAccessor.this.session.log(SessionLog.FINER, SessionLog.CACHE, "corrupt_object_referenced_through_mapping", getCurrentMapping()); IdentityMapAccessor.this.session.log(SessionLog.FINER, SessionLog.CACHE, "corrupt_object", object); } } };
/** * INTERNAL: * Return a unit of work for this session not registered with the JTS transaction. */ public UnitOfWorkImpl acquireNonSynchronizedUnitOfWork() { setNumberOfActiveUnitsOfWork(getNumberOfActiveUnitsOfWork() + 1); UnitOfWorkImpl unitOfWork = new UnitOfWorkImpl(this); if (shouldLog(SessionLog.FINER, SessionLog.TRANSACTION)) { log(SessionLog.FINER, SessionLog.TRANSACTION, "acquire_unit_of_work_with_argument", String.valueOf(System.identityHashCode(unitOfWork))); } return unitOfWork; }
/** * PUBLIC: * Reset the identity map for only the instances of the class. * For inheritance the user must make sure that they only use the root class. * Caution must be used in doing this to ensure that the objects within the identity map * are not referenced from other objects of other classes or from the application. */ public void initializeIdentityMap(Class theClass) { getSession().log(SessionLog.FINER, SessionLog.CACHE, "initialize_identitymap", theClass); getIdentityMapManager().initializeIdentityMap(theClass); }
void verify(Object hintValue, boolean shouldUseDefault, String queryName, AbstractSession session) { if(shouldUseDefault) { hintValue = defaultValue; } if(session != null) { session.log(SessionLog.FINEST, SessionLog.QUERY, "query_hint", new Object[]{getPrintValue(queryName), name, getPrintValue(hintValue)}); } if(!shouldUseDefault && valueMap != null && !valueMap.containsKey(getUpperCaseString(hintValue))) { throw new IllegalArgumentException(ExceptionLocalization.buildMessage("ejb30-wrong-query-hint-value",new Object[]{getPrintValue(queryName), name, getPrintValue(hintValue)})); } }
/** * Attempt to save some of the cost associated with getting a fresh connection. * Assume the DatabaseDriver has been cached, if appropriate. * Note: Connections that are participating in transactions will not be refreshd.^M */ protected void reconnect(AbstractSession session) throws DatabaseException { session.log(SessionLog.FINEST, SessionLog.CONNECTION, "reconnecting_to_external_connection_pool"); session.startOperationProfile(SessionProfiler.CONNECT); connect(getLogin()); session.endOperationProfile(SessionProfiler.CONNECT); }
/** * PUBLIC: * Reset the entire local object cache. * This throws away any objects that have been read in. * Extream caution should be used before doing this because object identity will no longer * be maintained for any objects currently read in. This should only be called * if the application knows that it no longer has references to object held in the cache. */ public void initializeIdentityMaps() { getSession().log(SessionLog.FINER, SessionLog.CACHE, "initialize_identitymaps"); getIdentityMapManager().initializeIdentityMaps(); getSession().getCommitManager().reinitialize(); }