mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
migrate from JUL to SLF4j
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package com.avaje.ebeaninternal.api;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Wraps the caller and context class loaders.
|
||||
@@ -14,7 +14,7 @@ import java.util.logging.Logger;
|
||||
*/
|
||||
class ClassLoadContext {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(ClassLoadContext.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(ClassLoadContext.class);
|
||||
|
||||
private final ClassLoader callerLoader;
|
||||
|
||||
@@ -67,35 +67,35 @@ class ClassLoadContext {
|
||||
public ClassLoader getDefault(boolean preferContext) {
|
||||
|
||||
if (contextLoader == null){
|
||||
if (logger.isLoggable(Level.FINE)){
|
||||
logger.fine("No Context ClassLoader, using "+callerLoader.getClass().getName());
|
||||
if (logger.isDebugEnabled()){
|
||||
logger.debug("No Context ClassLoader, using "+callerLoader.getClass().getName());
|
||||
}
|
||||
return callerLoader;
|
||||
}
|
||||
if (contextLoader == callerLoader){
|
||||
if (logger.isLoggable(Level.FINE)){
|
||||
logger.fine("Context and Caller ClassLoader's same instance of "+contextLoader.getClass().getName());
|
||||
if (logger.isDebugEnabled()){
|
||||
logger.debug("Context and Caller ClassLoader's same instance of "+contextLoader.getClass().getName());
|
||||
}
|
||||
return callerLoader;
|
||||
}
|
||||
|
||||
if (isChild(contextLoader, callerLoader)) {
|
||||
if (logger.isLoggable(Level.FINE)){
|
||||
logger.info("Caller ClassLoader "+callerLoader.getClass().getName()
|
||||
if (logger.isDebugEnabled()){
|
||||
logger.debug("Caller ClassLoader "+callerLoader.getClass().getName()
|
||||
+" child of ContextLoader "+contextLoader.getClass().getName());
|
||||
}
|
||||
return callerLoader;
|
||||
|
||||
} else if (isChild(callerLoader, contextLoader)) {
|
||||
if (logger.isLoggable(Level.FINE)){
|
||||
logger.info("Context ClassLoader "+contextLoader.getClass().getName()
|
||||
if (logger.isDebugEnabled()){
|
||||
logger.debug("Context ClassLoader "+contextLoader.getClass().getName()
|
||||
+" child of Caller ClassLoader "+callerLoader.getClass().getName());
|
||||
}
|
||||
return contextLoader;
|
||||
|
||||
} else {
|
||||
// ambiguous case, perhaps both null
|
||||
logger.info("Ambiguous ClassLoader choice preferContext:"+preferContext
|
||||
logger.debug("Ambiguous ClassLoader choice preferContext:"+preferContext
|
||||
+" Context:"+contextLoader.getClass().getName()+" Caller:"+callerLoader.getClass().getName());
|
||||
ambiguous = true;
|
||||
return preferContext ? contextLoader : callerLoader;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package com.avaje.ebeaninternal.api;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Helper to find classes taking into account the context class loader.
|
||||
@@ -10,7 +11,7 @@ import java.util.logging.Logger;
|
||||
*/
|
||||
public class ClassUtil {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(ClassUtil.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(ClassUtil.class);
|
||||
|
||||
private static boolean preferContext = true;
|
||||
|
||||
|
||||
@@ -5,13 +5,15 @@ import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
|
||||
import com.avaje.ebeaninternal.server.core.PersistRequestBean;
|
||||
import com.avaje.ebeaninternal.server.deploy.BeanDescriptor;
|
||||
import com.avaje.ebeaninternal.server.transaction.BeanDelta;
|
||||
import com.avaje.ebeaninternal.server.transaction.DeleteByIdMap;
|
||||
import com.avaje.ebeaninternal.server.transaction.IndexInvalidate;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Holds information for a transaction. There is one TransactionEvent instance
|
||||
@@ -23,7 +25,7 @@ import com.avaje.ebeaninternal.server.transaction.IndexInvalidate;
|
||||
*/
|
||||
public class TransactionEvent implements Serializable {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(TransactionEvent.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(TransactionEvent.class);
|
||||
|
||||
private static final long serialVersionUID = 7230903304106097120L;
|
||||
|
||||
@@ -93,7 +95,7 @@ public class TransactionEvent implements Serializable {
|
||||
*/
|
||||
public void addIndexInvalidate(IndexInvalidate indexEvent){
|
||||
if (pauseIndexInvalidate != null && pauseIndexInvalidate.contains(indexEvent.getIndexName())){
|
||||
logger.fine("--- IGNORE Invalidate on "+indexEvent.getIndexName());
|
||||
logger.debug("--- IGNORE Invalidate on "+indexEvent.getIndexName());
|
||||
return;
|
||||
}
|
||||
if (indexInvalidations == null){
|
||||
|
||||
@@ -3,8 +3,6 @@ package com.avaje.ebeaninternal.server.autofetch;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
|
||||
@@ -12,12 +10,13 @@ import com.avaje.ebean.config.GlobalProperties;
|
||||
import com.avaje.ebean.config.ServerConfig;
|
||||
import com.avaje.ebeaninternal.api.SpiEbeanServer;
|
||||
import com.avaje.ebeaninternal.server.resource.ResourceManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class AutoFetchManagerFactory {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(AutoFetchManagerFactory.class.getName());
|
||||
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(AutoFetchManagerFactory.class);
|
||||
|
||||
public static AutoFetchManager create(SpiEbeanServer server, ServerConfig serverConfig, ResourceManager resourceManager) {
|
||||
|
||||
AutoFetchManagerFactory me = new AutoFetchManagerFactory();
|
||||
@@ -68,7 +67,7 @@ public class AutoFetchManagerFactory {
|
||||
return profListener;
|
||||
|
||||
} catch (Exception ex) {
|
||||
logger.log(Level.SEVERE, "Error loading autofetch file "+autoFetchFile.getAbsolutePath(), ex);
|
||||
logger.error("Error loading autofetch file "+autoFetchFile.getAbsolutePath(), ex);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import java.io.Serializable;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
|
||||
@@ -180,7 +179,7 @@ public class DefaultAutoFetchManager implements AutoFetchManager, Serializable {
|
||||
|
||||
} catch (Exception e) {
|
||||
String msg = "Error serializing autofetch file";
|
||||
logging.logError(Level.SEVERE, msg, e);
|
||||
logging.logError(msg, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -304,7 +303,7 @@ public class DefaultAutoFetchManager implements AutoFetchManager, Serializable {
|
||||
Thread.sleep(waitMillis);
|
||||
} catch (InterruptedException e) {
|
||||
String msg = "Error while sleeping after System.gc() request.";
|
||||
logging.logError(Level.SEVERE, msg, e);
|
||||
logging.logError(msg, e);
|
||||
return msg;
|
||||
}
|
||||
return updateTunedQueryInfo();
|
||||
@@ -420,7 +419,7 @@ public class DefaultAutoFetchManager implements AutoFetchManager, Serializable {
|
||||
// expected after renaming/moving an entity bean
|
||||
String msg = e.toString()+" updating autoFetch tuned query for " + beanType
|
||||
+". It isLikely this bean has been renamed or moved";
|
||||
logging.logError(Level.INFO, msg, null);
|
||||
logging.logInfo(msg, null);
|
||||
statisticsMap.remove(statistics.getOrigin().getKey());
|
||||
}
|
||||
}
|
||||
|
||||
+28
-12
@@ -1,14 +1,15 @@
|
||||
package com.avaje.ebeaninternal.server.autofetch;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebean.config.AutofetchConfig;
|
||||
import com.avaje.ebean.config.GlobalProperties;
|
||||
import com.avaje.ebean.config.ServerConfig;
|
||||
import com.avaje.ebeaninternal.server.lib.BackgroundThread;
|
||||
import com.avaje.ebeaninternal.server.querydefn.OrmQueryDetail;
|
||||
import com.avaje.ebeaninternal.server.transaction.log.SimpleLogger;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.logging.Level;
|
||||
|
||||
/**
|
||||
* Handles the logging aspects for the DefaultAutoFetchListener.
|
||||
@@ -19,7 +20,7 @@ import com.avaje.ebeaninternal.server.transaction.log.SimpleLogger;
|
||||
*/
|
||||
public class DefaultAutoFetchManagerLogging {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DefaultAutoFetchManagerLogging.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(DefaultAutoFetchManagerLogging.class);
|
||||
|
||||
private final SimpleLogger fileLogger;
|
||||
|
||||
@@ -60,12 +61,27 @@ public class DefaultAutoFetchManagerLogging {
|
||||
}
|
||||
}
|
||||
|
||||
private void logFile(String msg, Throwable e) {
|
||||
if (useFileLogger) {
|
||||
String errMsg = e == null ? "" : e.getMessage();
|
||||
fileLogger.log("\"Error\",\"" + msg+" "+errMsg+"\",,,,");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void logInfo(String msg, Throwable e) {
|
||||
logFile(msg, e);
|
||||
logger.info(msg, e);
|
||||
}
|
||||
|
||||
public void logError(String msg, Throwable e) {
|
||||
logFile(msg, e);
|
||||
logger.error(msg, e);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void logError(Level level, String msg, Throwable e) {
|
||||
if (useFileLogger) {
|
||||
String errMsg = e == null ? "" : e.getMessage();
|
||||
fileLogger.log("\"Error\",\"" + msg+" "+errMsg+"\",,,,");
|
||||
}
|
||||
logger.log(level, msg, e);
|
||||
logError(msg, e);
|
||||
}
|
||||
|
||||
public void logToJavaLogger(String msg) {
|
||||
@@ -79,7 +95,7 @@ public class DefaultAutoFetchManagerLogging {
|
||||
if (useFileLogger) {
|
||||
fileLogger.log(msg);
|
||||
}
|
||||
logger.fine(msg);
|
||||
logger.debug(msg);
|
||||
}
|
||||
|
||||
public void logChanged(TunedQueryInfo tunedFetch, OrmQueryDetail newQueryDetail) {
|
||||
@@ -89,7 +105,7 @@ public class DefaultAutoFetchManagerLogging {
|
||||
if (useFileLogger) {
|
||||
fileLogger.log(msg);
|
||||
} else {
|
||||
logger.fine(msg);
|
||||
logger.debug(msg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +116,7 @@ public class DefaultAutoFetchManagerLogging {
|
||||
if (useFileLogger) {
|
||||
fileLogger.log(msg);
|
||||
} else {
|
||||
logger.fine(msg);
|
||||
logger.debug(msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import java.io.Serializable;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebean.bean.NodeUsageCollector;
|
||||
import com.avaje.ebean.meta.MetaAutoFetchStatistic.NodeUsageStats;
|
||||
@@ -14,6 +13,8 @@ import com.avaje.ebeaninternal.server.deploy.BeanProperty;
|
||||
import com.avaje.ebeaninternal.server.deploy.BeanPropertyAssoc;
|
||||
import com.avaje.ebeaninternal.server.el.ElPropertyValue;
|
||||
import com.avaje.ebeaninternal.server.query.SplitName;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Collects usages statistics for a given node in the object graph.
|
||||
@@ -22,7 +23,7 @@ public class StatisticsNodeUsage implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -1663951463963779547L;
|
||||
|
||||
private static final Logger logger = Logger.getLogger(StatisticsNodeUsage.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(StatisticsNodeUsage.class);
|
||||
|
||||
private final String monitor = new String();
|
||||
|
||||
@@ -59,7 +60,7 @@ public class StatisticsNodeUsage implements Serializable {
|
||||
ElPropertyValue elGetValue = rootDesc.getElGetValue(path);
|
||||
if (elGetValue == null){
|
||||
desc = null;
|
||||
logger.warning("Autofetch: Can't find join for path["+path+"] for "+rootDesc.getName());
|
||||
logger.warn("Autofetch: Can't find join for path["+path+"] for "+rootDesc.getName());
|
||||
|
||||
} else {
|
||||
BeanProperty beanProperty = elGetValue.getBeanProperty();
|
||||
@@ -72,7 +73,7 @@ public class StatisticsNodeUsage implements Serializable {
|
||||
for (String propName : aggregateUsed) {
|
||||
BeanProperty beanProp = desc.getBeanPropertyFromPath(propName);
|
||||
if (beanProp == null){
|
||||
logger.warning("Autofetch: Can't find property["+propName+"] for "+desc.getName());
|
||||
logger.warn("Autofetch: Can't find property["+propName+"] for "+desc.getName());
|
||||
|
||||
} else {
|
||||
if (beanProp instanceof BeanPropertyAssoc<?>){
|
||||
|
||||
@@ -8,14 +8,14 @@ import java.util.Iterator;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebean.BackgroundExecutor;
|
||||
import com.avaje.ebean.EbeanServer;
|
||||
import com.avaje.ebean.cache.ServerCache;
|
||||
import com.avaje.ebean.cache.ServerCacheOptions;
|
||||
import com.avaje.ebean.cache.ServerCacheStatistics;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
||||
/**
|
||||
@@ -27,7 +27,7 @@ import com.avaje.ebean.cache.ServerCacheStatistics;
|
||||
*/
|
||||
public class DefaultServerCache implements ServerCache {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DefaultServerCache.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(DefaultServerCache.class);
|
||||
|
||||
private static final CacheEntryComparator comparator = new CacheEntryComparator();
|
||||
|
||||
@@ -281,8 +281,8 @@ public class DefaultServerCache implements ServerCache {
|
||||
|
||||
long startTime = System.currentTimeMillis();
|
||||
|
||||
if (logger.isLoggable(Level.FINER)){
|
||||
logger.finer("trimming cache " + name);
|
||||
if (logger.isTraceEnabled()){
|
||||
logger.trace("trimming cache " + name);
|
||||
}
|
||||
|
||||
int trimmedByIdle = 0;
|
||||
@@ -327,8 +327,8 @@ public class DefaultServerCache implements ServerCache {
|
||||
|
||||
long exeTime = System.currentTimeMillis() - startTime;
|
||||
|
||||
if (logger.isLoggable(Level.FINE)){
|
||||
logger.fine("Executed trim of cache " + name + " in ["+exeTime
|
||||
if (logger.isDebugEnabled()){
|
||||
logger.debug("Executed trim of cache " + name + " in ["+exeTime
|
||||
+"]millis idle[" + trimmedByIdle + "] timeToLive["
|
||||
+ trimmedByTTL + "] accessTime["
|
||||
+ trimmedByLRU + "]");
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.avaje.ebeaninternal.server.cluster;
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebean.EbeanServer;
|
||||
import com.avaje.ebean.config.GlobalProperties;
|
||||
@@ -10,13 +8,15 @@ import com.avaje.ebeaninternal.api.ClassUtil;
|
||||
import com.avaje.ebeaninternal.server.cluster.mcast.McastClusterManager;
|
||||
import com.avaje.ebeaninternal.server.cluster.socket.SocketClusterBroadcast;
|
||||
import com.avaje.ebeaninternal.server.transaction.RemoteTransactionEvent;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Manages the cluster service.
|
||||
*/
|
||||
public class ClusterManager {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(ClusterManager.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(ClusterManager.class);
|
||||
|
||||
private final ConcurrentHashMap<String, EbeanServer> serverMap = new ConcurrentHashMap<String, EbeanServer>();
|
||||
|
||||
@@ -49,7 +49,7 @@ public class ClusterManager {
|
||||
|
||||
} catch (Exception e) {
|
||||
String msg = "Error initialising ClusterManager type [" + clusterType + "]";
|
||||
logger.log(Level.SEVERE, msg, e);
|
||||
logger.error(msg, e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
+5
-3
@@ -1,11 +1,13 @@
|
||||
package com.avaje.ebeaninternal.server.cluster.mcast;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* For Incoming Packets remembers the packets we have received and processed.
|
||||
@@ -89,7 +91,7 @@ public class IncomingPacketsProcessed {
|
||||
*/
|
||||
public static class GotAllPoint {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(GotAllPoint.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(GotAllPoint.class);
|
||||
|
||||
private final String memberKey;
|
||||
private final int maxResendIncoming;
|
||||
@@ -196,7 +198,7 @@ public class IncomingPacketsProcessed {
|
||||
int i = resendCount.intValue() + 1;
|
||||
if (i > maxResendIncoming){
|
||||
// we are going to give up trying to get this packet now
|
||||
logger.warning("Exceeded maxResendIncoming["+maxResendIncoming+"] for packet["+packetId+"]. Giving up on requesting it.");
|
||||
logger.warn("Exceeded maxResendIncoming["+maxResendIncoming+"] for packet["+packetId+"]. Giving up on requesting it.");
|
||||
resendCountMap.remove(packetId);
|
||||
outOfOrderList.add(packetId);
|
||||
return false;
|
||||
|
||||
+10
-10
@@ -7,8 +7,6 @@ import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.TreeSet;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebean.config.GlobalProperties;
|
||||
import com.avaje.ebeaninternal.api.SpiEbeanServer;
|
||||
@@ -17,6 +15,8 @@ import com.avaje.ebeaninternal.server.cluster.ClusterManager;
|
||||
import com.avaje.ebeaninternal.server.cluster.Packet;
|
||||
import com.avaje.ebeaninternal.server.cluster.PacketWriter;
|
||||
import com.avaje.ebeaninternal.server.transaction.RemoteTransactionEvent;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Overall Manager of the Multicast Cluster communication for this instance.
|
||||
@@ -38,7 +38,7 @@ import com.avaje.ebeaninternal.server.transaction.RemoteTransactionEvent;
|
||||
*/
|
||||
public class McastClusterManager implements ClusterBroadcast, Runnable {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(McastClusterManager.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(McastClusterManager.class);
|
||||
|
||||
private ClusterManager clusterManager;
|
||||
|
||||
@@ -316,7 +316,7 @@ public class McastClusterManager implements ClusterBroadcast, Runnable {
|
||||
// no members online so trim the entire outgoing packets cache
|
||||
int trimmedCount = outgoingPacketsCache.trimAll();
|
||||
if (trimmedCount > 0){
|
||||
logger.fine("Cluster has no other members. Trimmed "+trimmedCount);
|
||||
logger.debug("Cluster has no other members. Trimmed "+trimmedCount);
|
||||
}
|
||||
|
||||
} else if (minAckedFromListener > minAcked){
|
||||
@@ -358,7 +358,7 @@ public class McastClusterManager implements ClusterBroadcast, Runnable {
|
||||
}
|
||||
} catch (Exception e){
|
||||
String msg = "Error with Cluster Mcast Manager thread";
|
||||
logger.log(Level.SEVERE, msg, e);
|
||||
logger.error(msg, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -384,7 +384,7 @@ public class McastClusterManager implements ClusterBroadcast, Runnable {
|
||||
Packet packet = outgoingPacketsCache.getPacket(resendPacketId);
|
||||
if (packet == null){
|
||||
String msg = "Cluster unable to resend packet["+resendPacketId+"] as it is no longer in the outgoingPacketsCache";
|
||||
logger.log(Level.SEVERE, msg);
|
||||
logger.error(msg);
|
||||
} else {
|
||||
int resendCount = packet.incrementResendCount();
|
||||
if (resendCount <= maxResendOutgoing) {
|
||||
@@ -392,7 +392,7 @@ public class McastClusterManager implements ClusterBroadcast, Runnable {
|
||||
} else {
|
||||
String msg = "Cluster maxResendOutgoing ["+maxResendOutgoing+"] hit for packet "+resendPacketId
|
||||
+". We will not try to send it anymore, removing it from the outgoingPacketsCache.";
|
||||
logger.log(Level.SEVERE, msg);
|
||||
logger.error(msg);
|
||||
outgoingPacketsCache.remove(packet);
|
||||
}
|
||||
}
|
||||
@@ -409,7 +409,7 @@ public class McastClusterManager implements ClusterBroadcast, Runnable {
|
||||
totalBytesResent += localSender.sendPacket(packet);
|
||||
} catch (IOException e) {
|
||||
String msg = "Error trying to resend packet "+packet.getPacketId();
|
||||
logger.log(Level.SEVERE, msg, e);
|
||||
logger.error(msg, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -531,7 +531,7 @@ public class McastClusterManager implements ClusterBroadcast, Runnable {
|
||||
|
||||
} catch (IOException e) {
|
||||
String msg = "Error sending Messages " + messages;
|
||||
logger.log(Level.SEVERE, msg, e);
|
||||
logger.error(msg, e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -569,7 +569,7 @@ public class McastClusterManager implements ClusterBroadcast, Runnable {
|
||||
}
|
||||
} catch (IOException e) {
|
||||
String msg = "Error sending RemoteTransactionEvent " + remoteTransEvent;
|
||||
logger.log(Level.SEVERE, msg, e);
|
||||
logger.error( msg, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,13 +27,13 @@ import java.net.DatagramPacket;
|
||||
import java.net.InetAddress;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.MulticastSocket;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebean.config.GlobalProperties;
|
||||
import com.avaje.ebeaninternal.api.SpiEbeanServer;
|
||||
import com.avaje.ebeaninternal.server.cluster.Packet;
|
||||
import com.avaje.ebeaninternal.server.cluster.PacketTransactionEvent;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Listens for Incoming packets.
|
||||
@@ -42,7 +42,7 @@ import com.avaje.ebeaninternal.server.cluster.PacketTransactionEvent;
|
||||
*/
|
||||
public class McastListener implements Runnable {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(McastListener.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(McastListener.class);
|
||||
|
||||
private final McastClusterManager owner;
|
||||
|
||||
@@ -141,7 +141,7 @@ public class McastListener implements Runnable {
|
||||
if (!shutdownComplete){
|
||||
String msg = "WARNING: Shutdown of McastListener did not complete?";
|
||||
System.err.println(msg);
|
||||
logger.warning(msg);
|
||||
logger.warn(msg);
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -150,7 +150,7 @@ public class McastListener implements Runnable {
|
||||
// send to syserr in case logging already shutdown
|
||||
e.printStackTrace();
|
||||
String msg = "Error leaving Multicast group";
|
||||
logger.log(Level.INFO, msg, e);
|
||||
logger.info(msg, e);
|
||||
}
|
||||
try {
|
||||
sock.close();
|
||||
@@ -158,7 +158,7 @@ public class McastListener implements Runnable {
|
||||
// send to syserr in case logging already shutdown
|
||||
e.printStackTrace();
|
||||
String msg = "Error closing Multicast socket";
|
||||
logger.log(Level.INFO, msg, e);
|
||||
logger.info(msg, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ public class McastListener implements Runnable {
|
||||
String senderHostPort = senderAddr.getAddress().getHostAddress()+":"+senderAddr.getPort();
|
||||
|
||||
if (senderHostPort.equals(localSenderHostPort)){
|
||||
if (debugIgnore || logger.isLoggable(Level.FINE)){
|
||||
if (debugIgnore || logger.isDebugEnabled()){
|
||||
logger.info("Ignoring message as sent by localSender: "+localSenderHostPort);
|
||||
}
|
||||
} else {
|
||||
@@ -195,11 +195,11 @@ public class McastListener implements Runnable {
|
||||
boolean processThisPacket = ackMsg || packetControl.isProcessPacket(senderHostPort, header.getPacketId());
|
||||
|
||||
if (!processThisPacket){
|
||||
if (debugIgnore || logger.isLoggable(Level.FINE)){
|
||||
if (debugIgnore || logger.isDebugEnabled()){
|
||||
logger.info("Already processed packet: "+header.getPacketId()+" type:"+header.getPacketType()+" len:"+data.length);
|
||||
}
|
||||
} else {
|
||||
if (logger.isLoggable(Level.FINER)){
|
||||
if (logger.isTraceEnabled()){
|
||||
logger.info("Incoming packet:"+header.getPacketId()+" type:"+header.getPacketType()+" len:"+data.length);
|
||||
}
|
||||
processPacket(senderHostPort, header, dataInput);
|
||||
@@ -207,13 +207,13 @@ public class McastListener implements Runnable {
|
||||
}
|
||||
|
||||
} catch (java.net.SocketTimeoutException e) {
|
||||
if (logger.isLoggable(Level.FINE)) {
|
||||
logger.log(Level.FINE, "timeout", e);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("timeout", e);
|
||||
}
|
||||
packetControl.onListenerTimeout();
|
||||
|
||||
} catch (IOException e) {
|
||||
logger.log(Level.INFO, "error ?", e);
|
||||
logger.info("error ?", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,13 +239,13 @@ public class McastListener implements Runnable {
|
||||
|
||||
default:
|
||||
String msg = "Unknown Packet type:" + header.getPacketType();
|
||||
logger.log(Level.SEVERE, msg);
|
||||
logger.error(msg);
|
||||
break;
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// need to ask to get this packet resent...
|
||||
String msg = "Error reading Packet " + header.getPacketId() + " type:" + header.getPacketType();
|
||||
logger.log(Level.SEVERE, msg, e);
|
||||
logger.error(msg, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@ import java.io.DataInput;
|
||||
import java.io.IOException;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebeaninternal.server.cluster.Packet;
|
||||
import com.avaje.ebeaninternal.server.cluster.PacketMessages;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Helps co-ordinate Packet information between the McastListener and the
|
||||
@@ -18,7 +18,7 @@ import com.avaje.ebeaninternal.server.cluster.PacketMessages;
|
||||
*/
|
||||
public class McastPacketControl {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(McastPacketControl.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(McastPacketControl.class);
|
||||
|
||||
private final String localSenderHostPort;
|
||||
|
||||
@@ -53,8 +53,8 @@ public class McastPacketControl {
|
||||
packetMessages.read(dataInput);
|
||||
List<Message> messages = packetMessages.getMessages();
|
||||
|
||||
if (logger.isLoggable(Level.FINER)) {
|
||||
logger.finer("INCOMING Messages " + messages);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("INCOMING Messages " + messages);
|
||||
}
|
||||
// messages are for all nodes in the cluster so
|
||||
// we need to filter looking for messages pertaining
|
||||
@@ -77,8 +77,8 @@ public class McastPacketControl {
|
||||
} else if (message instanceof MessageResend) {
|
||||
resend = (MessageResend) message;
|
||||
} else {
|
||||
logger.log(Level.SEVERE, "Expecting a MessageAck or MessageResend but got a "
|
||||
+ message.getClass().getName());
|
||||
logger.error("Expecting a MessageAck or MessageResend but got a "
|
||||
+ message.getClass().getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,10 +6,10 @@ import java.net.DatagramSocket;
|
||||
import java.net.InetAddress;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebeaninternal.server.cluster.Packet;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Handles the sending of Packets via DatagramPacket.
|
||||
@@ -18,7 +18,7 @@ import com.avaje.ebeaninternal.server.cluster.Packet;
|
||||
*/
|
||||
public class McastSender {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(McastSender.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(McastSender.class);
|
||||
|
||||
private final int port;
|
||||
|
||||
@@ -86,12 +86,12 @@ public class McastSender {
|
||||
|
||||
byte[] pktBytes = packet.getBytes();
|
||||
|
||||
if (logger.isLoggable(Level.FINE)){
|
||||
logger.fine("OUTGOING packet: " + packet.getPacketId() + " size:" + pktBytes.length);
|
||||
if (logger.isDebugEnabled()){
|
||||
logger.debug("OUTGOING packet: " + packet.getPacketId() + " size:" + pktBytes.length);
|
||||
}
|
||||
|
||||
if (pktBytes.length > 65507){
|
||||
logger.warning("OUTGOING packet: " + packet.getPacketId() + " size:" + pktBytes.length
|
||||
logger.warn("OUTGOING packet: " + packet.getPacketId() + " size:" + pktBytes.length
|
||||
+" likely to be truncated using UDP with a MAXIMUM length of 65507");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package com.avaje.ebeaninternal.server.cluster.socket;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.Socket;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* This parses and dispatches a request to the appropriate handler.
|
||||
@@ -15,11 +16,11 @@ import java.util.logging.Logger;
|
||||
*/
|
||||
class RequestProcessor implements Runnable {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(RequestProcessor.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(RequestProcessor.class);
|
||||
|
||||
private final Socket clientSocket;
|
||||
private final Socket clientSocket;
|
||||
|
||||
private final SocketClusterBroadcast owner;
|
||||
private final SocketClusterBroadcast owner;
|
||||
|
||||
/**
|
||||
* Create including the Listener (used to lookup the Request Handler) and
|
||||
@@ -49,9 +50,9 @@ class RequestProcessor implements Runnable {
|
||||
sc.disconnect();
|
||||
|
||||
} catch (IOException e) {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
} catch (ClassNotFoundException e) {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
package com.avaje.ebeaninternal.server.cluster.socket;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.Socket;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
|
||||
/**
|
||||
@@ -14,7 +15,7 @@ import java.util.logging.Logger;
|
||||
*/
|
||||
class SocketClient {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(SocketClient.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(SocketClient.class);
|
||||
|
||||
private final InetSocketAddress address;
|
||||
|
||||
@@ -88,7 +89,7 @@ class SocketClient {
|
||||
socket.close();
|
||||
} catch (IOException e) {
|
||||
String msg = "Error disconnecting from Cluster member "+hostPort;
|
||||
logger.log(Level.INFO, msg, e);
|
||||
logger.info(msg, e);
|
||||
}
|
||||
|
||||
os = null;
|
||||
|
||||
+8
-8
@@ -5,8 +5,6 @@ import java.io.InterruptedIOException;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
|
||||
@@ -18,13 +16,15 @@ import com.avaje.ebeaninternal.server.cluster.DataHolder;
|
||||
import com.avaje.ebeaninternal.server.cluster.SerialiseTransactionHelper;
|
||||
import com.avaje.ebeaninternal.server.lib.util.StringHelper;
|
||||
import com.avaje.ebeaninternal.server.transaction.RemoteTransactionEvent;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Broadcast messages across the cluster using sockets.
|
||||
*/
|
||||
public class SocketClusterBroadcast implements ClusterBroadcast {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(SocketClusterBroadcast.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(SocketClusterBroadcast.class);
|
||||
|
||||
private final SocketClient local;
|
||||
|
||||
@@ -133,11 +133,11 @@ public class SocketClusterBroadcast implements ClusterBroadcast {
|
||||
client.send(msg);
|
||||
|
||||
} catch (Exception ex){
|
||||
logger.log(Level.SEVERE, "Error sending message", ex);
|
||||
logger.error("Error sending message", ex);
|
||||
try {
|
||||
client.reconnect();
|
||||
} catch (IOException e) {
|
||||
logger.log(Level.SEVERE, "Error trying to reconnect", ex);
|
||||
logger.error("Error trying to reconnect", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -154,7 +154,7 @@ public class SocketClusterBroadcast implements ClusterBroadcast {
|
||||
broadcast(msg);
|
||||
} catch (Exception e){
|
||||
String msg = "Error sending RemoteTransactionEvent "+remoteTransEvent+" to cluster members.";
|
||||
logger.log(Level.SEVERE, msg, e);
|
||||
logger.error(msg, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,11 +204,11 @@ public class SocketClusterBroadcast implements ClusterBroadcast {
|
||||
}
|
||||
} catch (InterruptedIOException e) {
|
||||
String msg = "Timeout waiting for message";
|
||||
logger.log(Level.INFO, msg, e);
|
||||
logger.info(msg, e);
|
||||
try {
|
||||
request.disconnect();
|
||||
} catch (IOException ex){
|
||||
logger.log(Level.INFO, "Error disconnecting after timeout", ex);
|
||||
logger.info("Error disconnecting after timeout", ex);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
+7
-7
@@ -5,11 +5,11 @@ import java.io.InterruptedIOException;
|
||||
import java.net.ServerSocket;
|
||||
import java.net.Socket;
|
||||
import java.net.SocketException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebeaninternal.server.lib.thread.ThreadPool;
|
||||
import com.avaje.ebeaninternal.server.lib.thread.ThreadPoolManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Serverside multithreaded socket listener. Accepts connections and dispatches
|
||||
@@ -26,7 +26,7 @@ import com.avaje.ebeaninternal.server.lib.thread.ThreadPoolManager;
|
||||
*/
|
||||
class SocketClusterListener implements Runnable {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(SocketClusterListener.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(SocketClusterListener.class);
|
||||
|
||||
/**
|
||||
* The port the SocketListener uses.
|
||||
@@ -118,7 +118,7 @@ class SocketClusterListener implements Runnable {
|
||||
listenerThread.interrupt();
|
||||
serverListenSocket.close();
|
||||
} catch (IOException e) {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,17 +146,17 @@ class SocketClusterListener implements Runnable {
|
||||
logger.info(msg);
|
||||
|
||||
} else {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
}
|
||||
|
||||
} catch (InterruptedIOException e) {
|
||||
// this will happen when the server is very quiet.
|
||||
// that is, no requests
|
||||
logger.fine("Possibly expected due to accept timeout?" + e.getMessage());
|
||||
logger.debug("Possibly expected due to accept timeout?" + e.getMessage());
|
||||
|
||||
} catch (IOException e) {
|
||||
// log it and continue in the loop...
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,17 +2,18 @@ package com.avaje.ebeaninternal.server.core;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebeaninternal.server.util.ClassPathSearch;
|
||||
import com.avaje.ebeaninternal.server.util.ClassPathSearchFilter;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Searches for interesting classes such as Entities, Embedded and ScalarTypes.
|
||||
*/
|
||||
public class BootupClassPathSearch {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(BootupClassPathSearch.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(BootupClassPathSearch.class);
|
||||
|
||||
private final Object monitor = new Object();
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@ import java.lang.annotation.Annotation;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.persistence.Embeddable;
|
||||
import javax.persistence.Entity;
|
||||
@@ -24,6 +22,8 @@ import com.avaje.ebean.event.ServerConfigStartup;
|
||||
import com.avaje.ebean.event.TransactionEventListener;
|
||||
import com.avaje.ebeaninternal.server.type.ScalarType;
|
||||
import com.avaje.ebeaninternal.server.util.ClassPathSearchMatcher;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Interesting classes for a EbeanServer such as Embeddable, Entity,
|
||||
@@ -31,7 +31,7 @@ import com.avaje.ebeaninternal.server.util.ClassPathSearchMatcher;
|
||||
*/
|
||||
public class BootupClasses implements ClassPathSearchMatcher {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(BootupClasses.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(BootupClasses.class);
|
||||
|
||||
private ArrayList<Class<?>> xmlBeanList = new ArrayList<Class<?>>();
|
||||
|
||||
@@ -116,7 +116,7 @@ public class BootupClasses implements ClassPathSearchMatcher {
|
||||
|
||||
} catch (Exception e) {
|
||||
String msg = "Error creating BeanQueryAdapter " + cls;
|
||||
logger.log(Level.SEVERE, msg, e);
|
||||
logger.error(msg, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -186,7 +186,7 @@ public class BootupClasses implements ClassPathSearchMatcher {
|
||||
queryAdapterInstances.add(newInstance);
|
||||
} catch (Exception e) {
|
||||
String msg = "Error creating BeanQueryAdapter " + cls;
|
||||
logger.log(Level.SEVERE, msg, e);
|
||||
logger.error(msg, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ public class BootupClasses implements ClassPathSearchMatcher {
|
||||
persistListenerInstances.add(newInstance);
|
||||
} catch (Exception e) {
|
||||
String msg = "Error creating BeanPersistController " + cls;
|
||||
logger.log(Level.SEVERE, msg, e);
|
||||
logger.error(msg, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ public class BootupClasses implements ClassPathSearchMatcher {
|
||||
persistControllerInstances.add(newInstance);
|
||||
} catch (Exception e) {
|
||||
String msg = "Error creating BeanPersistController " + cls;
|
||||
logger.log(Level.SEVERE, msg, e);
|
||||
logger.error(msg, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ public class BootupClasses implements ClassPathSearchMatcher {
|
||||
transactionEventListenerInstances.add(newInstance);
|
||||
} catch (Exception e) {
|
||||
String msg = "Error creating TransactionEventListener " + cls;
|
||||
logger.log(Level.SEVERE, msg, e);
|
||||
logger.error(msg, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@ package com.avaje.ebeaninternal.server.core;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DatabaseMetaData;
|
||||
import java.sql.SQLException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
import javax.sql.DataSource;
|
||||
@@ -21,6 +19,8 @@ import com.avaje.ebean.config.dbplatform.Oracle9Platform;
|
||||
import com.avaje.ebean.config.dbplatform.PostgresPlatform;
|
||||
import com.avaje.ebean.config.dbplatform.SQLitePlatform;
|
||||
import com.avaje.ebean.config.dbplatform.SqlAnywherePlatform;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Create a DatabasePlatform from the configuration.
|
||||
@@ -31,7 +31,7 @@ import com.avaje.ebean.config.dbplatform.SqlAnywherePlatform;
|
||||
*/
|
||||
public class DatabasePlatformFactory {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DatabasePlatformFactory.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(DatabasePlatformFactory.class);
|
||||
|
||||
/**
|
||||
* Create the appropriate database specific platform.
|
||||
@@ -117,7 +117,7 @@ public class DatabasePlatformFactory {
|
||||
conn.close();
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
logger.log(Level.SEVERE, null, ex);
|
||||
logger.error(null, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@ package com.avaje.ebeaninternal.server.core;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.persistence.EntityNotFoundException;
|
||||
|
||||
@@ -23,6 +21,8 @@ import com.avaje.ebeaninternal.api.SpiQuery.Mode;
|
||||
import com.avaje.ebeaninternal.server.deploy.BeanDescriptor;
|
||||
import com.avaje.ebeaninternal.server.deploy.BeanPropertyAssocMany;
|
||||
import com.avaje.ebeaninternal.server.transaction.DefaultPersistenceContext;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Helper to handle lazy loading and refreshing of beans.
|
||||
@@ -31,7 +31,7 @@ import com.avaje.ebeaninternal.server.transaction.DefaultPersistenceContext;
|
||||
*/
|
||||
public class DefaultBeanLoader {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DefaultBeanLoader.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(DefaultBeanLoader.class);
|
||||
|
||||
private final DebugLazyLoad debugLazyLoad;
|
||||
|
||||
@@ -146,8 +146,8 @@ public class DefaultBeanLoader {
|
||||
for (int i = 0; i < batch.size(); i++) {
|
||||
BeanCollection<?> bc = batch.get(i);
|
||||
if (bc.checkEmptyLazyLoad()) {
|
||||
if (logger.isLoggable(Level.FINE)) {
|
||||
logger.fine("BeanCollection after load was empty. Owner:" + batch.get(i).getOwnerBean());
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("BeanCollection after load was empty. Owner:" + batch.get(i).getOwnerBean());
|
||||
}
|
||||
} else if (loadRequest.isLoadCache()) {
|
||||
Object parentId = desc.getId(bc.getOwnerBean());
|
||||
@@ -271,8 +271,8 @@ public class DefaultBeanLoader {
|
||||
|
||||
if (beanCollection != null) {
|
||||
if (beanCollection.checkEmptyLazyLoad()) {
|
||||
if (logger.isLoggable(Level.FINE)) {
|
||||
logger.fine("BeanCollection after load was empty. Owner:" + beanCollection.getOwnerBean());
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("BeanCollection after load was empty. Owner:" + beanCollection.getOwnerBean());
|
||||
}
|
||||
} else if (useManyIdCache) {
|
||||
parentDesc.cachePutMany(many, beanCollection, parentId);
|
||||
|
||||
@@ -13,9 +13,7 @@ import java.util.Map;
|
||||
import java.util.ServiceLoader;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.FutureTask;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import java.util.ServiceLoader;
|
||||
import javax.management.InstanceAlreadyExistsException;
|
||||
import javax.management.MBeanServer;
|
||||
import javax.management.ObjectName;
|
||||
@@ -110,13 +108,15 @@ import com.avaje.ebeaninternal.server.transaction.TransactionManager;
|
||||
import com.avaje.ebeaninternal.server.transaction.TransactionScopeManager;
|
||||
import com.avaje.ebeaninternal.util.ParamTypeHelper;
|
||||
import com.avaje.ebeaninternal.util.ParamTypeHelper.TypeInfo;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* The default server side implementation of EbeanServer.
|
||||
*/
|
||||
public final class DefaultServer implements SpiEbeanServer {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DefaultServer.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(DefaultServer.class);
|
||||
|
||||
private final String serverName;
|
||||
|
||||
@@ -365,7 +365,7 @@ public final class DefaultServer implements SpiEbeanServer {
|
||||
autofethcName = new ObjectName(mbeanName + ",key=AutoFetch");
|
||||
} catch (Exception e) {
|
||||
String msg = "Failed to register the JMX beans for Ebean server [" + serverName + "].";
|
||||
logger.log(Level.SEVERE, msg, e);
|
||||
logger.error(msg, e);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -376,7 +376,7 @@ public final class DefaultServer implements SpiEbeanServer {
|
||||
} catch (InstanceAlreadyExistsException e) {
|
||||
// tomcat webapp reloading
|
||||
String msg = "JMX beans for Ebean server [" + serverName + "] already registered. Will try unregister/register" + e.getMessage();
|
||||
logger.log(Level.WARNING, msg);
|
||||
logger.warn(msg);
|
||||
try {
|
||||
mbeanServer.unregisterMBean(adminName);
|
||||
mbeanServer.unregisterMBean(autofethcName);
|
||||
@@ -386,11 +386,11 @@ public final class DefaultServer implements SpiEbeanServer {
|
||||
|
||||
} catch (Exception ae) {
|
||||
String amsg = "Unable to unregister/register the JMX beans for Ebean server [" + serverName + "].";
|
||||
logger.log(Level.SEVERE, amsg, ae);
|
||||
logger.error(amsg, ae);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
String msg = "Error registering MBean[" + mbeanName + "]";
|
||||
logger.log(Level.SEVERE, msg, e);
|
||||
logger.error(msg, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -403,7 +403,7 @@ public final class DefaultServer implements SpiEbeanServer {
|
||||
}
|
||||
} catch (Exception e) {
|
||||
String msg = "Error unregistering Ebean " + mbeanName;
|
||||
logger.log(Level.SEVERE, msg, e);
|
||||
logger.error(msg, e);
|
||||
}
|
||||
|
||||
// shutdown services
|
||||
@@ -1088,8 +1088,8 @@ public final class DefaultServer implements SpiEbeanServer {
|
||||
if (query.selectAllForLazyLoadProperty()) {
|
||||
// we need to select all properties to ensure the lazy load property
|
||||
// was included (was not included by default or via autofetch).
|
||||
if (logger.isLoggable(Level.FINE)) {
|
||||
logger.log(Level.FINE, "Using selectAllForLazyLoadProperty");
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Using selectAllForLazyLoadProperty");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1733,7 +1733,7 @@ public final class DefaultServer implements SpiEbeanServer {
|
||||
if (loadedProps != null && !loadedProps.contains(propertyName)) {
|
||||
// skip as property is not actually loaded in this partially
|
||||
// loaded bean
|
||||
logger.fine("Skip saveAssociation as property " + propertyName + " is not loaded");
|
||||
logger.debug("Skip saveAssociation as property " + propertyName + " is not loaded");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,8 +26,6 @@ import java.util.List;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.management.MBeanServer;
|
||||
import javax.management.MBeanServerFactory;
|
||||
@@ -57,13 +55,15 @@ import com.avaje.ebeaninternal.server.lib.sql.DataSourceGlobalManager;
|
||||
import com.avaje.ebeaninternal.server.lib.sql.DataSourcePool;
|
||||
import com.avaje.ebeaninternal.server.lib.thread.ThreadPool;
|
||||
import com.avaje.ebeaninternal.server.lib.thread.ThreadPoolManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Default Server side implementation of ServerFactory.
|
||||
*/
|
||||
public class DefaultServerFactory implements BootupEbeanManager {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DefaultServerFactory.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(DefaultServerFactory.class);
|
||||
|
||||
private final ClusterManager clusterManager;
|
||||
|
||||
@@ -194,7 +194,7 @@ public class DefaultServerFactory implements BootupEbeanManager {
|
||||
}
|
||||
if (pstmtBatch == null) {
|
||||
// We can not support JDBC batching with Oracle
|
||||
logger.warning("Can not support JDBC batching with Oracle without a PstmtDelegate");
|
||||
logger.warn("Can not support JDBC batching with Oracle without a PstmtDelegate");
|
||||
serverConfig.setPersistBatching(false);
|
||||
}
|
||||
}
|
||||
@@ -475,7 +475,7 @@ public class DefaultServerFactory implements BootupEbeanManager {
|
||||
|
||||
if (c.getAutoCommit()) {
|
||||
String m = "DataSource [" + serverConfig.getName() + "] has autoCommit defaulting to true!";
|
||||
logger.warning(m);
|
||||
logger.warn(m);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -488,7 +488,7 @@ public class DefaultServerFactory implements BootupEbeanManager {
|
||||
try {
|
||||
c.close();
|
||||
} catch (SQLException ex) {
|
||||
logger.log(Level.SEVERE, null, ex);
|
||||
logger.error(null, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.avaje.ebeaninternal.server.core;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebean.ExpressionFactory;
|
||||
import com.avaje.ebean.cache.ServerCacheManager;
|
||||
import com.avaje.ebean.config.ExternalTransactionManager;
|
||||
@@ -39,6 +37,8 @@ import com.avaje.ebeaninternal.server.transaction.TransactionManager;
|
||||
import com.avaje.ebeaninternal.server.transaction.TransactionScopeManager;
|
||||
import com.avaje.ebeaninternal.server.type.DefaultTypeManager;
|
||||
import com.avaje.ebeaninternal.server.type.TypeManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Used to extend the ServerConfig with additional objects used to configure and
|
||||
@@ -48,7 +48,7 @@ import com.avaje.ebeaninternal.server.type.TypeManager;
|
||||
*/
|
||||
public class InternalConfiguration {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(InternalConfiguration.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(InternalConfiguration.class);
|
||||
|
||||
private final ServerConfig serverConfig;
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package com.avaje.ebeaninternal.server.core;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletContextEvent;
|
||||
|
||||
import com.avaje.ebean.Ebean;
|
||||
import com.avaje.ebean.config.GlobalProperties;
|
||||
import com.avaje.ebeaninternal.server.lib.ShutdownManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Listens for webserver server starting and stopping events.
|
||||
@@ -19,7 +19,7 @@ import com.avaje.ebeaninternal.server.lib.ShutdownManager;
|
||||
*/
|
||||
public class ServletContextListener implements javax.servlet.ServletContextListener {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(ServletContextListener.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(ServletContextListener.class);
|
||||
|
||||
/**
|
||||
* The servlet container is stopping.
|
||||
|
||||
@@ -12,8 +12,6 @@ import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.jar.JarFile;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.zip.ZipEntry;
|
||||
|
||||
import com.avaje.ebean.config.GlobalProperties;
|
||||
@@ -22,6 +20,8 @@ import com.avaje.ebeaninternal.server.lib.util.Dnode;
|
||||
import com.avaje.ebeaninternal.server.lib.util.DnodeReader;
|
||||
import com.avaje.ebeaninternal.server.util.ClassPathReader;
|
||||
import com.avaje.ebeaninternal.server.util.DefaultClassPathReader;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Used to read the orm.xml and ebean-orm.xml configuration files.
|
||||
@@ -30,7 +30,7 @@ import com.avaje.ebeaninternal.server.util.DefaultClassPathReader;
|
||||
*/
|
||||
public class XmlConfigLoader {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(XmlConfigLoader.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(XmlConfigLoader.class);
|
||||
|
||||
private final ClassPathReader classPathReader;
|
||||
|
||||
@@ -93,7 +93,7 @@ public class XmlConfigLoader {
|
||||
} else {
|
||||
// this is not expected
|
||||
String msg = "Not a Jar or Directory? " + classPath.getAbsolutePath();
|
||||
logger.log(Level.SEVERE, msg);
|
||||
logger.error(msg);
|
||||
}
|
||||
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package com.avaje.ebeaninternal.server.ddl;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebeaninternal.server.deploy.BeanDescriptor;
|
||||
import com.avaje.ebeaninternal.server.deploy.BeanProperty;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Used to generate the drop table DDL script.
|
||||
*/
|
||||
public class CreateSequenceVisitor implements BeanVisitor {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DropSequenceVisitor.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(CreateSequenceVisitor.class);
|
||||
|
||||
private final DdlGenContext ctx;
|
||||
|
||||
@@ -34,7 +34,7 @@ public class CreateSequenceVisitor implements BeanVisitor {
|
||||
// Hopefully a generic test case
|
||||
String msg = "Not creating sequence "+descriptor.getSequenceName()+" on Bean "+descriptor.getName()
|
||||
+" as DatabasePlatform does not support sequences";
|
||||
logger.warning(msg);
|
||||
logger.warn(msg);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.avaje.ebeaninternal.server.ddl;
|
||||
|
||||
import java.sql.Types;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebean.config.dbplatform.DbDdlSyntax;
|
||||
import com.avaje.ebean.config.dbplatform.IdType;
|
||||
@@ -14,13 +12,15 @@ import com.avaje.ebeaninternal.server.deploy.TableJoin;
|
||||
import com.avaje.ebeaninternal.server.deploy.TableJoinColumn;
|
||||
import com.avaje.ebeaninternal.server.deploy.id.ImportedId;
|
||||
import com.avaje.ebeaninternal.server.lib.util.StringHelper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Used as part of CreateTableVisitor to generated the create table DDL script.
|
||||
*/
|
||||
public class CreateTableColumnVisitor extends BaseTablePropertyVisitor {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(CreateTableColumnVisitor.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(CreateTableColumnVisitor.class);
|
||||
|
||||
private final DdlGenContext ctx;
|
||||
|
||||
@@ -213,7 +213,7 @@ public class CreateTableColumnVisitor extends BaseTablePropertyVisitor {
|
||||
}
|
||||
} catch (Exception e){
|
||||
String msg = "Error determining identity on property "+p.getFullBeanName();
|
||||
logger.log(Level.SEVERE, msg, e);
|
||||
logger.error(msg, e);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.avaje.ebeaninternal.server.ddl;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebean.config.dbplatform.DbDdlSyntax;
|
||||
import com.avaje.ebean.config.dbplatform.DbType;
|
||||
@@ -14,13 +13,15 @@ import com.avaje.ebeaninternal.server.deploy.BeanPropertyCompound;
|
||||
import com.avaje.ebeaninternal.server.deploy.CompoundUniqueContraint;
|
||||
import com.avaje.ebeaninternal.server.deploy.InheritInfo;
|
||||
import com.avaje.ebeaninternal.server.deploy.parse.SqlReservedWords;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Used to generated the create table DDL script.
|
||||
*/
|
||||
public class CreateTableVisitor extends AbstractBeanVisitor {
|
||||
|
||||
protected static final Logger logger = Logger.getLogger(CreateTableVisitor.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(CreateTableVisitor.class);
|
||||
|
||||
final DdlGenContext ctx;
|
||||
|
||||
@@ -78,7 +79,7 @@ public class CreateTableVisitor extends AbstractBeanVisitor {
|
||||
}
|
||||
|
||||
if (SqlReservedWords.isKeyword(table)) {
|
||||
logger.warning("Table name ["+table+"] is a suspected SQL reserved word for bean "+descriptor.getFullName());
|
||||
logger.warn("Table name ["+table+"] is a suspected SQL reserved word for bean "+descriptor.getFullName());
|
||||
}
|
||||
|
||||
ctx.write(tableName);
|
||||
@@ -102,7 +103,7 @@ public class CreateTableVisitor extends AbstractBeanVisitor {
|
||||
|
||||
if (SqlReservedWords.isKeyword(columnName)) {
|
||||
String propName = p == null ? "(Unknown)" : p.getFullBeanName();
|
||||
logger.warning("Column name ["+columnName+"] is a suspected SQL reserved word for property "+propName);
|
||||
logger.warn("Column name ["+columnName+"] is a suspected SQL reserved word for property "+propName);
|
||||
}
|
||||
|
||||
ctx.write(" ").write(columnName, columnNameWidth).write(" ");
|
||||
|
||||
@@ -13,8 +13,6 @@ import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
|
||||
@@ -24,13 +22,15 @@ import com.avaje.ebean.config.ServerConfig;
|
||||
import com.avaje.ebean.config.dbplatform.DatabasePlatform;
|
||||
import com.avaje.ebeaninternal.api.SpiEbeanPlugin;
|
||||
import com.avaje.ebeaninternal.api.SpiEbeanServer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Controls the generation of DDL and potentially runs the resulting scripts.
|
||||
*/
|
||||
public class DdlGenerator implements SpiEbeanPlugin {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DdlGenerator.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(DdlGenerator.class);
|
||||
|
||||
private SpiEbeanServer server;
|
||||
|
||||
@@ -258,7 +258,7 @@ public class DdlGenerator implements SpiEbeanPlugin {
|
||||
stmt = stmt.substring(0, stmt.length()-1);
|
||||
}
|
||||
|
||||
logger.log(Level.FINER, "executing "+oneOf+" "+ getSummary(stmt));
|
||||
logger.trace("executing "+oneOf+" "+ getSummary(stmt));
|
||||
|
||||
pstmt = c.prepareStatement(stmt);
|
||||
pstmt.execute();
|
||||
@@ -276,7 +276,7 @@ public class DdlGenerator implements SpiEbeanPlugin {
|
||||
try {
|
||||
pstmt.close();
|
||||
} catch (SQLException e){
|
||||
logger.log(Level.SEVERE, "Error closing pstmt", e);
|
||||
logger.error("Error closing pstmt", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
package com.avaje.ebeaninternal.server.ddl;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebean.config.dbplatform.DbDdlSyntax;
|
||||
import com.avaje.ebeaninternal.server.deploy.BeanDescriptor;
|
||||
import com.avaje.ebeaninternal.server.deploy.BeanProperty;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Used to generate the drop table DDL script.
|
||||
*/
|
||||
public class DropSequenceVisitor implements BeanVisitor {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DropSequenceVisitor.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(DropSequenceVisitor.class);
|
||||
|
||||
private final DdlGenContext ctx;
|
||||
|
||||
@@ -37,7 +37,7 @@ public class DropSequenceVisitor implements BeanVisitor {
|
||||
// Hopefully a generic test case
|
||||
String msg = "Not dropping sequence "+descriptor.getSequenceName()+" on Bean "+descriptor.getName()
|
||||
+" as DatabasePlatform does not support sequences";
|
||||
logger.finer(msg);
|
||||
logger.trace(msg);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,8 +12,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
|
||||
@@ -73,13 +71,15 @@ import com.avaje.ebeaninternal.server.type.TypeManager;
|
||||
import com.avaje.ebeaninternal.util.SortByClause;
|
||||
import com.avaje.ebeaninternal.util.SortByClause.Property;
|
||||
import com.avaje.ebeaninternal.util.SortByClauseParser;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Describes Beans including their deployment information.
|
||||
*/
|
||||
public class BeanDescriptor<T> {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(BeanDescriptor.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(BeanDescriptor.class);
|
||||
|
||||
private final ConcurrentHashMap<Integer, SpiUpdatePlan> updatePlanCache = new ConcurrentHashMap<Integer, SpiUpdatePlan>();
|
||||
|
||||
@@ -581,8 +581,8 @@ public class BeanDescriptor<T> {
|
||||
*/
|
||||
public void initialiseId() {
|
||||
|
||||
if (logger.isLoggable(Level.FINER)) {
|
||||
logger.finer("BeanDescriptor initialise " + fullName);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("BeanDescriptor initialise " + fullName);
|
||||
}
|
||||
|
||||
if (inheritInfo != null) {
|
||||
@@ -774,7 +774,7 @@ public class BeanDescriptor<T> {
|
||||
query.setReadOnly(true);
|
||||
query.setLoadBeanCache(true);
|
||||
List<T> list = query.findList();
|
||||
if (logger.isLoggable(Level.INFO)) {
|
||||
if (logger.isInfoEnabled()) {
|
||||
String msg = "Loaded " + beanType + " cache with [" + list.size() + "] beans";
|
||||
logger.info(msg);
|
||||
}
|
||||
|
||||
@@ -10,8 +10,6 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
import javax.sql.DataSource;
|
||||
@@ -65,13 +63,15 @@ import com.avaje.ebeaninternal.server.reflect.EnhanceBeanReflectFactory;
|
||||
import com.avaje.ebeaninternal.server.subclass.SubClassManager;
|
||||
import com.avaje.ebeaninternal.server.subclass.SubClassUtil;
|
||||
import com.avaje.ebeaninternal.server.type.TypeManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Creates BeanDescriptors.
|
||||
*/
|
||||
public class BeanDescriptorManager implements BeanDescriptorMap {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(BeanDescriptorManager.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(BeanDescriptorManager.class);
|
||||
|
||||
private static final BeanDescComparator beanDescComparator = new BeanDescComparator();
|
||||
|
||||
@@ -274,7 +274,7 @@ public class BeanDescriptorManager implements BeanDescriptorMap {
|
||||
deplyInfoMap = null;
|
||||
} catch (RuntimeException e) {
|
||||
String msg = "Error in deployment";
|
||||
logger.log(Level.SEVERE, msg, e);
|
||||
logger.error(msg, e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
@@ -410,7 +410,7 @@ public class BeanDescriptorManager implements BeanDescriptorMap {
|
||||
if (GlobalProperties.getBoolean("ebean.strict", true)) {
|
||||
throw new PersistenceException(msg, source);
|
||||
} else {
|
||||
logger.log(Level.SEVERE, msg, source);
|
||||
logger.error(msg, source);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -459,8 +459,7 @@ public class BeanDescriptorManager implements BeanDescriptorMap {
|
||||
int lc = persistListenerManager.getRegisterCount();
|
||||
int fc = beanFinderManager.createBeanFinders(bootupClasses.getBeanFinders());
|
||||
|
||||
logger
|
||||
.fine("BeanPersistControllers[" + cc + "] BeanFinders[" + fc + "] BeanPersistListeners[" + lc + "] BeanQueryAdapters[" + qa + "]");
|
||||
logger.debug("BeanPersistControllers[" + cc + "] BeanFinders[" + fc + "] BeanPersistListeners[" + lc + "] BeanQueryAdapters[" + qa + "]");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -480,7 +479,7 @@ public class BeanDescriptorManager implements BeanDescriptorMap {
|
||||
String subclassEntityNames = subclassedEntities.toString();
|
||||
|
||||
String m = "Mixing enhanced and subclassed entities. Subclassed classes:" + subclassEntityNames;
|
||||
logger.warning(m);
|
||||
logger.warn(m);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -507,9 +506,9 @@ public class BeanDescriptorManager implements BeanDescriptorMap {
|
||||
ArrayList<Class<?>> embeddedClasses = bootupClasses.getEmbeddables();
|
||||
for (int i = 0; i < embeddedClasses.size(); i++) {
|
||||
Class<?> cls = embeddedClasses.get(i);
|
||||
if (logger.isLoggable(Level.FINER)) {
|
||||
if (logger.isTraceEnabled()) {
|
||||
String msg = "load deployinfo for embeddable:" + cls.getName();
|
||||
logger.finer(msg);
|
||||
logger.trace(msg);
|
||||
}
|
||||
BeanDescriptor<?> embDesc = createEmbedded(cls);
|
||||
registerBeanDescriptor(embDesc);
|
||||
@@ -764,7 +763,7 @@ public class BeanDescriptorManager implements BeanDescriptorMap {
|
||||
|
||||
String m = "Implicitly found mappedBy for " + targetDesc + "." + prop;
|
||||
m += " by searching for [" + searchName + "] against " + matchSet;
|
||||
logger.fine(m);
|
||||
logger.debug(m);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1000,7 +999,7 @@ public class BeanDescriptorManager implements BeanDescriptorMap {
|
||||
BeanFinder<T> beanFinder = beanFinderManager.getBeanFinder(beanType);
|
||||
if (beanFinder != null) {
|
||||
descriptor.setBeanFinder(beanFinder);
|
||||
logger.fine("BeanFinder on[" + descriptor.getFullName() + "] " + beanFinder.getClass().getName());
|
||||
logger.debug("BeanFinder on[" + descriptor.getFullName() + "] " + beanFinder.getClass().getName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1065,7 +1064,7 @@ public class BeanDescriptorManager implements BeanDescriptorMap {
|
||||
// using BeanFinder so perhaps valid without an id
|
||||
} else {
|
||||
// expecting an id property
|
||||
logger.warning(Message.msg("deploy.nouid", desc.getFullName()));
|
||||
logger.warn(Message.msg("deploy.nouid", desc.getFullName()));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -1109,7 +1108,7 @@ public class BeanDescriptorManager implements BeanDescriptorMap {
|
||||
|
||||
String seqName = desc.getIdGeneratorName();
|
||||
if (seqName != null) {
|
||||
logger.fine("explicit sequence " + seqName + " on " + desc.getFullName());
|
||||
logger.debug("explicit sequence " + seqName + " on " + desc.getFullName());
|
||||
} else {
|
||||
String primaryKeyColumn = desc.getSinglePrimaryKeyColumn();
|
||||
// use namingConvention to define sequence name
|
||||
@@ -1266,13 +1265,13 @@ public class BeanDescriptorManager implements BeanDescriptorMap {
|
||||
String name = (String) namedQueryXml.getAttribute("name");
|
||||
Dnode query = namedQueryXml.find("query");
|
||||
if (query == null) {
|
||||
logger.warning("orm.xml " + deployDesc.getFullName() + " named-query missing query element?");
|
||||
logger.warn("orm.xml " + deployDesc.getFullName() + " named-query missing query element?");
|
||||
|
||||
} else {
|
||||
String oql = query.getNodeContent();
|
||||
// TODO: QueryHints not read from xml yet
|
||||
if (name == null || oql == null) {
|
||||
logger.warning("orm.xml " + deployDesc.getFullName() + " named-query has no query content?");
|
||||
logger.warn("orm.xml " + deployDesc.getFullName() + " named-query has no query content?");
|
||||
} else {
|
||||
// add the named query
|
||||
DeployNamedQuery q = new DeployNamedQuery(name, oql, null);
|
||||
@@ -1408,10 +1407,10 @@ public class BeanDescriptorManager implements BeanDescriptorMap {
|
||||
testBean = beanClass.newInstance();
|
||||
} catch (InstantiationException e) {
|
||||
// expected when no default constructor
|
||||
logger.fine("no default constructor on " + beanClass + " e:" + e);
|
||||
logger.debug("no default constructor on " + beanClass + " e:" + e);
|
||||
} catch (IllegalAccessException e) {
|
||||
// expected when no default constructor
|
||||
logger.fine("no default constructor on " + beanClass + " e:" + e);
|
||||
logger.debug("no default constructor on " + beanClass + " e:" + e);
|
||||
}
|
||||
if (testBean instanceof EntityBean == false) {
|
||||
checkSubclass(desc, beanClass);
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.avaje.ebeaninternal.server.deploy;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
|
||||
@@ -16,13 +14,15 @@ import com.avaje.ebeaninternal.server.deploy.id.ImportedIdSimple;
|
||||
import com.avaje.ebeaninternal.server.deploy.meta.DeployBeanPropertyAssoc;
|
||||
import com.avaje.ebeaninternal.server.el.ElPropertyChainBuilder;
|
||||
import com.avaje.ebeaninternal.server.el.ElPropertyValue;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Abstract base for properties mapped to an associated bean, list, set or map.
|
||||
*/
|
||||
public abstract class BeanPropertyAssoc<T> extends BeanProperty {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(BeanPropertyAssoc.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(BeanPropertyAssoc.class);
|
||||
|
||||
/**
|
||||
* The descriptor of the target. This MUST be initialised after construction
|
||||
@@ -326,7 +326,7 @@ public abstract class BeanPropertyAssoc<T> extends BeanProperty {
|
||||
// simple single scalar id
|
||||
if (cols.length != 1){
|
||||
String msg = "No Imported Id column for ["+props[0]+"] in table ["+join.getTable()+"]";
|
||||
logger.log(Level.SEVERE, msg);
|
||||
logger.error(msg);
|
||||
return null;
|
||||
} else {
|
||||
return createImportedScalar(owner, cols[0], props, others);
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
package com.avaje.ebeaninternal.server.deploy;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebean.event.BeanQueryAdapter;
|
||||
import com.avaje.ebeaninternal.server.core.BootupClasses;
|
||||
import com.avaje.ebeaninternal.server.deploy.meta.DeployBeanDescriptor;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Default implementation for creating BeanControllers.
|
||||
*/
|
||||
public class BeanQueryAdapterManager {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(BeanQueryAdapterManager.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(BeanQueryAdapterManager.class);
|
||||
|
||||
private final List<BeanQueryAdapter> list;
|
||||
|
||||
@@ -33,7 +34,7 @@ public class BeanQueryAdapterManager {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
BeanQueryAdapter c = list.get(i);
|
||||
if (c.isRegisterFor(deployDesc.getBeanType())){
|
||||
logger.fine("BeanQueryAdapter on[" + deployDesc.getFullName() + "] " + c.getClass().getName());
|
||||
logger.debug("BeanQueryAdapter on[" + deployDesc.getFullName() + "] " + c.getClass().getName());
|
||||
deployDesc.addQueryAdapter(c);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
package com.avaje.ebeaninternal.server.deploy;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebean.config.GlobalProperties;
|
||||
import com.avaje.ebeaninternal.server.core.InternString;
|
||||
import com.avaje.ebeaninternal.server.deploy.meta.DeployBeanTable;
|
||||
import com.avaje.ebeaninternal.server.deploy.meta.DeployTableJoin;
|
||||
import com.avaje.ebeaninternal.server.deploy.meta.DeployTableJoinColumn;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
||||
/**
|
||||
@@ -21,7 +20,7 @@ import com.avaje.ebeaninternal.server.deploy.meta.DeployTableJoinColumn;
|
||||
*/
|
||||
public class BeanTable {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(BeanTable.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(BeanTable.class);
|
||||
|
||||
private final Class<?> beanType;
|
||||
|
||||
@@ -106,7 +105,7 @@ public class BeanTable {
|
||||
// just to copy the column name rather than prefix with the foreignKeyPrefix.
|
||||
// I think that with complex keys this is the more common approach.
|
||||
String msg = "On table["+baseTable+"] foreign key column ["+lc+"]";
|
||||
logger.log(Level.FINE, msg);
|
||||
logger.debug(msg);
|
||||
fk = lc;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,6 @@ import java.util.HashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
|
||||
@@ -16,13 +14,15 @@ import com.avaje.ebeaninternal.server.query.SqlTree;
|
||||
import com.avaje.ebeaninternal.server.query.SqlTreeNode;
|
||||
import com.avaje.ebeaninternal.server.query.SqlTreeNodeRoot;
|
||||
import com.avaje.ebeaninternal.server.query.SqlTreeProperties;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Represents a SqlSelect raw sql query.
|
||||
*/
|
||||
public class DRawSqlSelect {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DRawSqlSelect.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(DRawSqlSelect.class);
|
||||
|
||||
private final BeanDescriptor<?> desc;
|
||||
|
||||
@@ -152,7 +152,7 @@ public class DRawSqlSelect {
|
||||
String m = "Mapping for " + desc.getFullName();
|
||||
m += " query["+name+"] column[" + columnInfo + "] index[" + i;
|
||||
m += "] not matched to bean property?";
|
||||
logger.log(Level.SEVERE, m);
|
||||
logger.error(m);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,19 +2,19 @@ package com.avaje.ebeaninternal.server.deploy;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
|
||||
import com.avaje.ebean.config.NamingConvention;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Parses columnMapping (select clause) mapping columns to bean properties.
|
||||
*/
|
||||
public final class DRawSqlSelectColumnsParser {
|
||||
|
||||
private static Logger logger = Logger.getLogger(DRawSqlSelectColumnsParser.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(DRawSqlSelectColumnsParser.class);
|
||||
|
||||
/**
|
||||
* Description of how the match was made.
|
||||
@@ -113,13 +113,13 @@ public final class DRawSqlSelectColumnsParser {
|
||||
String msg = "Error in " + parent.getErrName() + ". ";
|
||||
msg += "No matching bean property for column[" + colName + "] columnLabel[" + colLabel
|
||||
+ "] idx[" + columnIndex + "] using search[" + searchColumn + "] found?";
|
||||
logger.log(Level.SEVERE, msg);
|
||||
logger.error(msg);
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
String msg = null;
|
||||
if (debug || logger.isLoggable(Level.FINE)) {
|
||||
if (debug || logger.isDebugEnabled()) {
|
||||
msg = "ColumnMapping ... idx[" + columnIndex + "] match column[" + colName
|
||||
+ "] label[" + colLabel + "] to property[" + prop + "]"
|
||||
+ matchDescription;
|
||||
@@ -127,8 +127,8 @@ public final class DRawSqlSelectColumnsParser {
|
||||
if (debug) {
|
||||
parent.debug(msg);
|
||||
}
|
||||
if (logger.isLoggable(Level.FINE)) {
|
||||
logger.fine(msg);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug(msg);
|
||||
}
|
||||
|
||||
DRawSqlColumnInfo info = new DRawSqlColumnInfo(colName, colLabel, prop.getName(), prop.isScalar());
|
||||
@@ -150,7 +150,7 @@ public final class DRawSqlSelectColumnsParser {
|
||||
|
||||
String msg = "sql-select trimming quoted identifier from["
|
||||
+ columnLabel + "] to[" + result+ "]";
|
||||
logger.fine(msg);
|
||||
logger.debug(msg);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -5,13 +5,13 @@ import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebeaninternal.server.lib.resource.ResourceContent;
|
||||
import com.avaje.ebeaninternal.server.lib.resource.ResourceSource;
|
||||
import com.avaje.ebeaninternal.server.lib.util.Dnode;
|
||||
import com.avaje.ebeaninternal.server.lib.util.DnodeReader;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Controls the creation and caching of BeanManager's, BeanDescriptors,
|
||||
@@ -22,8 +22,7 @@ import com.avaje.ebeaninternal.server.lib.util.DnodeReader;
|
||||
*/
|
||||
public class DeployOrmXml {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DeployOrmXml.class.getName());
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(DeployOrmXml.class);
|
||||
|
||||
private final HashMap<String, DNativeQuery> nativeQueryCache;
|
||||
|
||||
@@ -127,7 +126,7 @@ public class DeployOrmXml {
|
||||
return false;
|
||||
}
|
||||
} catch (IOException e) {
|
||||
logger.log(Level.SEVERE, "error reading orm xml deployment " + ormXmlName, e);
|
||||
logger.error("error reading orm xml deployment " + ormXmlName, e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@ package com.avaje.ebeaninternal.server.deploy;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebeaninternal.server.deploy.id.ImportedId;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Build a map of logical to physical names for use in Orm Updates.
|
||||
@@ -13,7 +13,7 @@ import com.avaje.ebeaninternal.server.deploy.id.ImportedId;
|
||||
*/
|
||||
public class DeployUpdateMapFactory {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DeployUpdateMapFactory.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(DeployUpdateMapFactory.class);
|
||||
|
||||
/**
|
||||
* Build a map of logical to physical names for use in Orm Updates for a given descriptor.
|
||||
@@ -43,7 +43,7 @@ public class DeployUpdateMapFactory {
|
||||
ImportedId importedId = assocOne.getImportedId();
|
||||
if (importedId == null){
|
||||
String m = descriptor.getFullName()+" importedId is null for associated: "+assocOne.getFullBeanName();
|
||||
logger.log(Level.SEVERE, m);
|
||||
logger.error(m);
|
||||
|
||||
} else if (importedId.isScalar()){
|
||||
deployMap.put(importedId.getLogicalName(), importedId.getDbColumn());
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
package com.avaje.ebeaninternal.server.deploy;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebean.event.BeanPersistController;
|
||||
import com.avaje.ebeaninternal.server.core.BootupClasses;
|
||||
import com.avaje.ebeaninternal.server.deploy.meta.DeployBeanDescriptor;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Default implementation for creating BeanControllers.
|
||||
*/
|
||||
public class PersistControllerManager {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(PersistControllerManager.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(PersistControllerManager.class);
|
||||
|
||||
private final List<BeanPersistController> list;
|
||||
|
||||
@@ -33,7 +34,7 @@ public class PersistControllerManager {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
BeanPersistController c = list.get(i);
|
||||
if (c.isRegisterFor(deployDesc.getBeanType())){
|
||||
logger.fine("BeanPersistController on[" + deployDesc.getFullName() + "] " + c.getClass().getName());
|
||||
logger.debug("BeanPersistController on[" + deployDesc.getFullName() + "] " + c.getClass().getName());
|
||||
deployDesc.addPersistController(c);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
package com.avaje.ebeaninternal.server.deploy;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
|
||||
import com.avaje.ebean.event.BeanPersistListener;
|
||||
import com.avaje.ebeaninternal.server.core.BootupClasses;
|
||||
import com.avaje.ebeaninternal.server.deploy.meta.DeployBeanDescriptor;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Manages the assignment/registration of BeanPersistListener with their
|
||||
@@ -15,7 +16,7 @@ import com.avaje.ebeaninternal.server.deploy.meta.DeployBeanDescriptor;
|
||||
*/
|
||||
public class PersistListenerManager {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(PersistListenerManager.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(PersistListenerManager.class);
|
||||
|
||||
private final List<BeanPersistListener<?>> list;
|
||||
|
||||
@@ -36,7 +37,7 @@ public class PersistListenerManager {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
BeanPersistListener<?> c = list.get(i);
|
||||
if (isRegisterFor(deployDesc.getBeanType(), c)) {
|
||||
logger.fine("BeanPersistListener on[" + deployDesc.getFullName() + "] " + c.getClass().getName());
|
||||
logger.debug("BeanPersistListener on[" + deployDesc.getFullName() + "] " + c.getClass().getName());
|
||||
deployDesc.addPersistListener((BeanPersistListener<T>) c);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,8 +12,6 @@ import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebean.Query.UseIndex;
|
||||
import com.avaje.ebean.annotation.ConcurrencyMode;
|
||||
@@ -36,6 +34,8 @@ import com.avaje.ebeaninternal.server.deploy.DeployNamedQuery;
|
||||
import com.avaje.ebeaninternal.server.deploy.DeployNamedUpdate;
|
||||
import com.avaje.ebeaninternal.server.deploy.InheritInfo;
|
||||
import com.avaje.ebeaninternal.server.reflect.BeanReflect;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Describes Beans including their deployment information.
|
||||
@@ -56,7 +56,7 @@ public class DeployBeanDescriptor<T> {
|
||||
|
||||
private static final String I_SCALAOBJECT = "scala.ScalaObject";
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DeployBeanDescriptor.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(DeployBeanDescriptor.class);
|
||||
|
||||
private static final String META_BEAN_PREFIX = MetaAutoFetchStatistic.class.getName().substring(0, 20);
|
||||
|
||||
@@ -266,7 +266,7 @@ public class DeployBeanDescriptor<T> {
|
||||
if (!"".equals(m)) {
|
||||
m += ". Should it be transient?";
|
||||
String msg = "Bean property " + getFullName() + "." + prop.getName() + " has " + m;
|
||||
logger.log(Level.SEVERE, msg);
|
||||
logger.error(msg);
|
||||
missingMethods = true;
|
||||
}
|
||||
}
|
||||
|
||||
+10
-10
@@ -6,8 +6,6 @@ import java.lang.reflect.Modifier;
|
||||
import java.lang.reflect.ParameterizedType;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.Iterator;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
import javax.persistence.Transient;
|
||||
@@ -25,6 +23,8 @@ import com.avaje.ebeaninternal.server.type.CtCompoundType;
|
||||
import com.avaje.ebeaninternal.server.type.ScalarType;
|
||||
import com.avaje.ebeaninternal.server.type.TypeManager;
|
||||
import com.avaje.ebeaninternal.server.type.reflect.CheckImmutableResponse;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Create the properties for a bean.
|
||||
@@ -35,7 +35,7 @@ import com.avaje.ebeaninternal.server.type.reflect.CheckImmutableResponse;
|
||||
*/
|
||||
public class DeployCreateProperties {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DeployCreateProperties.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(DeployCreateProperties.class);
|
||||
|
||||
private final DetermineManyType determineManyType;
|
||||
|
||||
@@ -62,11 +62,11 @@ public class DeployCreateProperties {
|
||||
if (prop.isTransient()){
|
||||
if (prop.getWriteMethod() == null || prop.getReadMethod() == null){
|
||||
// Typically a helper method ... this is expected
|
||||
logger.finest("... transient: "+prop.getFullBeanName());
|
||||
logger.trace("... transient: "+prop.getFullBeanName());
|
||||
} else {
|
||||
// dubious, possible error...
|
||||
String msg = Message.msg("deploy.property.nofield", desc.getFullName(), prop.getName());
|
||||
logger.warning(msg);
|
||||
logger.warn(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -112,7 +112,7 @@ public class DeployCreateProperties {
|
||||
|
||||
} else if (Modifier.isTransient(field.getModifiers())) {
|
||||
// not interested in transient fields
|
||||
logger.finer("Skipping transient field "+field.getName()+" in "+beanType.getName());
|
||||
logger.trace("Skipping transient field "+field.getName()+" in "+beanType.getName());
|
||||
|
||||
} else if (ignoreFieldByName(field.getName())) {
|
||||
// not interested this field (ebean or aspectJ field)
|
||||
@@ -142,7 +142,7 @@ public class DeployCreateProperties {
|
||||
} else {
|
||||
String msg = "Huh??? property "+prop.getFullBeanName()+" being defined twice";
|
||||
msg += " but replaced property was not transient? This is not expected?";
|
||||
logger.warning(msg);
|
||||
logger.warn(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -191,7 +191,7 @@ public class DeployCreateProperties {
|
||||
char c = name.charAt(2);
|
||||
if (Character.isUpperCase(c)){
|
||||
String msg = "trimming off 'is' from boolean field name "+name+" in class "+beanType.getName();
|
||||
logger.log(Level.INFO, msg);
|
||||
logger.info(msg);
|
||||
|
||||
return name.substring(2);
|
||||
}
|
||||
@@ -285,7 +285,7 @@ public class DeployCreateProperties {
|
||||
// not supporting this field (generic type used)
|
||||
return null;
|
||||
}
|
||||
logger.warning("Could not find parameter type (via reflection) on "+desc.getFullName()+" "+field.getName());
|
||||
logger.warn("Could not find parameter type (via reflection) on "+desc.getFullName()+" "+field.getName());
|
||||
}
|
||||
return createManyType(desc, targetType, manyType);
|
||||
}
|
||||
@@ -323,7 +323,7 @@ public class DeployCreateProperties {
|
||||
}
|
||||
}
|
||||
} catch (Exception e){
|
||||
logger.log(Level.SEVERE, "Error with "+desc+" field:"+field.getName(), e);
|
||||
logger.error("Error with " + desc + " field:" + field.getName(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.avaje.ebeaninternal.server.deploy.parse;
|
||||
|
||||
import java.sql.Types;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.persistence.EnumType;
|
||||
import javax.persistence.Enumerated;
|
||||
import javax.persistence.PersistenceException;
|
||||
@@ -22,13 +20,15 @@ import com.avaje.ebeaninternal.server.type.ScalarType;
|
||||
import com.avaje.ebeaninternal.server.type.ScalarTypeEnumStandard;
|
||||
import com.avaje.ebeaninternal.server.type.SimpleAesEncryptor;
|
||||
import com.avaje.ebeaninternal.server.type.TypeManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Utility object to help processing deployment information.
|
||||
*/
|
||||
public class DeployUtil {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DeployUtil.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(DeployUtil.class);
|
||||
|
||||
|
||||
|
||||
@@ -193,7 +193,7 @@ public class DeployUtil {
|
||||
|
||||
} else {
|
||||
// this is ok...
|
||||
logger.finest("... transient property "+msg);
|
||||
logger.trace("... transient property "+msg);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -3,16 +3,16 @@ package com.avaje.ebeaninternal.server.deploy.parse;
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebean.validation.ValidatorMeta;
|
||||
import com.avaje.ebean.validation.factory.Validator;
|
||||
import com.avaje.ebean.validation.factory.ValidatorFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class ValidatorFactoryManager {
|
||||
|
||||
static final Logger logger = Logger.getLogger(ValidatorFactoryManager.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(ValidatorFactoryManager.class);
|
||||
|
||||
Map<Class<?>, ValidatorFactory> factoryMap;
|
||||
|
||||
@@ -43,7 +43,7 @@ public class ValidatorFactoryManager {
|
||||
|
||||
} catch (Exception e) {
|
||||
String msg = "Error creating ValidatorFactory " + factoryClass.getName();
|
||||
logger.log(Level.SEVERE, msg, e);
|
||||
logger.error(msg, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.avaje.ebeaninternal.server.jmx;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebean.AdminAutofetch;
|
||||
import com.avaje.ebean.EbeanServer;
|
||||
import com.avaje.ebean.config.AutofetchMode;
|
||||
import com.avaje.ebeaninternal.server.autofetch.AutoFetchManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Implementation of the AutoFetchControl.
|
||||
@@ -16,7 +16,7 @@ import com.avaje.ebeaninternal.server.autofetch.AutoFetchManager;
|
||||
*/
|
||||
public class MAdminAutofetch implements MAdminAutofetchMBean, AdminAutofetch {
|
||||
|
||||
final Logger logger = Logger.getLogger(MAdminAutofetch.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MAdminAutofetch.class);
|
||||
|
||||
final AutoFetchManager autoFetchManager;
|
||||
|
||||
|
||||
@@ -2,8 +2,6 @@ package com.avaje.ebeaninternal.server.ldap;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.naming.Name;
|
||||
import javax.naming.NamingException;
|
||||
@@ -15,10 +13,12 @@ import javax.naming.directory.DirContext;
|
||||
import com.avaje.ebean.config.ldap.LdapContextFactory;
|
||||
import com.avaje.ebeaninternal.server.deploy.BeanDescriptor;
|
||||
import com.avaje.ebeaninternal.server.deploy.BeanProperty;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class DefaultLdapPersister {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DefaultLdapPersister.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(DefaultLdapPersister.class);
|
||||
|
||||
private final LdapContextFactory contextFactory;
|
||||
|
||||
@@ -48,8 +48,8 @@ public class DefaultLdapPersister {
|
||||
Name name = request.createLdapName();
|
||||
Attributes attrs = createAttributes(request, false, request.getLoadedProperties());
|
||||
|
||||
if (logger.isLoggable(Level.FINE)) {
|
||||
logger.fine("Ldap Insert Name:" + name + " Attrs:" + attrs);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Ldap Insert Name:" + name + " Attrs:" + attrs);
|
||||
}
|
||||
try {
|
||||
dc.bind(name, null, attrs);
|
||||
@@ -65,8 +65,8 @@ public class DefaultLdapPersister {
|
||||
DirContext dc = contextFactory.createContext();
|
||||
Name name = request.createLdapName();
|
||||
|
||||
if (logger.isLoggable(Level.FINE)) {
|
||||
logger.fine("Ldap Delete Name:" + name);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Ldap Delete Name:" + name);
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -91,8 +91,8 @@ public class DefaultLdapPersister {
|
||||
DirContext dc = contextFactory.createContext();
|
||||
Attributes attrs = createAttributes(request, true, updatedProperties);
|
||||
|
||||
if (logger.isLoggable(Level.FINE)) {
|
||||
logger.fine("Ldap Update Name:" + name + " Attrs:" + attrs);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Ldap Update Name:" + name + " Attrs:" + attrs);
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.avaje.ebeaninternal.server.ldap;
|
||||
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.naming.NamingEnumeration;
|
||||
import javax.naming.NamingException;
|
||||
@@ -14,10 +13,12 @@ import com.avaje.ebean.bean.EntityBeanIntercept;
|
||||
import com.avaje.ebean.event.BeanPersistController;
|
||||
import com.avaje.ebeaninternal.server.deploy.BeanDescriptor;
|
||||
import com.avaje.ebeaninternal.server.deploy.BeanProperty;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class LdapBeanBuilder<T> {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(LdapBeanBuilder.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(LdapBeanBuilder.class);
|
||||
|
||||
private final BeanDescriptor<T> beanDescriptor;
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@ package com.avaje.ebeaninternal.server.ldap;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.naming.NamingEnumeration;
|
||||
import javax.naming.NamingException;
|
||||
@@ -16,10 +14,12 @@ import javax.naming.ldap.LdapName;
|
||||
|
||||
import com.avaje.ebeaninternal.api.SpiQuery;
|
||||
import com.avaje.ebeaninternal.server.deploy.BeanDescriptor;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class LdapOrmQueryExecute<T> {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(LdapOrmQueryExecute.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(LdapOrmQueryExecute.class);
|
||||
|
||||
private final SpiQuery<?> query;
|
||||
|
||||
@@ -95,7 +95,7 @@ public class LdapOrmQueryExecute<T> {
|
||||
debugQuery += " select:"+Arrays.toString(selectProps);
|
||||
}
|
||||
|
||||
if (logger.isLoggable(Level.INFO)){
|
||||
if (logger.isInfoEnabled()){
|
||||
logger.info("Ldap Query Name:"+dn+" filterExpr:"+filterExpr);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package com.avaje.ebeaninternal.server.lib;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Vector;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* A general background thread that runs registered tasks periodically.
|
||||
@@ -26,9 +27,9 @@ import java.util.logging.Logger;
|
||||
*/
|
||||
public final class BackgroundThread {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(BackgroundThread.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(BackgroundThread.class);
|
||||
|
||||
private static final BackgroundThread me = new BackgroundThread();
|
||||
private static final BackgroundThread me = new BackgroundThread();
|
||||
|
||||
/**
|
||||
* The list of Runnable tasks.
|
||||
@@ -154,7 +155,7 @@ public final class BackgroundThread {
|
||||
}
|
||||
|
||||
} catch (InterruptedException e) {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,10 +181,10 @@ public final class BackgroundThread {
|
||||
Runnable runable = bgr.getRunnable();
|
||||
if (bgr.runNow(startTime)){
|
||||
bgr.runStart();
|
||||
if (logger.isLoggable(Level.FINER)) {
|
||||
if (logger.isTraceEnabled()) {
|
||||
String msg = count + " BGRunnable running ["
|
||||
+ runable.getClass().getName() + "]";
|
||||
logger.finer(msg);
|
||||
logger.trace(msg);
|
||||
}
|
||||
|
||||
runable.run();
|
||||
|
||||
@@ -3,10 +3,10 @@ package com.avaje.ebeaninternal.server.lib;
|
||||
|
||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebeaninternal.api.Monitor;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Daemon based ScheduleThreadPool.
|
||||
@@ -18,7 +18,7 @@ import com.avaje.ebeaninternal.api.Monitor;
|
||||
*/
|
||||
public final class DaemonScheduleThreadPool extends ScheduledThreadPoolExecutor {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DaemonScheduleThreadPool.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(DaemonScheduleThreadPool.class);
|
||||
|
||||
private final Monitor monitor = new Monitor();
|
||||
|
||||
@@ -46,11 +46,11 @@ public final class DaemonScheduleThreadPool extends ScheduledThreadPoolExecutor
|
||||
public void shutdown() {
|
||||
synchronized (monitor) {
|
||||
if (super.isShutdown()) {
|
||||
logger.fine("... DaemonScheduleThreadPool already shut down");
|
||||
logger.debug("... DaemonScheduleThreadPool already shut down");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
logger.fine("DaemonScheduleThreadPool shutting down...");
|
||||
logger.debug("DaemonScheduleThreadPool shutting down...");
|
||||
super.shutdown();
|
||||
if (!super.awaitTermination(shutdownWaitSeconds, TimeUnit.SECONDS)) {
|
||||
logger.info("ScheduleService shut down timeout exceeded. Terminating running threads.");
|
||||
@@ -59,7 +59,7 @@ public final class DaemonScheduleThreadPool extends ScheduledThreadPoolExecutor
|
||||
|
||||
} catch (Exception e) {
|
||||
String msg = "Error during shutdown";
|
||||
logger.log(Level.SEVERE, msg, e);
|
||||
logger.error(msg, e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,10 +4,10 @@ package com.avaje.ebeaninternal.server.lib;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebeaninternal.api.Monitor;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* The Thread Pool based on Daemon threads.
|
||||
@@ -16,7 +16,7 @@ import com.avaje.ebeaninternal.api.Monitor;
|
||||
*/
|
||||
public final class DaemonThreadPool extends ThreadPoolExecutor {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DaemonThreadPool.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(DaemonThreadPool.class);
|
||||
|
||||
private final Monitor monitor = new Monitor();
|
||||
|
||||
@@ -54,11 +54,11 @@ public final class DaemonThreadPool extends ThreadPoolExecutor {
|
||||
public void shutdown() {
|
||||
synchronized (monitor) {
|
||||
if (super.isShutdown()) {
|
||||
logger.fine("... DaemonThreadPool["+namePrefix+"] already shut down");
|
||||
logger.debug("... DaemonThreadPool["+namePrefix+"] already shut down");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
logger.fine("DaemonThreadPool["+namePrefix+"] shutting down...");
|
||||
logger.debug("DaemonThreadPool["+namePrefix+"] shutting down...");
|
||||
super.shutdown();
|
||||
if (!super.awaitTermination(shutdownWaitSeconds, TimeUnit.SECONDS)) {
|
||||
logger.info("DaemonThreadPool["+namePrefix+"] shut down timeout exceeded. Terminating running threads.");
|
||||
@@ -67,7 +67,7 @@ public final class DaemonThreadPool extends ThreadPoolExecutor {
|
||||
|
||||
} catch (Exception e) {
|
||||
String msg = "Error during shutdown of DaemonThreadPool["+namePrefix+"]";
|
||||
logger.log(Level.SEVERE, msg, e);
|
||||
logger.error(msg, e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,14 +5,14 @@ import java.sql.DriverManager;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Vector;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebean.common.BootupEbeanManager;
|
||||
import com.avaje.ebean.config.GlobalProperties;
|
||||
import com.avaje.ebeaninternal.api.ClassUtil;
|
||||
import com.avaje.ebeaninternal.server.lib.sql.DataSourceGlobalManager;
|
||||
import com.avaje.ebeaninternal.server.lib.thread.ThreadPoolManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Manages the shutdown of the Runtime.
|
||||
@@ -22,7 +22,7 @@ import com.avaje.ebeaninternal.server.lib.thread.ThreadPoolManager;
|
||||
*/
|
||||
public final class ShutdownManager {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(BackgroundThread.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(ShutdownManager.class);
|
||||
|
||||
static final Vector<Runnable> runnables = new Vector<Runnable>();
|
||||
|
||||
@@ -122,7 +122,7 @@ public final class ShutdownManager {
|
||||
try {
|
||||
throw new RuntimeException("debug.shutdown.why=true ...");
|
||||
} catch(Throwable e){
|
||||
logger.log(Level.WARNING, "Stacktrace showing why shutdown was fired", e);
|
||||
logger.warn("Stacktrace showing why shutdown was fired", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ public final class ShutdownManager {
|
||||
Runnable r = (Runnable)ClassUtil.newInstance(shutdownRunner);
|
||||
r.run();
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ public final class ShutdownManager {
|
||||
Runnable r = (Runnable) e.nextElement();
|
||||
r.run();
|
||||
} catch (Exception ex) {
|
||||
logger.log(Level.SEVERE, null, ex);
|
||||
logger.error(null, ex);
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
@@ -178,7 +178,7 @@ public final class ShutdownManager {
|
||||
System.err.println(msg);
|
||||
ex.printStackTrace();
|
||||
try {
|
||||
logger.log(Level.SEVERE, null, ex);
|
||||
logger.error(null, ex);
|
||||
} catch (Exception exc) {
|
||||
String ms = "Error Logging error to the Log. It may be shutting down.";
|
||||
System.err.println(ms);
|
||||
@@ -195,9 +195,9 @@ public final class ShutdownManager {
|
||||
Driver driver = drivers.nextElement();
|
||||
try {
|
||||
DriverManager.deregisterDriver(driver);
|
||||
logger.log(Level.INFO, String.format("Deregistering jdbc driver: %s", driver));
|
||||
logger.info(String.format("Deregistering jdbc driver: %s", driver));
|
||||
} catch (SQLException e) {
|
||||
logger.log(Level.SEVERE, String.format("Error deregistering driver %s", driver), e);
|
||||
logger.error(String.format("Error deregistering driver %s", driver), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package com.avaje.ebeaninternal.server.lib.resource;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* Helper object used to find directories typically from the current working
|
||||
@@ -10,7 +11,7 @@ import java.util.logging.Logger;
|
||||
*/
|
||||
public class DirectoryFinder {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DirectoryFinder.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(DirectoryFinder.class);
|
||||
|
||||
/**
|
||||
* Find a directory by search through subdirectories.
|
||||
@@ -98,8 +99,8 @@ public class DirectoryFinder {
|
||||
return true;
|
||||
}
|
||||
File sub = new File(f, matchSub);
|
||||
if (logger.isLoggable(Level.FINEST)){
|
||||
logger.finest("search; " + f.getPath());
|
||||
if (logger.isTraceEnabled()){
|
||||
logger.trace("search; " + f.getPath());
|
||||
}
|
||||
return sub.exists();
|
||||
|
||||
|
||||
@@ -5,14 +5,14 @@ import java.util.Collection;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebean.config.DataSourceConfig;
|
||||
import com.avaje.ebean.config.GlobalProperties;
|
||||
import com.avaje.ebeaninternal.api.ClassUtil;
|
||||
import com.avaje.ebeaninternal.server.lib.BackgroundRunnable;
|
||||
import com.avaje.ebeaninternal.server.lib.BackgroundThread;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
||||
/**
|
||||
@@ -20,7 +20,7 @@ import com.avaje.ebeaninternal.server.lib.BackgroundThread;
|
||||
*/
|
||||
public class DataSourceManager implements DataSourceNotify {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DataSourceManager.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(DataSourceManager.class);
|
||||
|
||||
/**
|
||||
* An alerter that notifies when the database has problems.
|
||||
@@ -76,7 +76,7 @@ public class DataSourceManager implements DataSourceNotify {
|
||||
BackgroundThread.add(dbChecker);
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ public class DataSourceManager implements DataSourceNotify {
|
||||
ds.shutdown();
|
||||
} catch (DataSourceException e) {
|
||||
// should never be thrown as the DataSources are all created...
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
}
|
||||
}
|
||||
if (deregisterDriver){
|
||||
|
||||
@@ -11,14 +11,14 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import com.avaje.ebean.config.DataSourceConfig;
|
||||
import com.avaje.ebeaninternal.api.ClassUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* A robust DataSource.
|
||||
@@ -36,7 +36,7 @@ import com.avaje.ebeaninternal.api.ClassUtil;
|
||||
*/
|
||||
public class DataSourcePool implements DataSource {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DataSourcePool.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(DataSourcePool.class);
|
||||
|
||||
/**
|
||||
* The name given to this dataSource.
|
||||
@@ -206,8 +206,8 @@ public class DataSourcePool implements DataSource {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Logger getParentLogger() throws SQLFeatureNotSupportedException {
|
||||
return logger;
|
||||
public java.util.logging.Logger getParentLogger() throws SQLFeatureNotSupportedException {
|
||||
throw new SQLFeatureNotSupportedException("We do not support java.util.logging");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -293,7 +293,7 @@ public class DataSourcePool implements DataSource {
|
||||
if (!inWarningMode) {
|
||||
// send an Error to the event log...
|
||||
inWarningMode = true;
|
||||
logger.warning(msg);
|
||||
logger.warn(msg);
|
||||
if (notify != null) {
|
||||
String subject = "DataSourcePool [" + name + "] warning";
|
||||
notify.notifyWarning(subject, msg);
|
||||
@@ -305,7 +305,7 @@ public class DataSourcePool implements DataSource {
|
||||
|
||||
if (!dataSourceDownAlertSent) {
|
||||
String msg = "FATAL: DataSourcePool [" + name + "] is down!!!";
|
||||
logger.log(Level.SEVERE, msg, ex);
|
||||
logger.error(msg, ex);
|
||||
if (notify != null) {
|
||||
notify.notifyDataSourceDown(name);
|
||||
}
|
||||
@@ -321,14 +321,14 @@ public class DataSourcePool implements DataSource {
|
||||
private void notifyDataSourceIsUp() {
|
||||
if (dataSourceDownAlertSent) {
|
||||
String msg = "RESOLVED FATAL: DataSourcePool [" + name + "] is back up!";
|
||||
logger.log(Level.SEVERE, msg);
|
||||
logger.error(msg);
|
||||
if (notify != null) {
|
||||
notify.notifyDataSourceUp(name);
|
||||
}
|
||||
dataSourceDownAlertSent = false;
|
||||
|
||||
} else if (!dataSourceUp) {
|
||||
logger.log(Level.WARNING, "DataSourcePool [" + name + "] is back up!");
|
||||
logger.warn("DataSourcePool [" + name + "] is back up!");
|
||||
}
|
||||
|
||||
if (!dataSourceUp) {
|
||||
@@ -362,7 +362,7 @@ public class DataSourcePool implements DataSource {
|
||||
conn.close();
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
logger.log(Level.WARNING, "Can't close connection in checkDataSource!");
|
||||
logger.warn("Can't close connection in checkDataSource!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -487,14 +487,14 @@ public class DataSourcePool implements DataSource {
|
||||
rset.close();
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
}
|
||||
try {
|
||||
if (stmt != null) {
|
||||
stmt.close();
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -515,7 +515,7 @@ public class DataSourcePool implements DataSource {
|
||||
|
||||
} catch (Exception e) {
|
||||
String desc = "heartbeatsql test failed on connection[" + conn.getName() + "]";
|
||||
logger.warning(desc);
|
||||
logger.warn(desc);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -806,10 +806,10 @@ public class DataSourcePool implements DataSource {
|
||||
try {
|
||||
DriverManager.deregisterDriver(DriverManager.getDriver(this.databaseUrl));
|
||||
String msg = "Deregistered the JDBC driver "+this.databaseDriver;
|
||||
logger.log(Level.FINE, msg);
|
||||
logger.debug(msg);
|
||||
} catch (SQLException e) {
|
||||
String msg = "Error trying to deregister the JDBC driver "+this.databaseDriver;
|
||||
logger.log(Level.WARNING, msg, e);
|
||||
logger.warn(msg, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,10 +11,10 @@ import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebeaninternal.jdbc.ConnectionDelegator;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Is a connection that belongs to a DataSourcePool.
|
||||
@@ -37,7 +37,7 @@ import com.avaje.ebeaninternal.jdbc.ConnectionDelegator;
|
||||
public class PooledConnection extends ConnectionDelegator
|
||||
{
|
||||
|
||||
private static final Logger logger = Logger.getLogger(PooledConnection.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(PooledConnection.class);
|
||||
|
||||
private static String IDLE_CONNECTION_ACCESSED_ERROR = "Pooled Connection has been accessed whilst idle in the pool, via method: ";
|
||||
|
||||
@@ -263,13 +263,13 @@ public class PooledConnection extends ConnectionDelegator
|
||||
try {
|
||||
if (connection.isClosed()) {
|
||||
msg = "Closing Connection[" + getName() + "] that is already closed?";
|
||||
logger.log(Level.SEVERE, msg);
|
||||
logger.error(msg);
|
||||
return;
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
if (logErrors) {
|
||||
msg = "Error when fully closing connection [" + getName() + "]";
|
||||
logger.log(Level.SEVERE, msg, ex);
|
||||
logger.error(msg, ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,7 +282,7 @@ public class PooledConnection extends ConnectionDelegator
|
||||
|
||||
} catch (SQLException ex) {
|
||||
if (logErrors) {
|
||||
logger.log(Level.WARNING, "Error when closing connection Statements", ex);
|
||||
logger.warn("Error when closing connection Statements", ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -292,7 +292,7 @@ public class PooledConnection extends ConnectionDelegator
|
||||
} catch (SQLException ex) {
|
||||
if (logErrors) {
|
||||
msg = "Error when fully closing connection [" + getName() + "]";
|
||||
logger.log(Level.SEVERE, msg, ex);
|
||||
logger.error(msg, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -358,7 +358,7 @@ public class PooledConnection extends ConnectionDelegator
|
||||
pstmt.closeDestroy();
|
||||
|
||||
} catch (SQLException e) {
|
||||
logger.log(Level.SEVERE, "Error closing Pstmt", e);
|
||||
logger.error("Error closing Pstmt", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -535,11 +535,11 @@ public class PooledConnection extends ConnectionDelegator
|
||||
if (connection != null && !connection.isClosed()) {
|
||||
// connect leak?
|
||||
String msg = "Closing Connection[" + getName() + "] on finalize().";
|
||||
logger.warning(msg);
|
||||
logger.warn(msg);
|
||||
closeConnectionFully(false);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
}
|
||||
super.finalize();
|
||||
}
|
||||
@@ -580,8 +580,8 @@ public class PooledConnection extends ConnectionDelegator
|
||||
*/
|
||||
protected void setLastStatement(String lastStatement) {
|
||||
this.lastStatement = lastStatement;
|
||||
if (logger.isLoggable(Level.FINER)) {
|
||||
logger.finer(".setLastStatement[" + lastStatement + "]");
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace(".setLastStatement[" + lastStatement + "]");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,14 +8,14 @@ import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.locks.Condition;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebeaninternal.server.lib.sql.DataSourcePool.Status;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class PooledConnectionQueue {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(PooledConnectionQueue.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(PooledConnectionQueue.class);
|
||||
|
||||
private static final TimeUnit MILLIS_TIME_UNIT = TimeUnit.MILLISECONDS;
|
||||
|
||||
@@ -203,7 +203,7 @@ public class PooledConnectionQueue {
|
||||
lock.lock();
|
||||
try {
|
||||
if (!busyList.remove(c)) {
|
||||
logger.log(Level.SEVERE, "Connection [" + c + "] not found in BusyList? ");
|
||||
logger.error("Connection [" + c + "] not found in BusyList? ");
|
||||
}
|
||||
if (c.getCreationTime() <= lastResetTime) {
|
||||
c.closeConnectionFully(false);
|
||||
@@ -339,7 +339,7 @@ public class PooledConnectionQueue {
|
||||
|
||||
if (!busyList.isEmpty()) {
|
||||
String msg = "A potential connection leak was detected. Busy connections: "+ busyList.size();
|
||||
logger.warning(msg);
|
||||
logger.warn(msg);
|
||||
|
||||
dumpBusyConnectionInformation();
|
||||
closeBusyConnections(0);
|
||||
@@ -493,7 +493,7 @@ public class PooledConnectionQueue {
|
||||
+ pc.getName() + "] lastUsed[" + luDate + "] createdBy[" + methodLine
|
||||
+ "] lastStmt[" + pc.getLastStatement() + "]";
|
||||
|
||||
logger.warning(msg);
|
||||
logger.warn(msg);
|
||||
logStackElement(pc, "Possible Leaked Connection: ");
|
||||
|
||||
System.out.println("CLOSING BUSY CONNECTION ??? "+pc);
|
||||
@@ -501,7 +501,7 @@ public class PooledConnectionQueue {
|
||||
|
||||
} catch (SQLException ex) {
|
||||
// this should never actually happen
|
||||
logger.log(Level.SEVERE, null, ex);
|
||||
logger.error(null, ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -510,7 +510,7 @@ public class PooledConnectionQueue {
|
||||
if (stackTrace != null){
|
||||
String s = Arrays.toString(stackTrace);
|
||||
String msg = prefix+" name["+pc.getName()+"] stackTrace: "+s;
|
||||
logger.warning(msg);
|
||||
logger.warn(msg);
|
||||
// also send to syserr ... as the loggers get turned
|
||||
// off early in JVM shutdown
|
||||
System.err.println(msg);
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
package com.avaje.ebeaninternal.server.lib.sql;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Random;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* Security mechanisim.
|
||||
*/
|
||||
public class Prefix {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(Prefix.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(Prefix.class);
|
||||
|
||||
private static final int[] oa = { 50, 12, 4, 6, 8, 10, 7, 23, 45, 23, 6, 9, 12, 2, 8, 34 };
|
||||
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
package com.avaje.ebeaninternal.server.lib.sql;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* A LRU based cache for PreparedStatements.
|
||||
*/
|
||||
public class PstmtCache extends LinkedHashMap<String, ExtendedPreparedStatement> {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(PstmtCache.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(PstmtCache.class);
|
||||
|
||||
static final long serialVersionUID = -3096406924865550697L;
|
||||
|
||||
@@ -154,7 +155,7 @@ public class PstmtCache extends LinkedHashMap<String, ExtendedPreparedStatement>
|
||||
ExtendedPreparedStatement pstmt = eldest.getValue();
|
||||
pstmt.closeDestroy();
|
||||
} catch (SQLException e) {
|
||||
logger.log(Level.SEVERE, "Error closing ExtendedPreparedStatement", e);
|
||||
logger.error("Error closing ExtendedPreparedStatement", e);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
package com.avaje.ebeaninternal.server.lib.sql;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebean.config.GlobalProperties;
|
||||
import com.avaje.ebeaninternal.server.lib.util.MailEvent;
|
||||
import com.avaje.ebeaninternal.server.lib.util.MailListener;
|
||||
import com.avaje.ebeaninternal.server.lib.util.MailMessage;
|
||||
import com.avaje.ebeaninternal.server.lib.util.MailSender;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* A simple smtp email alert that sends a email message
|
||||
@@ -21,7 +20,7 @@ import com.avaje.ebeaninternal.server.lib.util.MailSender;
|
||||
*/
|
||||
public class SimpleAlerter implements DataSourceAlertListener, MailListener {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(SimpleAlerter.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(SimpleAlerter.class);
|
||||
|
||||
//boolean sendInBackGround = true;
|
||||
|
||||
@@ -37,7 +36,7 @@ public class SimpleAlerter implements DataSourceAlertListener, MailListener {
|
||||
public void handleEvent(MailEvent event) {
|
||||
Throwable e = event.getError();
|
||||
if (e != null){
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.avaje.ebeaninternal.server.lib.thread;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* A thread that belongs to a ThreadPool. It will return to the Threadpool when
|
||||
@@ -9,7 +9,7 @@ import java.util.logging.Logger;
|
||||
*/
|
||||
public class PooledThread implements Runnable {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(PooledThread.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(PooledThread.class);
|
||||
|
||||
/**
|
||||
* Create the PooledThread.
|
||||
@@ -89,7 +89,7 @@ public class PooledThread implements Runnable {
|
||||
work.getRunnable().run();
|
||||
|
||||
} catch (Throwable ex) {
|
||||
logger.log(Level.SEVERE, null, ex);
|
||||
logger.error(null, ex);
|
||||
|
||||
if (wasInterrupted) {
|
||||
this.isStopping = true;
|
||||
@@ -99,7 +99,7 @@ public class PooledThread implements Runnable {
|
||||
thread.interrupt();
|
||||
} catch (Exception e){
|
||||
String msg = "Error interrupting PooledThead["+name+"]";
|
||||
logger.log(Level.SEVERE, msg, e);
|
||||
logger.error(msg, e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package com.avaje.ebeaninternal.server.lib.thread;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.Vector;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* This is a pool of threads which can be assigned work.
|
||||
@@ -16,7 +17,7 @@ import java.util.logging.Logger;
|
||||
*/
|
||||
public class ThreadPool {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(ThreadPool.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(ThreadPool.class);
|
||||
|
||||
/**
|
||||
* The max idle time used to trim idle threads from the pool.
|
||||
@@ -334,7 +335,7 @@ public class ThreadPool {
|
||||
|
||||
|
||||
} catch (InterruptedException e) {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -441,8 +442,8 @@ public class ThreadPool {
|
||||
PooledThread bgw = new PooledThread(this, threadName, isDaemon, threadPriority);
|
||||
bgw.start();
|
||||
|
||||
if (logger.isLoggable(Level.FINE)) {
|
||||
logger.fine("ThreadPool grow created [" + threadName + "] size[" + size() + "]");
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("ThreadPool grow created [" + threadName + "] size[" + size() + "]");
|
||||
}
|
||||
if (andReturn) {
|
||||
return bgw;
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.avaje.ebeaninternal.server.lib.util;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
@@ -8,15 +11,13 @@ import java.net.InetAddress;
|
||||
import java.net.Socket;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.Iterator;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* Sends simple MailMessages via smtp.
|
||||
*/
|
||||
public class MailSender implements Runnable {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(MailSender.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(MailSender.class);
|
||||
|
||||
int traceLevel = 0;
|
||||
|
||||
@@ -86,7 +87,7 @@ public class MailSender implements Runnable {
|
||||
MailEvent event = new MailEvent(message, ex);
|
||||
listener.handleEvent(event);
|
||||
} else {
|
||||
logger.log(Level.SEVERE, null, ex);
|
||||
logger.error(null, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -115,7 +116,7 @@ public class MailSender implements Runnable {
|
||||
in = new BufferedReader(new InputStreamReader(sserver.getInputStream()));
|
||||
String sintro = readln();
|
||||
if (!sintro.startsWith("220")) { // 220
|
||||
logger.fine("SmtpSender: intro==" + sintro);
|
||||
logger.debug("SmtpSender: intro==" + sintro);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -138,7 +139,7 @@ public class MailSender implements Runnable {
|
||||
if (line.startsWith("3"))
|
||||
break; // ready to send
|
||||
if (!line.startsWith("2")) {
|
||||
logger.fine("SmtpSender.send reponse to DATA: " + line);
|
||||
logger.debug("SmtpSender.send reponse to DATA: " + line);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -173,7 +174,7 @@ public class MailSender implements Runnable {
|
||||
|
||||
private void writeln(String s) throws IOException {
|
||||
if (traceLevel > 2){
|
||||
logger.fine("From client: " + s);
|
||||
logger.debug("From client: " + s);
|
||||
}
|
||||
out.write(s + "\r\n");
|
||||
out.flush();
|
||||
@@ -182,7 +183,7 @@ public class MailSender implements Runnable {
|
||||
private String readln() throws IOException {
|
||||
String line = in.readLine();
|
||||
if (traceLevel > 1){
|
||||
logger.fine("From server: " + line);
|
||||
logger.debug("From server: " + line);
|
||||
}
|
||||
return line;
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@ package com.avaje.ebeaninternal.server.loadcontext;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebean.bean.BeanLoader;
|
||||
import com.avaje.ebean.bean.EntityBean;
|
||||
@@ -17,6 +15,8 @@ import com.avaje.ebeaninternal.api.SpiQuery;
|
||||
import com.avaje.ebeaninternal.server.core.OrmQueryRequest;
|
||||
import com.avaje.ebeaninternal.server.deploy.BeanDescriptor;
|
||||
import com.avaje.ebeaninternal.server.querydefn.OrmQueryProperties;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Default implementation of LoadBeanContext.
|
||||
@@ -24,7 +24,7 @@ import com.avaje.ebeaninternal.server.querydefn.OrmQueryProperties;
|
||||
*/
|
||||
public class DLoadBeanContext implements LoadBeanContext, BeanLoader {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DLoadBeanContext.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(DLoadBeanContext.class);
|
||||
|
||||
protected final DLoadContext parent;
|
||||
|
||||
@@ -129,8 +129,8 @@ public class DLoadBeanContext implements LoadBeanContext, BeanLoader {
|
||||
}
|
||||
// we loaded the bean from cache
|
||||
weakList.removeEntry(position);
|
||||
if (logger.isLoggable(Level.FINEST)) {
|
||||
logger.log(Level.FINEST, "Loading path:" + fullPath + " - bean loaded from L2 cache, position[" + position + "]");
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Loading path:" + fullPath + " - bean loaded from L2 cache, position[" + position + "]");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -160,7 +160,7 @@ public class DLoadBeanContext implements LoadBeanContext, BeanLoader {
|
||||
try {
|
||||
batch = weakList.getLoadBatch(position, batchSize);
|
||||
} catch (IllegalStateException e) {
|
||||
logger.log(Level.SEVERE, "type["+desc.getFullName()+"] fullPath[" + fullPath + "] batchSize["+batchSize+"]", e);
|
||||
logger.error("type[" + desc.getFullName() + "] fullPath[" + fullPath + "] batchSize[" + batchSize + "]", e);
|
||||
}
|
||||
|
||||
if (hitCache && batchSize > 1) {
|
||||
@@ -169,14 +169,14 @@ public class DLoadBeanContext implements LoadBeanContext, BeanLoader {
|
||||
batch = loadBeanCheckBatch(batch);
|
||||
}
|
||||
|
||||
if (logger.isLoggable(Level.FINER)) {
|
||||
if (logger.isTraceEnabled()) {
|
||||
for (int i = 0; i < batch.size(); i++) {
|
||||
|
||||
EntityBeanIntercept entityBeanIntercept = batch.get(i);
|
||||
EntityBean owner = entityBeanIntercept.getOwner();
|
||||
Object id = desc.getId(owner);
|
||||
|
||||
logger.finer("LoadBean type["+owner.getClass().getName()+"] fullPath["+fullPath+"] id["+id+"] batchIndex["+i+"] beanLoaderIndex["+entityBeanIntercept.getBeanLoaderIndex()+"]");
|
||||
logger.trace("LoadBean type["+owner.getClass().getName()+"] fullPath["+fullPath+"] id["+id+"] batchIndex["+i+"] beanLoaderIndex["+entityBeanIntercept.getBeanLoaderIndex()+"]");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,8 +204,8 @@ public class DLoadBeanContext implements LoadBeanContext, BeanLoader {
|
||||
actualLoadBatch.add(batchToCheck.get(i));
|
||||
} else {
|
||||
loadedFromCache++;
|
||||
if (logger.isLoggable(Level.FINEST)) {
|
||||
logger.log(Level.FINEST, "Loading path:" + fullPath + " - bean loaded from L2 cache(batch)");
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace( "Loading path:" + fullPath + " - bean loaded from L2 cache(batch)");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -231,16 +231,16 @@ public class DLoadBeanContext implements LoadBeanContext, BeanLoader {
|
||||
List<EntityBeanIntercept> batch = weakList.getNextBatch(requestedBatchSize);
|
||||
if (batch.size() == 0) {
|
||||
// there are no beans to load
|
||||
if (logger.isLoggable(Level.FINEST)) {
|
||||
logger.log(Level.FINEST, "Loading path:" + fullPath + " - no more beans to load");
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Loading path:" + fullPath + " - no more beans to load");
|
||||
}
|
||||
return;
|
||||
}
|
||||
boolean loadCache = false;
|
||||
LoadBeanRequest req = new LoadBeanRequest(this, batch, parentRequest.getTransaction(), requestedBatchSize, false, null, loadCache);
|
||||
|
||||
if (logger.isLoggable(Level.FINEST)) {
|
||||
logger.log(Level.FINEST, "Loading path:" + fullPath + " - secondary query batch load [" + batch.size() + "] beans");
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Loading path:" + fullPath + " - secondary query batch load [" + batch.size() + "] beans");
|
||||
}
|
||||
|
||||
parent.getEbeanServer().loadBean(req);
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
package com.avaje.ebeaninternal.server.loadcontext;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public class DLoadHardList<T> implements DLoadList<T> {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DLoadHardList.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(DLoadHardList.class);
|
||||
|
||||
protected final ArrayList<T> list = new ArrayList<T>();
|
||||
|
||||
@@ -29,7 +30,7 @@ public class DLoadHardList<T> implements DLoadList<T> {
|
||||
synchronized (this) {
|
||||
T object = list.get(position);
|
||||
if (object == null) {
|
||||
logger.log(Level.WARNING, "removeEntry found no Object for position[" + position + "]");
|
||||
logger.warn("removeEntry found no Object for position[" + position + "]");
|
||||
} else {
|
||||
// just set the entry to null
|
||||
list.set(position, null);
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
package com.avaje.ebeaninternal.server.loadcontext;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public class DLoadWeakList<T> implements DLoadList<T> {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DLoadWeakList.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(DLoadWeakList.class);
|
||||
|
||||
protected final ArrayList<WeakReference<T>> list = new ArrayList<WeakReference<T>>();
|
||||
|
||||
@@ -30,13 +31,13 @@ public class DLoadWeakList<T> implements DLoadList<T> {
|
||||
synchronized (this) {
|
||||
WeakReference<T> wref = list.get(position);
|
||||
if (wref == null) {
|
||||
logger.log(Level.WARNING, "removeEntry found no WeakReference for position[" + position + "]");
|
||||
logger.warn("removeEntry found no WeakReference for position[" + position + "]");
|
||||
} else {
|
||||
// just set the entry to null
|
||||
list.set(position, null);
|
||||
T object = wref.get();
|
||||
if (object == null) {
|
||||
logger.log(Level.WARNING, "removeEntry found no Object held by WeakReference for position[" + position + "]");
|
||||
logger.warn("removeEntry found no Object held by WeakReference for position[" + position + "]");
|
||||
}
|
||||
}
|
||||
if (position == removedFromTop) {
|
||||
@@ -98,7 +99,7 @@ public class DLoadWeakList<T> implements DLoadList<T> {
|
||||
if (wref != null) {
|
||||
T object = wref.get();
|
||||
if (object == null) {
|
||||
logger.log(Level.WARNING, "Bean is null from weak reference");
|
||||
logger.warn("Bean is null from weak reference");
|
||||
} else {
|
||||
found = true;
|
||||
batch.add(object);
|
||||
|
||||
@@ -2,14 +2,14 @@ package com.avaje.ebeaninternal.server.persist;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
|
||||
import com.avaje.ebeaninternal.api.SpiTransaction;
|
||||
import com.avaje.ebeaninternal.server.core.PersistRequest;
|
||||
import com.avaje.ebeaninternal.server.core.PersistRequestBean;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Controls the batch ordering of persist requests.
|
||||
@@ -27,7 +27,7 @@ import com.avaje.ebeaninternal.server.core.PersistRequestBean;
|
||||
*/
|
||||
public final class BatchControl {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(BatchControl.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(BatchControl.class);
|
||||
|
||||
/**
|
||||
* Used to sort queue entries by depth.
|
||||
@@ -167,8 +167,8 @@ public final class BatchControl {
|
||||
if (persistList == null) {
|
||||
// special case where the same bean instance has been added
|
||||
// to the batch more than once
|
||||
if (logger.isLoggable(Level.FINE)) {
|
||||
logger.fine("Bean instance already in this batch: " + request.getBean());
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Bean instance already in this batch: " + request.getBean());
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package com.avaje.ebeaninternal.server.persist;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
|
||||
@@ -19,7 +20,7 @@ import javax.persistence.PersistenceException;
|
||||
*/
|
||||
public class BatchedPstmtHolder {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(BatchedPstmtHolder.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(BatchedPstmtHolder.class);
|
||||
|
||||
/**
|
||||
* A Map of the statements using a String key. This is used so that the same
|
||||
@@ -101,7 +102,7 @@ public class BatchedPstmtHolder {
|
||||
} catch (SQLException ex) {
|
||||
SQLException next = ex.getNextException();
|
||||
while(next != null) {
|
||||
logger.log(Level.SEVERE, "Next Exception during batch execution", next);
|
||||
logger.error("Next Exception during batch execution", next);
|
||||
next = next.getNextException();
|
||||
}
|
||||
|
||||
@@ -109,7 +110,7 @@ public class BatchedPstmtHolder {
|
||||
firstError = ex;
|
||||
errorSql = bs.getSql();
|
||||
} else {
|
||||
logger.log(Level.SEVERE, null, ex);
|
||||
logger.error(null, ex);
|
||||
}
|
||||
isError = true;
|
||||
|
||||
@@ -118,7 +119,7 @@ public class BatchedPstmtHolder {
|
||||
bs.close();
|
||||
} catch (SQLException ex) {
|
||||
// error closing PreparedStatement
|
||||
logger.log(Level.SEVERE, null, ex);
|
||||
logger.error(null, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import java.sql.SQLException;
|
||||
import java.sql.Types;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
|
||||
@@ -15,13 +14,15 @@ import com.avaje.ebeaninternal.server.core.Message;
|
||||
import com.avaje.ebeaninternal.server.type.DataBind;
|
||||
import com.avaje.ebeaninternal.server.type.ScalarType;
|
||||
import com.avaje.ebeaninternal.server.type.TypeManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Binds bean values to a PreparedStatement.
|
||||
*/
|
||||
public class Binder {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(Binder.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(Binder.class);
|
||||
|
||||
//private final Calendar calendar;
|
||||
|
||||
@@ -141,7 +142,7 @@ public class Binder {
|
||||
}
|
||||
|
||||
} catch (SQLException ex) {
|
||||
logger.warning(Message.msg("fetch.bind.error", "" + (dataBind.currentPos() - 1), value));
|
||||
logger.warn(Message.msg("fetch.bind.error", "" + (dataBind.currentPos() - 1), value));
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,6 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
|
||||
@@ -40,6 +38,8 @@ import com.avaje.ebeaninternal.server.deploy.BeanPropertyAssocMany;
|
||||
import com.avaje.ebeaninternal.server.deploy.BeanPropertyAssocOne;
|
||||
import com.avaje.ebeaninternal.server.deploy.IntersectionRow;
|
||||
import com.avaje.ebeaninternal.server.deploy.ManyType;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Persister implementation using DML.
|
||||
@@ -59,7 +59,7 @@ import com.avaje.ebeaninternal.server.deploy.ManyType;
|
||||
*/
|
||||
public final class DefaultPersister implements Persister {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DefaultPersister.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(DefaultPersister.class);
|
||||
|
||||
/**
|
||||
* Actually does the persisting work.
|
||||
@@ -403,8 +403,8 @@ public final class DefaultPersister implements Persister {
|
||||
|
||||
} else {
|
||||
// skip validation on unchanged bean
|
||||
if (logger.isLoggable(Level.FINE)) {
|
||||
logger.fine(Message.msg("persist.update.skipped", request.getBean()));
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug(Message.msg("persist.update.skipped", request.getBean()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -426,8 +426,8 @@ public final class DefaultPersister implements Persister {
|
||||
if (req.isRegisteredForDeleteBean()) {
|
||||
// skip deleting bean. Used where cascade is on
|
||||
// both sides of a relationship
|
||||
if (logger.isLoggable(Level.FINE)) {
|
||||
logger.fine("skipping delete on alreadyRegistered " + bean);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("skipping delete on alreadyRegistered " + bean);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -1022,7 +1022,7 @@ public final class DefaultPersister implements Persister {
|
||||
if (t.isLogSummary()) {
|
||||
t.logInternal(m);
|
||||
}
|
||||
logger.log(Level.WARNING, m);
|
||||
logger.warn(m);
|
||||
|
||||
} else {
|
||||
if (!prop.hasImportedId(otherBean)) {
|
||||
|
||||
@@ -2,8 +2,6 @@ package com.avaje.ebeaninternal.server.persist;
|
||||
|
||||
import java.sql.CallableStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
|
||||
@@ -14,13 +12,15 @@ import com.avaje.ebeaninternal.server.core.PersistRequestCallableSql;
|
||||
import com.avaje.ebeaninternal.server.core.PstmtBatch;
|
||||
import com.avaje.ebeaninternal.server.type.DataBind;
|
||||
import com.avaje.ebeaninternal.server.util.BindParamsParser;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Handles the execution of CallableSql requests.
|
||||
*/
|
||||
public class ExeCallableSql {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(ExeCallableSql.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(ExeCallableSql.class);
|
||||
|
||||
private final Binder binder;
|
||||
|
||||
@@ -68,7 +68,7 @@ public class ExeCallableSql {
|
||||
try {
|
||||
cstmt.close();
|
||||
} catch (SQLException e) {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@ package com.avaje.ebeaninternal.server.persist;
|
||||
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
|
||||
@@ -15,13 +13,15 @@ import com.avaje.ebeaninternal.server.core.PstmtBatch;
|
||||
import com.avaje.ebeaninternal.server.deploy.BeanDescriptor;
|
||||
import com.avaje.ebeaninternal.server.type.DataBind;
|
||||
import com.avaje.ebeaninternal.server.util.BindParamsParser;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Executes the UpdateSql requests.
|
||||
*/
|
||||
public class ExeOrmUpdate {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(ExeOrmUpdate.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(ExeOrmUpdate.class);
|
||||
|
||||
private final Binder binder;
|
||||
|
||||
@@ -82,7 +82,7 @@ public class ExeOrmUpdate {
|
||||
try {
|
||||
pstmt.close();
|
||||
} catch (SQLException e) {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@ package com.avaje.ebeaninternal.server.persist;
|
||||
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
|
||||
@@ -15,13 +13,15 @@ import com.avaje.ebeaninternal.server.core.PersistRequestUpdateSql.SqlType;
|
||||
import com.avaje.ebeaninternal.server.core.PstmtBatch;
|
||||
import com.avaje.ebeaninternal.server.type.DataBind;
|
||||
import com.avaje.ebeaninternal.server.util.BindParamsParser;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Executes the UpdateSql requests.
|
||||
*/
|
||||
public class ExeUpdateSql {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(ExeUpdateSql.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(ExeUpdateSql.class);
|
||||
|
||||
private final Binder binder;
|
||||
|
||||
@@ -80,7 +80,7 @@ public class ExeUpdateSql {
|
||||
try {
|
||||
pstmt.close();
|
||||
} catch (SQLException e) {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.avaje.ebeaninternal.server.persist.dml;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
|
||||
@@ -11,6 +9,8 @@ import com.avaje.ebeaninternal.server.core.PersistRequest;
|
||||
import com.avaje.ebeaninternal.server.core.PersistRequestBean;
|
||||
import com.avaje.ebeaninternal.server.lib.util.StringHelper;
|
||||
import com.avaje.ebeaninternal.server.persist.BeanPersister;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Bean persister that uses the Handler and Meta objects.
|
||||
@@ -23,7 +23,7 @@ import com.avaje.ebeaninternal.server.persist.BeanPersister;
|
||||
*/
|
||||
public final class DmlBeanPersister implements BeanPersister {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DmlBeanPersister.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(DmlBeanPersister.class);
|
||||
|
||||
private final UpdateMeta updateMeta;
|
||||
|
||||
@@ -101,7 +101,7 @@ public final class DmlBeanPersister implements BeanPersister {
|
||||
try {
|
||||
handler.close();
|
||||
} catch (SQLException e) {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,6 @@ import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.persistence.OptimisticLockException;
|
||||
|
||||
@@ -19,6 +17,8 @@ import com.avaje.ebeaninternal.server.persist.BatchedPstmt;
|
||||
import com.avaje.ebeaninternal.server.persist.BatchedPstmtHolder;
|
||||
import com.avaje.ebeaninternal.server.persist.dmlbind.BindableRequest;
|
||||
import com.avaje.ebeaninternal.server.type.DataBind;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
||||
/**
|
||||
@@ -26,7 +26,7 @@ import com.avaje.ebeaninternal.server.type.DataBind;
|
||||
*/
|
||||
public abstract class DmlHandler implements PersistHandler, BindableRequest {
|
||||
|
||||
protected static final Logger logger = Logger.getLogger(DmlHandler.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(DmlHandler.class);
|
||||
|
||||
/**
|
||||
* The originating request.
|
||||
@@ -125,7 +125,7 @@ public abstract class DmlHandler implements PersistHandler, BindableRequest {
|
||||
dataBind.close();
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
logger.log(Level.SEVERE, null, ex);
|
||||
logger.error(null, ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import javax.persistence.OptimisticLockException;
|
||||
import javax.persistence.PersistenceException;
|
||||
@@ -21,11 +20,14 @@ import com.avaje.ebeaninternal.server.deploy.BeanDescriptor;
|
||||
import com.avaje.ebeaninternal.server.deploy.BeanProperty;
|
||||
import com.avaje.ebeaninternal.server.persist.DmlUtil;
|
||||
import com.avaje.ebeaninternal.server.type.DataBind;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Insert bean handler.
|
||||
*/
|
||||
public class InsertHandler extends DmlHandler {
|
||||
private static final Logger logger = LoggerFactory.getLogger(InsertHandler.class);
|
||||
|
||||
/**
|
||||
* The associated InsertMeta data.
|
||||
@@ -186,7 +188,7 @@ public class InsertHandler extends DmlHandler {
|
||||
rset.close();
|
||||
} catch (SQLException ex) {
|
||||
String msg = "Error closing rset for returning generatedKeys?";
|
||||
logger.log(Level.WARNING, msg, ex);
|
||||
logger.warn(msg, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -219,7 +221,7 @@ public class InsertHandler extends DmlHandler {
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
String msg = "Error closing rset for fetchGeneratedKeyUsingSelect?";
|
||||
logger.log(Level.WARNING, msg, ex);
|
||||
logger.warn(msg, ex);
|
||||
}
|
||||
try {
|
||||
if (stmt != null) {
|
||||
@@ -227,7 +229,7 @@ public class InsertHandler extends DmlHandler {
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
String msg = "Error closing stmt for fetchGeneratedKeyUsingSelect?";
|
||||
logger.log(Level.WARNING, msg, ex);
|
||||
logger.warn(msg, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.avaje.ebeaninternal.server.query;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebean.bean.BeanCollection;
|
||||
import com.avaje.ebeaninternal.api.SpiTransaction;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Continue the fetch using a Background thread. The client knows when this has
|
||||
@@ -13,7 +13,7 @@ import com.avaje.ebeaninternal.api.SpiTransaction;
|
||||
*/
|
||||
public class BackgroundFetch implements Callable<Integer> {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(BackgroundFetch.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(BackgroundFetch.class);
|
||||
|
||||
private final CQuery<?> cquery;
|
||||
|
||||
@@ -38,14 +38,14 @@ public class BackgroundFetch implements Callable<Integer> {
|
||||
return bc.size();
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
return Integer.valueOf(0);
|
||||
|
||||
} finally {
|
||||
try {
|
||||
cquery.close();
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
}
|
||||
try {
|
||||
// we must have our own transaction for background fetching
|
||||
@@ -53,7 +53,7 @@ public class BackgroundFetch implements Callable<Integer> {
|
||||
// connection back into the connection pool.
|
||||
transaction.rollback();
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,13 +4,13 @@ import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebeaninternal.api.BeanIdList;
|
||||
import com.avaje.ebeaninternal.api.SpiTransaction;
|
||||
import com.avaje.ebeaninternal.server.deploy.BeanDescriptor;
|
||||
import com.avaje.ebeaninternal.server.deploy.DbReadContext;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Continue the fetch using a Background thread. The client knows when this has
|
||||
@@ -18,7 +18,7 @@ import com.avaje.ebeaninternal.server.deploy.DbReadContext;
|
||||
*/
|
||||
public class BackgroundIdFetch implements Callable<Integer> {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(BackgroundIdFetch.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(BackgroundIdFetch.class);
|
||||
|
||||
private final ResultSet rset;
|
||||
|
||||
@@ -61,21 +61,21 @@ public class BackgroundIdFetch implements Callable<Integer> {
|
||||
rowsRead++;
|
||||
}
|
||||
|
||||
if (logger.isLoggable(Level.INFO)){
|
||||
if (logger.isInfoEnabled()){
|
||||
logger.info("BG FetchIds read:"+rowsRead+" total:"+(startSize+rowsRead));
|
||||
}
|
||||
|
||||
return rowsRead;
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
return 0;
|
||||
|
||||
} finally {
|
||||
try {
|
||||
close();
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
}
|
||||
try {
|
||||
// we must have our own transaction for background fetching
|
||||
@@ -83,7 +83,7 @@ public class BackgroundIdFetch implements Callable<Integer> {
|
||||
// connection back into the connection pool.
|
||||
transaction.rollback();
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,14 +95,14 @@ public class BackgroundIdFetch implements Callable<Integer> {
|
||||
rset.close();
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
}
|
||||
try {
|
||||
if (pstmt != null) {
|
||||
pstmt.close();
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,6 @@ import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
|
||||
@@ -41,6 +39,8 @@ import com.avaje.ebeaninternal.server.querydefn.OrmQueryProperties;
|
||||
import com.avaje.ebeaninternal.server.transaction.DefaultPersistenceContext;
|
||||
import com.avaje.ebeaninternal.server.type.DataBind;
|
||||
import com.avaje.ebeaninternal.server.type.DataReader;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* An object that represents a SqlSelect statement.
|
||||
@@ -56,7 +56,7 @@ import com.avaje.ebeaninternal.server.type.DataReader;
|
||||
*/
|
||||
public class CQuery<T> implements DbReadContext, CancelableQuery {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(CQuery.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(CQuery.class);
|
||||
|
||||
private static final int GLOBAL_ROW_LIMIT = 1000000;
|
||||
|
||||
@@ -400,7 +400,7 @@ public class CQuery<T> implements DbReadContext, CancelableQuery {
|
||||
dataReader = null;
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
}
|
||||
try {
|
||||
if (pstmt != null) {
|
||||
@@ -408,7 +408,7 @@ public class CQuery<T> implements DbReadContext, CancelableQuery {
|
||||
pstmt = null;
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -654,7 +654,7 @@ public class CQuery<T> implements DbReadContext, CancelableQuery {
|
||||
queryPlan.executionTime(loadedBeanCount, executionTimeMicros);
|
||||
|
||||
} catch (Exception e){
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.avaje.ebeaninternal.server.query;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.concurrent.FutureTask;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebean.BackgroundExecutor;
|
||||
import com.avaje.ebean.QueryIterator;
|
||||
@@ -15,13 +14,15 @@ import com.avaje.ebeaninternal.api.SpiQuery;
|
||||
import com.avaje.ebeaninternal.server.core.OrmQueryRequest;
|
||||
import com.avaje.ebeaninternal.server.jmx.MAdminLogging;
|
||||
import com.avaje.ebeaninternal.server.persist.Binder;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Handles the Object Relational fetching.
|
||||
*/
|
||||
public class CQueryEngine {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(CQueryEngine.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(CQueryEngine.class);
|
||||
|
||||
private final CQueryBuilder queryBuilder;
|
||||
|
||||
@@ -66,7 +67,7 @@ public class CQueryEngine {
|
||||
|
||||
if (!list.isFetchingInBackground() && request.getQuery().isFutureFetch()) {
|
||||
// end the transaction for futureFindIds (it had it's own one)
|
||||
logger.fine("Future findIds completed!");
|
||||
logger.debug("Future findIds completed!");
|
||||
request.getTransaction().end();
|
||||
}
|
||||
|
||||
@@ -100,7 +101,7 @@ public class CQueryEngine {
|
||||
}
|
||||
|
||||
if (request.getQuery().isFutureFetch()) {
|
||||
logger.fine("Future findRowCount completed!");
|
||||
logger.debug("Future findRowCount completed!");
|
||||
request.getTransaction().end();
|
||||
}
|
||||
|
||||
@@ -132,7 +133,7 @@ public class CQueryEngine {
|
||||
|
||||
if (!cquery.prepareBindExecuteQuery()) {
|
||||
// query has been cancelled already
|
||||
logger.finest("Future fetch already cancelled");
|
||||
logger.trace("Future fetch already cancelled");
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -173,7 +174,7 @@ public class CQueryEngine {
|
||||
|
||||
if (!cquery.prepareBindExecuteQuery()) {
|
||||
// query has been cancelled already
|
||||
logger.finest("Future fetch already cancelled");
|
||||
logger.trace("Future fetch already cancelled");
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -221,7 +222,7 @@ public class CQueryEngine {
|
||||
if (request.getQuery().isFutureFetch()) {
|
||||
// end the transaction for futureFindIds
|
||||
// as it had it's own transaction
|
||||
logger.fine("Future fetch completed!");
|
||||
logger.debug("Future fetch completed!");
|
||||
request.getTransaction().end();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,6 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.FutureTask;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebean.BackgroundExecutor;
|
||||
import com.avaje.ebean.bean.BeanCollection;
|
||||
@@ -28,13 +26,15 @@ import com.avaje.ebeaninternal.server.deploy.DbReadContext;
|
||||
import com.avaje.ebeaninternal.server.type.DataBind;
|
||||
import com.avaje.ebeaninternal.server.type.DataReader;
|
||||
import com.avaje.ebeaninternal.server.type.RsetDataReader;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Executes the select row count query.
|
||||
*/
|
||||
public class CQueryFetchIds {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(CQueryFetchIds.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(CQueryFetchIds.class);
|
||||
|
||||
/**
|
||||
* The overall find request wrapper object.
|
||||
@@ -236,7 +236,7 @@ public class CQueryFetchIds {
|
||||
dataReader = null;
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
}
|
||||
try {
|
||||
if (pstmt != null) {
|
||||
@@ -244,7 +244,7 @@ public class CQueryFetchIds {
|
||||
pstmt = null;
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@ package com.avaje.ebeaninternal.server.query;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebeaninternal.api.BindParams;
|
||||
import com.avaje.ebeaninternal.api.BindParams.OrderedList;
|
||||
@@ -19,6 +17,8 @@ import com.avaje.ebeaninternal.server.querydefn.OrmQueryProperties;
|
||||
import com.avaje.ebeaninternal.server.type.DataBind;
|
||||
import com.avaje.ebeaninternal.server.util.BindParamsParser;
|
||||
import com.avaje.ebeaninternal.util.DefaultExpressionRequest;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Compile Query Predicates.
|
||||
@@ -33,7 +33,7 @@ import com.avaje.ebeaninternal.util.DefaultExpressionRequest;
|
||||
*/
|
||||
public class CQueryPredicates {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(CQueryPredicates.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(CQueryPredicates.class);
|
||||
|
||||
private final Binder binder;
|
||||
|
||||
@@ -455,7 +455,7 @@ public class CQueryPredicates {
|
||||
msg += " must come before the many property [" + manyProp.getName() + "] in the orderBy.";
|
||||
msg += " Ebean has automatically modified the orderBy clause to do this.";
|
||||
|
||||
logger.log(Level.WARNING, msg);
|
||||
logger.warn(msg);
|
||||
}
|
||||
|
||||
// the id needs to come before the manyPropName
|
||||
|
||||
@@ -4,8 +4,6 @@ import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
|
||||
@@ -15,13 +13,15 @@ import com.avaje.ebeaninternal.server.core.OrmQueryRequest;
|
||||
import com.avaje.ebeaninternal.server.core.SpiOrmQueryRequest;
|
||||
import com.avaje.ebeaninternal.server.deploy.BeanDescriptor;
|
||||
import com.avaje.ebeaninternal.server.type.DataBind;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Executes the select row count query.
|
||||
*/
|
||||
public class CQueryRowCount {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(CQueryRowCount.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(CQueryRowCount.class);
|
||||
|
||||
/**
|
||||
* The overall find request wrapper object.
|
||||
@@ -157,7 +157,7 @@ public class CQueryRowCount {
|
||||
rset = null;
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
}
|
||||
try {
|
||||
if (pstmt != null) {
|
||||
@@ -165,7 +165,7 @@ public class CQueryRowCount {
|
||||
pstmt = null;
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+7
-7
@@ -6,8 +6,6 @@ import java.sql.ResultSet;
|
||||
import java.sql.ResultSetMetaData;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
|
||||
@@ -25,13 +23,15 @@ import com.avaje.ebeaninternal.server.jmx.MAdminLogging;
|
||||
import com.avaje.ebeaninternal.server.persist.Binder;
|
||||
import com.avaje.ebeaninternal.server.type.DataBind;
|
||||
import com.avaje.ebeaninternal.server.util.BindParamsParser;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Perform native sql fetches.
|
||||
*/
|
||||
public class DefaultRelationalQueryEngine implements RelationalQueryEngine {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DefaultRelationalQueryEngine.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(DefaultRelationalQueryEngine.class);
|
||||
|
||||
private final int defaultMaxRows;
|
||||
|
||||
@@ -75,7 +75,7 @@ public class DefaultRelationalQueryEngine implements RelationalQueryEngine {
|
||||
|
||||
synchronized (query) {
|
||||
if (query.isCancelled()){
|
||||
logger.finest("Query already cancelled");
|
||||
logger.trace("Query already cancelled");
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ public class DefaultRelationalQueryEngine implements RelationalQueryEngine {
|
||||
}
|
||||
|
||||
if (query.isCancelled()){
|
||||
logger.fine("Query was cancelled during execution rows:"+loadRowCount);
|
||||
logger.debug("Query was cancelled during execution rows:"+loadRowCount);
|
||||
}
|
||||
|
||||
return beanColl;
|
||||
@@ -198,14 +198,14 @@ public class DefaultRelationalQueryEngine implements RelationalQueryEngine {
|
||||
rset.close();
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
}
|
||||
try {
|
||||
if (pstmt != null) {
|
||||
pstmt.close();
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
logger.error(null, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package com.avaje.ebeaninternal.server.query;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
|
||||
import com.avaje.ebean.config.dbplatform.DatabasePlatform;
|
||||
@@ -16,6 +13,8 @@ import com.avaje.ebeaninternal.server.deploy.DeployNamedQuery;
|
||||
import com.avaje.ebeaninternal.server.deploy.DeployParser;
|
||||
import com.avaje.ebeaninternal.server.persist.Binder;
|
||||
import com.avaje.ebeaninternal.server.querydefn.OrmQueryLimitRequest;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Factory for SqlSelectClause based on raw sql.
|
||||
@@ -26,7 +25,7 @@ import com.avaje.ebeaninternal.server.querydefn.OrmQueryLimitRequest;
|
||||
*/
|
||||
public class RawSqlSelectClauseBuilder {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(RawSqlSelectClauseBuilder.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(RawSqlSelectClauseBuilder.class);
|
||||
|
||||
private final Binder binder;
|
||||
|
||||
@@ -92,7 +91,7 @@ public class RawSqlSelectClauseBuilder {
|
||||
} catch (Exception e) {
|
||||
|
||||
String msg = "Error with " + desc.getFullName() + " query:\r" + sql;
|
||||
logger.log(Level.SEVERE, msg);
|
||||
logger.error(msg);
|
||||
throw new PersistenceException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,6 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebeaninternal.api.ManyWhereJoins;
|
||||
import com.avaje.ebeaninternal.api.SpiQuery;
|
||||
@@ -26,13 +24,15 @@ import com.avaje.ebeaninternal.server.deploy.TableJoin;
|
||||
import com.avaje.ebeaninternal.server.el.ElPropertyValue;
|
||||
import com.avaje.ebeaninternal.server.querydefn.OrmQueryDetail;
|
||||
import com.avaje.ebeaninternal.server.querydefn.OrmQueryProperties;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Factory for SqlTree.
|
||||
*/
|
||||
public class SqlTreeBuilder {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(SqlTreeBuilder.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(SqlTreeBuilder.class);
|
||||
|
||||
private final SpiQuery<?> query;
|
||||
|
||||
@@ -322,7 +322,7 @@ public class SqlTreeBuilder {
|
||||
|
||||
BeanProperty p = desc.findBeanProperty(propName);
|
||||
if (p == null) {
|
||||
logger.log(Level.SEVERE, "property [" + propName + "]not found on " + desc + " for query - excluding it.");
|
||||
logger.error("property [" + propName + "]not found on " + desc + " for query - excluding it.");
|
||||
|
||||
}
|
||||
else if (p instanceof BeanPropertyAssoc<?> && p.isEmbedded()) {
|
||||
@@ -356,7 +356,7 @@ public class SqlTreeBuilder {
|
||||
BeanProperty p = desc.findBeanProperty(baseName);
|
||||
if (p == null) {
|
||||
String m = "property [" + propName + "] not found on " + desc + " for query - excluding it.";
|
||||
logger.log(Level.SEVERE, m);
|
||||
logger.error(m);
|
||||
|
||||
} else if (p.isEmbedded()) {
|
||||
// add the embedded bean (and effectively
|
||||
@@ -369,7 +369,7 @@ public class SqlTreeBuilder {
|
||||
} else {
|
||||
String m = "property [" + p.getFullBeanName()
|
||||
+ "] expected to be an embedded bean for query - excluding it.";
|
||||
logger.log(Level.SEVERE, m);
|
||||
logger.error(m);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -378,8 +378,8 @@ public class SqlTreeBuilder {
|
||||
// sub class hierarchy if required
|
||||
BeanProperty p = desc.findBeanProperty(propName);
|
||||
if (p == null) {
|
||||
logger.log(Level.SEVERE, "property [" + propName + "] not found on " + desc
|
||||
+ " for query - excluding it.");
|
||||
logger.error("property [" + propName + "] not found on " + desc
|
||||
+ " for query - excluding it.");
|
||||
|
||||
} else if (p.isId()) {
|
||||
// do not bother to include id for normal queries as the
|
||||
@@ -474,9 +474,9 @@ public class SqlTreeBuilder {
|
||||
|
||||
if (manyProperty != null) {
|
||||
// only one many associated allowed to be included in fetch
|
||||
if (logger.isLoggable(Level.FINE)) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
String msg = "Not joining [" + propName + "] as already joined to a Many[" + manyProperty + "].";
|
||||
logger.fine(msg);
|
||||
logger.debug(msg);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.avaje.ebeaninternal.server.resource;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
|
||||
@@ -12,6 +11,8 @@ import com.avaje.ebeaninternal.server.lib.resource.FileResourceSource;
|
||||
import com.avaje.ebeaninternal.server.lib.resource.ResourceSource;
|
||||
import com.avaje.ebeaninternal.server.lib.resource.UrlResourceSource;
|
||||
import com.avaje.ebeaninternal.server.lib.util.NotFoundException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Creates a ResourceManager for a server depending on the avaje.properties.
|
||||
@@ -22,7 +23,7 @@ import com.avaje.ebeaninternal.server.lib.util.NotFoundException;
|
||||
*/
|
||||
public class ResourceManagerFactory {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(ResourceManagerFactory.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(ResourceManagerFactory.class);
|
||||
|
||||
/**
|
||||
* Construct with the properties for a server.
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.avaje.ebeaninternal.server.subclass;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebean.enhance.agent.AlreadyEnhancedException;
|
||||
import com.avaje.ebean.enhance.agent.ClassMeta;
|
||||
import com.avaje.ebean.enhance.agent.EnhanceConstants;
|
||||
@@ -22,10 +20,12 @@ import com.avaje.ebean.enhance.asm.ClassVisitor;
|
||||
import com.avaje.ebean.enhance.asm.FieldVisitor;
|
||||
import com.avaje.ebean.enhance.asm.MethodVisitor;
|
||||
import com.avaje.ebean.enhance.asm.Opcodes;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class SubClassClassAdpater extends ClassAdapter implements EnhanceConstants {
|
||||
|
||||
static final Logger logger = Logger.getLogger(SubClassClassAdpater.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(SubClassClassAdpater.class);
|
||||
|
||||
final EnhanceContext enhanceContext;
|
||||
|
||||
|
||||
@@ -2,14 +2,14 @@ package com.avaje.ebeaninternal.server.subclass;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebean.enhance.agent.ClassPathClassBytesReader;
|
||||
import com.avaje.ebean.enhance.agent.EnhanceConstants;
|
||||
import com.avaje.ebean.enhance.agent.EnhanceContext;
|
||||
import com.avaje.ebean.enhance.asm.ClassReader;
|
||||
import com.avaje.ebean.enhance.asm.ClassWriter;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Creates Classes that implement EntityBean for a given normal bean Class.
|
||||
@@ -21,7 +21,7 @@ import com.avaje.ebean.enhance.asm.ClassWriter;
|
||||
*/
|
||||
public class SubClassFactory extends ClassLoader implements EnhanceConstants, GenSuffix {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(SubClassFactory.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(SubClassFactory.class);
|
||||
|
||||
private static final int CLASS_WRITER_FLAGS = ClassWriter.COMPUTE_FRAMES + ClassWriter.COMPUTE_MAXS;
|
||||
|
||||
@@ -68,12 +68,12 @@ public class SubClassFactory extends ClassLoader implements EnhanceConstants, Ge
|
||||
|
||||
} catch (IOException ex){
|
||||
String m = "Error creating subclass for ["+clsName+"]";
|
||||
logger.log(Level.SEVERE, m, ex);
|
||||
logger.error(m, ex);
|
||||
throw ex;
|
||||
|
||||
} catch (Throwable ex){
|
||||
String m = "Error creating subclass for ["+clsName+"]";
|
||||
logger.log(Level.SEVERE, m, ex);
|
||||
logger.error(m, ex);
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,9 +106,9 @@ public class SubClassGenerator {// extends ClassAdapter implements Opcodes, GenC
|
||||
// String methodKey = name + ":" + desc;
|
||||
//
|
||||
// if (hasSuperClass){
|
||||
// if (logger.isLoggable(Level.FINER)){
|
||||
// if (logger.isTraceEnabled()){
|
||||
// String msg = "existing methods "+info.getClassName()+" "+methodKey;
|
||||
// logger.finer(msg);
|
||||
// logger.trace(msg);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
@@ -186,7 +186,7 @@ public class SubClassGenerator {// extends ClassAdapter implements Opcodes, GenC
|
||||
// } else {
|
||||
// String m = "Can not generate equals for ["+info.getClassName();
|
||||
// m += "]. Concatinated id?";
|
||||
// logger.warning(m);
|
||||
// logger.warn(m);
|
||||
// }
|
||||
// } else {
|
||||
//
|
||||
@@ -245,7 +245,7 @@ public class SubClassGenerator {// extends ClassAdapter implements Opcodes, GenC
|
||||
// } else {
|
||||
// String m = "Can not generate equals for ["+info.getClassName();
|
||||
// m += "] due to type of id property: "+idGetterDesc;
|
||||
// logger.warning(m);
|
||||
// logger.warn(m);
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -4,13 +4,14 @@ import java.security.AccessController;
|
||||
import java.security.PrivilegedActionException;
|
||||
import java.security.PrivilegedExceptionAction;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
|
||||
import com.avaje.ebean.config.ServerConfig;
|
||||
import com.avaje.ebean.enhance.agent.EnhanceConstants;
|
||||
import com.avaje.ebeaninternal.api.ClassUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Creates and caches the dynamically generated subclasses.
|
||||
@@ -21,7 +22,7 @@ import com.avaje.ebeaninternal.api.ClassUtil;
|
||||
*/
|
||||
public class SubClassManager implements EnhanceConstants {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(SubClassManager.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(SubClassManager.class);
|
||||
|
||||
private final ConcurrentHashMap<String,Class<?>> clzMap;
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
import javax.persistence.RollbackException;
|
||||
@@ -21,13 +19,15 @@ import com.avaje.ebeaninternal.api.SpiTransaction;
|
||||
import com.avaje.ebeaninternal.api.TransactionEvent;
|
||||
import com.avaje.ebeaninternal.server.persist.BatchControl;
|
||||
import com.avaje.ebeaninternal.server.transaction.TransactionManager.OnQueryOnly;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* JDBC Connection based transaction.
|
||||
*/
|
||||
public class JdbcTransaction implements SpiTransaction {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(JdbcTransaction.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(JdbcTransaction.class);
|
||||
|
||||
private static final String illegalStateMessage = "Transaction is Inactive";
|
||||
|
||||
@@ -517,7 +517,7 @@ public class JdbcTransaction implements SpiTransaction {
|
||||
connection.setReadOnly(false);
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
logger.log(Level.SEVERE, "Error setting to readOnly?", e);
|
||||
logger.error("Error setting to readOnly?", e);
|
||||
}
|
||||
try {
|
||||
if (this.autoCommit) {
|
||||
@@ -525,14 +525,14 @@ public class JdbcTransaction implements SpiTransaction {
|
||||
connection.setAutoCommit(true);
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
logger.log(Level.SEVERE, "Error setting to readOnly?", e);
|
||||
logger.error("Error setting to readOnly?", e);
|
||||
}
|
||||
try {
|
||||
connection.close();
|
||||
} catch (Exception ex) {
|
||||
// the connection pool will automatically remove the
|
||||
// connection if it does not pass the test
|
||||
logger.log(Level.SEVERE, "Error closing connection", ex);
|
||||
logger.error("Error closing connection", ex);
|
||||
}
|
||||
connection = null;
|
||||
active = false;
|
||||
@@ -581,7 +581,7 @@ public class JdbcTransaction implements SpiTransaction {
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
String m = "Error when ending a query only transaction via " + onQueryOnly;
|
||||
logger.log(Level.SEVERE, m, e);
|
||||
logger.error(m, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+11
-12
@@ -1,8 +1,5 @@
|
||||
package com.avaje.ebeaninternal.server.transaction;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.naming.InitialContext;
|
||||
import javax.naming.NamingException;
|
||||
import javax.persistence.PersistenceException;
|
||||
@@ -20,6 +17,8 @@ import javax.transaction.UserTransaction;
|
||||
import com.avaje.ebean.LogLevel;
|
||||
import com.avaje.ebean.config.ExternalTransactionManager;
|
||||
import com.avaje.ebeaninternal.api.SpiTransaction;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Hook into external JTA transaction manager.
|
||||
@@ -28,7 +27,7 @@ import com.avaje.ebeaninternal.api.SpiTransaction;
|
||||
*/
|
||||
public class JtaTransactionManager implements ExternalTransactionManager {
|
||||
|
||||
private final static Logger logger = Logger.getLogger(JtaTransactionManager.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(JtaTransactionManager.class);
|
||||
|
||||
private static final String EBEAN_TXN_RESOURCE = "EBEAN_TXN_RESOURCE";
|
||||
|
||||
@@ -106,15 +105,15 @@ public class JtaTransactionManager implements ExternalTransactionManager {
|
||||
if (currentEbeanTransaction != null){
|
||||
// NOT expecting this so log WARNING
|
||||
String msg = "JTA Transaction - no current txn BUT using current Ebean one "+currentEbeanTransaction.getId();
|
||||
logger.log(Level.WARNING, msg);
|
||||
logger.warn(msg);
|
||||
return currentEbeanTransaction;
|
||||
}
|
||||
|
||||
UserTransaction ut = getUserTransaction();
|
||||
if (ut == null){
|
||||
// no current JTA transaction
|
||||
if (logger.isLoggable(Level.FINE)){
|
||||
logger.fine("JTA Transaction - no current txn");
|
||||
if (logger.isDebugEnabled()){
|
||||
logger.debug("JTA Transaction - no current txn");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -203,8 +202,8 @@ public class JtaTransactionManager implements ExternalTransactionManager {
|
||||
|
||||
switch (status) {
|
||||
case Status.STATUS_COMMITTED:
|
||||
if (logger.isLoggable(Level.FINE)){
|
||||
logger.fine("Jta Txn ["+transaction.getId()+"] committed");
|
||||
if (logger.isDebugEnabled()){
|
||||
logger.debug("Jta Txn ["+transaction.getId()+"] committed");
|
||||
}
|
||||
transactionManager.notifyOfCommit(transaction);
|
||||
// Remove this transaction object as it is completed
|
||||
@@ -212,8 +211,8 @@ public class JtaTransactionManager implements ExternalTransactionManager {
|
||||
break;
|
||||
|
||||
case Status.STATUS_ROLLEDBACK:
|
||||
if (logger.isLoggable(Level.FINE)){
|
||||
logger.fine("Jta Txn ["+transaction.getId()+"] rollback");
|
||||
if (logger.isDebugEnabled()){
|
||||
logger.debug("Jta Txn ["+transaction.getId()+"] rollback");
|
||||
}
|
||||
transactionManager.notifyOfRollback(transaction, null);
|
||||
// Remove this transaction object as it is completed
|
||||
@@ -221,7 +220,7 @@ public class JtaTransactionManager implements ExternalTransactionManager {
|
||||
break;
|
||||
|
||||
default:
|
||||
logger.fine("Jta Txn ["+transaction.getId()+"] status:"+status);
|
||||
logger.debug("Jta Txn ["+transaction.getId()+"] status:"+status);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@ package com.avaje.ebeaninternal.server.transaction;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebeaninternal.api.SpiTransaction;
|
||||
import com.avaje.ebeaninternal.api.TransactionEvent;
|
||||
@@ -13,6 +11,8 @@ import com.avaje.ebeaninternal.api.TransactionEventTable.TableIUD;
|
||||
import com.avaje.ebeaninternal.server.cluster.ClusterManager;
|
||||
import com.avaje.ebeaninternal.server.core.PersistRequestBean;
|
||||
import com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Performs post commit processing using a background thread.
|
||||
@@ -22,7 +22,7 @@ import com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager;
|
||||
*/
|
||||
public final class PostCommitProcessing {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(PostCommitProcessing.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(PostCommitProcessing.class);
|
||||
|
||||
private final ClusterManager clusterManager;
|
||||
|
||||
@@ -87,7 +87,7 @@ public final class PostCommitProcessing {
|
||||
public void notifyCluster() {
|
||||
if (remoteTransactionEvent != null && !remoteTransactionEvent.isEmpty()) {
|
||||
// send the interesting events to the cluster
|
||||
if (manager.getClusterDebugLevel() > 0 || logger.isLoggable(Level.FINE)) {
|
||||
if (manager.getClusterDebugLevel() > 0 || logger.isDebugEnabled()) {
|
||||
logger.info("Cluster Send: " + remoteTransactionEvent.toString());
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@ import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
import javax.sql.DataSource;
|
||||
@@ -23,6 +21,8 @@ import com.avaje.ebeaninternal.api.TransactionEventTable.TableIUD;
|
||||
import com.avaje.ebeaninternal.server.cluster.ClusterManager;
|
||||
import com.avaje.ebeaninternal.server.core.BootupClasses;
|
||||
import com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Manages transactions.
|
||||
@@ -33,7 +33,7 @@ import com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager;
|
||||
*/
|
||||
public class TransactionManager {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(TransactionManager.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(TransactionManager.class);
|
||||
|
||||
/**
|
||||
* The behaviour desired when ending a query only transaction.
|
||||
@@ -217,7 +217,7 @@ public class TransactionManager {
|
||||
c.close();
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
logger.log(Level.SEVERE, "closing connection", ex);
|
||||
logger.error("closing connection", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -326,7 +326,7 @@ public class TransactionManager {
|
||||
c.close();
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
logger.log(Level.SEVERE,"Error closing failed connection", e);
|
||||
logger.error("Error closing failed connection", e);
|
||||
}
|
||||
throw new PersistenceException(ex);
|
||||
}
|
||||
@@ -359,7 +359,7 @@ public class TransactionManager {
|
||||
c.close();
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
logger.log(Level.SEVERE,"Error closing failed connection", e);
|
||||
logger.error("Error closing failed connection", e);
|
||||
}
|
||||
throw ex;
|
||||
|
||||
@@ -396,7 +396,7 @@ public class TransactionManager {
|
||||
log(transaction.getLogBuffer());
|
||||
} catch (Exception ex) {
|
||||
String m = "Potentially Transaction Log incomplete due to error:";
|
||||
logger.log(Level.SEVERE, m, ex);
|
||||
logger.error(m, ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -427,7 +427,7 @@ public class TransactionManager {
|
||||
|
||||
} catch (Exception ex) {
|
||||
String m = "Potentially Transaction Log incomplete due to error:";
|
||||
logger.log(Level.SEVERE, m, ex);
|
||||
logger.error(m, ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -482,7 +482,7 @@ public class TransactionManager {
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
String m = "NotifyOfCommit failed. Cache/Lucene potentially not notified.";
|
||||
logger.log(Level.SEVERE, m, ex);
|
||||
logger.error(m, ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -515,7 +515,7 @@ public class TransactionManager {
|
||||
*/
|
||||
public void remoteTransactionEvent(RemoteTransactionEvent remoteEvent) {
|
||||
|
||||
if (clusterDebugLevel > 0 || logger.isLoggable(Level.FINE)){
|
||||
if (clusterDebugLevel > 0 || logger.isDebugEnabled()){
|
||||
logger.info("Cluster Received: "+remoteEvent.toString());
|
||||
}
|
||||
|
||||
|
||||
+9
-9
@@ -7,14 +7,14 @@ import java.io.IOException;
|
||||
import java.io.PrintStream;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
|
||||
import com.avaje.ebeaninternal.server.transaction.TransactionLogBuffer;
|
||||
import com.avaje.ebeaninternal.server.transaction.TransactionLogBuffer.LogEntry;
|
||||
import com.avaje.ebeaninternal.server.transaction.TransactionLogWriter;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Default transaction logger implementation.
|
||||
@@ -30,7 +30,7 @@ import com.avaje.ebeaninternal.server.transaction.TransactionLogWriter;
|
||||
*/
|
||||
public class FileTransactionLogger implements Runnable, TransactionLogWriter {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(FileTransactionLogger.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(FileTransactionLogger.class);
|
||||
|
||||
/**
|
||||
* Used to print stack trace.
|
||||
@@ -158,17 +158,17 @@ public class FileTransactionLogger implements Runnable, TransactionLogWriter {
|
||||
try {
|
||||
// wait max 20 seconds
|
||||
logWriterThread.wait(20000);
|
||||
logger.fine("Shutdown LogBufferWriter " + threadName + " shutdownComplete:" + shutdownComplete);
|
||||
logger.debug("Shutdown LogBufferWriter " + threadName + " shutdownComplete:" + shutdownComplete);
|
||||
|
||||
} catch (InterruptedException e) {
|
||||
logger.fine("InterruptedException:" + e);
|
||||
logger.debug("InterruptedException:" + e);
|
||||
}
|
||||
}
|
||||
|
||||
if (!shutdownComplete) {
|
||||
String m = "WARNING: Shutdown of LogBufferWriter " + threadName + " not completed.";
|
||||
System.err.println(m);
|
||||
logger.warning(m);
|
||||
logger.warn(m);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -186,7 +186,7 @@ public class FileTransactionLogger implements Runnable, TransactionLogWriter {
|
||||
try {
|
||||
Thread.sleep(20);
|
||||
} catch (InterruptedException e) {
|
||||
logger.log(Level.INFO, "Interrupted TxnLogBufferWriter", e);
|
||||
logger.info("Interrupted TxnLogBufferWriter", e);
|
||||
}
|
||||
}
|
||||
synchronized (queueMonitor) {
|
||||
@@ -345,7 +345,7 @@ public class FileTransactionLogger implements Runnable, TransactionLogWriter {
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
logger.log(Level.SEVERE, "Error switch log file", e);
|
||||
logger.error("Error switch log file", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -373,7 +373,7 @@ public class FileTransactionLogger implements Runnable, TransactionLogWriter {
|
||||
} else {
|
||||
if (!f.mkdirs()) {
|
||||
String msg = "Failed to create transaction logs directory " + dir;
|
||||
logger.log(Level.SEVERE, msg);
|
||||
logger.error(msg);
|
||||
}
|
||||
}
|
||||
return dir;
|
||||
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
package com.avaje.ebeaninternal.server.transaction.log;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.avaje.ebean.config.GlobalProperties;
|
||||
import com.avaje.ebean.config.ServerConfig;
|
||||
import com.avaje.ebeaninternal.server.transaction.TransactionLogBuffer;
|
||||
import com.avaje.ebeaninternal.server.transaction.TransactionLogWriter;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Wraps a FileTransactionLogger to provide delayed initialisation.
|
||||
@@ -21,7 +21,7 @@ import com.avaje.ebeaninternal.server.transaction.TransactionLogWriter;
|
||||
*/
|
||||
public class FileTransactionLoggerWrapper implements TransactionLogWriter {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(FileTransactionLoggerWrapper.class.getName());
|
||||
private static final Logger logger = LoggerFactory.getLogger(FileTransactionLoggerWrapper.class);
|
||||
|
||||
private final String serverName;
|
||||
private final String dir;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user