Author: davsclaus
Date: Fri Feb 13 15:58:37 2009
New Revision: 744149

URL: http://svn.apache.org/viewvc?rev=744149&view=rev
Log:
CAMEL-1339: Avoid using @deprecated API in velocity

Modified:
    
camel/branches/camel-1.x/components/camel-velocity/src/main/java/org/apache/camel/component/velocity/VelocityEndpoint.java

Modified: 
camel/branches/camel-1.x/components/camel-velocity/src/main/java/org/apache/camel/component/velocity/VelocityEndpoint.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-1.x/components/camel-velocity/src/main/java/org/apache/camel/component/velocity/VelocityEndpoint.java?rev=744149&r1=744148&r2=744149&view=diff
==============================================================================
--- 
camel/branches/camel-1.x/components/camel-velocity/src/main/java/org/apache/camel/component/velocity/VelocityEndpoint.java
 (original)
+++ 
camel/branches/camel-1.x/components/camel-velocity/src/main/java/org/apache/camel/component/velocity/VelocityEndpoint.java
 Fri Feb 13 15:58:37 2009
@@ -30,7 +30,7 @@
 import org.apache.velocity.app.Velocity;
 import org.apache.velocity.app.VelocityEngine;
 import org.apache.velocity.context.Context;
-import org.apache.velocity.runtime.log.SimpleLog4JLogSystem;
+import org.apache.velocity.runtime.log.Log4JLogChute;
 import org.springframework.core.io.Resource;
 
 /**
@@ -57,12 +57,12 @@
         return ExchangePattern.InOut;
     }
 
-    private VelocityEngine getVelocityEngine() throws Exception {
+    private synchronized VelocityEngine getVelocityEngine() throws Exception {
         if (velocityEngine == null) {
             velocityEngine = component.getVelocityEngine();
             velocityEngine.setProperty(Velocity.FILE_RESOURCE_LOADER_CACHE, 
isLoaderCache() ? Boolean.TRUE : Boolean.FALSE);
-            velocityEngine.setProperty(Velocity.RUNTIME_LOG_LOGSYSTEM_CLASS, 
SimpleLog4JLogSystem.class.getName());
-            velocityEngine.setProperty("runtime.log.logsystem.log4j.category", 
VelocityEndpoint.class.getName());
+            velocityEngine.setProperty(Velocity.RUNTIME_LOG_LOGSYSTEM_CLASS, 
Log4JLogChute.class.getName());
+            velocityEngine.setProperty(Log4JLogChute.RUNTIME_LOG_LOG4J_LOGGER, 
VelocityEndpoint.class.getName());
             velocityEngine.init();
         }
         return velocityEngine;


Reply via email to