Skip to content
Snippets Groups Projects
Commit 0c8c82a5 authored by gnaegi's avatar gnaegi
Browse files

OO-942 make velocity parser pool size configurable, fix regression on...

OO-942 make velocity parser pool size configurable, fix regression on extension manager on simultanious first user login
parent 987775cd
No related branches found
No related tags found
No related merge requests found
......@@ -40,7 +40,9 @@
<import resource="classpath:/org/olat/core/commons/services/thumbnail/_spring/thumbnailserviceContext.xml"/>
<import resource="classpath:/org/olat/core/commons/services/webdav/_spring/webdavContext.xml"/>
<bean class="org.olat.core.gui.render.velocity.VelocityModule" depends-on="org.olat.core.helpers.Settings" init-method="init"/>
<bean class="org.olat.core.gui.render.velocity.VelocityModule" depends-on="org.olat.core.helpers.Settings" init-method="init">
<property name="parserPoolSize" value="${velocity.parser.pool.size}" />
</bean>
<bean id="mapperSlayerTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="mapperSlayerJob" />
......
......@@ -127,7 +127,7 @@ public class ExtManager extends LogDelegator {
if (extensions == null) {
synchronized(lockObject) {
if (extensions == null) {
initExtentions();
extensions = initExtentions();
}
}
}
......@@ -141,13 +141,13 @@ public class ExtManager extends LogDelegator {
return timeOfExtensionStartup;
}
private void initExtentions() {
private ArrayList<Extension> initExtentions() {
logInfo("****** start loading extensions *********");
Map<Integer, Extension> orderKeys = new HashMap<Integer, Extension>();
idExtensionlookup = new HashMap<Long, Extension>();
navKeyGAExtensionlookup = new HashMap<ExtensionPointKeyPair, GenericActionExtension>();
extensions = new ArrayList<Extension>();
ArrayList<Extension> extensionsList = new ArrayList<Extension>();
Map<String, Extension> extensionMap = CoreSpringFactory.getBeansOfType(Extension.class);
Collection<Extension> extensionValues = extensionMap.values();
......@@ -182,7 +182,7 @@ public class ExtManager extends LogDelegator {
count_duplid++;
logWarn("Devel-Info :: duplicate unique id generated for extensions :: "+uid+" [ ["+idExtensionlookup.get(uid)+"] and ["+extension+"] ]",null);
}else{
extensions.add(extension);
extensionsList.add(extension);
idExtensionlookup.put(uid, extension);
if (extension instanceof GenericActionExtension) {
GenericActionExtension gAE = (GenericActionExtension) extension;
......@@ -205,7 +205,8 @@ public class ExtManager extends LogDelegator {
logDebug("Created unique-id "+uid+" for extension:: "+extension);
}
logInfo("Devel-Info :: initExtensions done. :: "+count_disabled+" disabled Extensions, "+count_duplid+" extensions with duplicate ids, "+count_duplnavkey+ " extensions with duplicate navigationKeys");
Collections.sort(extensions);
Collections.sort(extensionsList);
return extensionsList;
}
private class ExtensionPointKeyPair {
......
......@@ -478,7 +478,7 @@ public abstract class GenericMainController extends MainLayoutBasicController im
contentCtr1Tmp = handleOwnMenuTreeEvent(uobject, ureq);
}
if (contentCtr1Tmp == null) { throw new AssertException(
"Node must either be an ActionExtension or implementation must handle this MenuTreeEvent: " + uobject.toString()); }
"Node must either be an ActionExtension or implementation must handle this MenuTreeEvent: " + (uobject == null ? "NULL" : uobject.toString())); }
return contentCtr1Tmp;
}
......
......@@ -81,7 +81,8 @@ public class VelocityHelper extends LogDelegator {
p.setProperty(RuntimeConstants.RUNTIME_LOG_INFO_STACKTRACE, "true");
p.setProperty(RuntimeConstants.INPUT_ENCODING, VelocityModule.getInputEncoding());
p.setProperty(RuntimeConstants.OUTPUT_ENCODING, VelocityModule.getOutputEncoding());
p.setProperty(RuntimeConstants.OUTPUT_ENCODING, VelocityModule.getOutputEncoding());
p.setProperty(RuntimeConstants.PARSER_POOL_SIZE, VelocityModule.getParsterPoolSize());
if (Settings.isDebuging()) {
......
......@@ -38,6 +38,7 @@ public class VelocityModule implements Initializable {
private static String inputEncoding = DEFAULT_ENCODING;
private static String outputEncoding = DEFAULT_ENCODING;
private static String parserPoolSize = "20";
/**
* [spring]
......@@ -64,4 +65,21 @@ public class VelocityModule implements Initializable {
VelocityHelper.getInstance();
}
/**
* @return the parser pool size for the velocity parser pool configuration
*/
public static String getParsterPoolSize() {
return parserPoolSize;
}
/**
* [SPRING]
* @param newParserPoolSize Set the new parser pool size
*/
public void setParserPoolSize(String newParserPoolSize) {
parserPoolSize = newParserPoolSize;
}
}
\ No newline at end of file
......@@ -532,6 +532,12 @@ db.hibernate.c3p0.unreturnedConnectionTimeout=120
infinispan.jndi=
infinispan.jndi.values=,java:jboss/infinispan/openolatha
########################################################################
# Velocity Templating Engine
########################################################################
velocity.parser.pool.size=20
infinispan.jndi.comment=20 is Velocity default value, use more when you get errors in the logfile. Only necessary on high load configurations.
########################################################################
# Instant Messaging / chat
########################################################################
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment