Skip to content

Commit

Permalink
move getEngine method to Config
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeloffner committed Sep 18, 2024
1 parent d3955d5 commit 166498e
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 14 deletions.
12 changes: 6 additions & 6 deletions core/src/main/java/lucee/runtime/config/ConfigAdmin.java
Original file line number Diff line number Diff line change
Expand Up @@ -3589,7 +3589,7 @@ public void removeSecurityManager(Password password, String id) throws PageExcep
public void runUpdate(Password password) throws PageException {
checkWriteAccess();
ConfigServerImpl cs = (ConfigServerImpl) ConfigWebUtil.getConfigServer(config, password);
CFMLEngineFactory factory = cs.getCFMLEngine().getCFMLEngineFactory();
CFMLEngineFactory factory = cs.getEngine().getCFMLEngineFactory();

synchronized (factory) {
try {
Expand Down Expand Up @@ -3622,7 +3622,7 @@ private void _removeUpdate(Password password, boolean onlyLatest) throws PageExc
ConfigServerImpl cs = (ConfigServerImpl) ConfigWebUtil.getConfigServer(config, password);

try {
CFMLEngineFactory factory = cs.getCFMLEngine().getCFMLEngineFactory();
CFMLEngineFactory factory = cs.getEngine().getCFMLEngineFactory();

if (onlyLatest) {
factory.removeLatestUpdate(cs.getPassword());
Expand All @@ -3642,7 +3642,7 @@ public void changeVersionTo(Version version, Password password, IdentificationWe
Log logger = cs.getLog("deploy");

try {
CFMLEngineFactory factory = cs.getCFMLEngine().getCFMLEngineFactory();
CFMLEngineFactory factory = cs.getEngine().getCFMLEngineFactory();
cleanUp(factory);
// do we have the core file?
final File patchDir = factory.getPatchDirectory();
Expand Down Expand Up @@ -3692,7 +3692,7 @@ public void mvnChangeVersionTo(Version version, Password password, Identificatio
Log logger = cs.getLog("deploy");

try {
CFMLEngineFactory factory = cs.getCFMLEngine().getCFMLEngineFactory();
CFMLEngineFactory factory = cs.getEngine().getCFMLEngineFactory();
cleanUp(factory);
// do we have the core file?
final File patchDir = factory.getPatchDirectory();
Expand Down Expand Up @@ -3864,7 +3864,7 @@ private File mvnDownloadCore(CFMLEngineFactory factory, Version version, Identif
public void restart(Password password) throws PageException {
checkWriteAccess();
ConfigServerImpl cs = (ConfigServerImpl) ConfigWebUtil.getConfigServer(config, password);
CFMLEngineFactory factory = cs.getCFMLEngine().getCFMLEngineFactory();
CFMLEngineFactory factory = cs.getEngine().getCFMLEngineFactory();

synchronized (factory) {
try {
Expand All @@ -3878,7 +3878,7 @@ public void restart(Password password) throws PageException {
}

public void restart(ConfigServerImpl cs) throws PageException {
CFMLEngineFactory factory = cs.getCFMLEngine().getCFMLEngineFactory();
CFMLEngineFactory factory = cs.getEngine().getCFMLEngineFactory();

synchronized (factory) {
try {
Expand Down
3 changes: 3 additions & 0 deletions core/src/main/java/lucee/runtime/config/ConfigPro.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import lucee.commons.lang.ClassException;
import lucee.commons.lang.PhysicalClassLoader;
import lucee.commons.lang.types.RefBoolean;
import lucee.loader.engine.CFMLEngine;
import lucee.runtime.CIPage;
import lucee.runtime.Mapping;
import lucee.runtime.PageContext;
Expand Down Expand Up @@ -404,4 +405,6 @@ public Resource[] getResources(PageContext pc, Mapping[] mappings, String realPa
public AIEngineFactory getAIEngineFactory(String name);

public AIEnginePool getAIEnginePool();

public CFMLEngine getEngine();
}
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ public boolean hasServerPassword() {
}

public String[] getInstalledPatches() throws PageException {
CFMLEngineFactory factory = getCFMLEngine().getCFMLEngineFactory();
CFMLEngineFactory factory = getEngine().getCFMLEngineFactory();

try {
return factory.getInstalledPatches();
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/java/lucee/runtime/config/ConfigWebFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ synchronized static void load(ConfigServerImpl cs, ConfigImpl config, ConfigWebI
if (!essentialOnly && config instanceof ConfigServerImpl) {
try {
ConfigServerImpl _cs = (ConfigServerImpl) config;
File rr = _cs.getCFMLEngine().getCFMLEngineFactory().getResourceRoot();
File rr = _cs.getEngine().getCFMLEngineFactory().getResourceRoot();
File log = new File(rr, "context/logs/felix.log");
if (log.isFile() && log.length() > GB1) {
if (log.delete()) ResourceUtil.touch(log);
Expand Down Expand Up @@ -4638,7 +4638,7 @@ else if (type == Monitor.TYPE_ACTION) {
ActionMonitorCollector actionMonitorCollector = ActionMonitorFatory.getActionMonitorCollector(configServer, actions.toArray(new MonitorTemp[actions.size()]));
configServer.setActionMonitorCollector(actionMonitorCollector);

((CFMLEngineImpl) configServer.getCFMLEngine()).touchMonitor(configServer);
((CFMLEngineImpl) configServer.getEngine()).touchMonitor(configServer);
}
catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
Expand Down Expand Up @@ -4696,7 +4696,7 @@ private static void _loadScheduler(ConfigServer configServer, ConfigImpl config,

Resource configDir = config.getConfigDir();
Array scheduledTasks = ConfigWebUtil.getAsArray("scheduledTasks", root);
config.setScheduler(configServer != null ? configServer.getCFMLEngine() : ((ConfigServer) config).getCFMLEngine(), scheduledTasks);
config.setScheduler(configServer != null ? configServer.getEngine() : ((ConfigServer) config).getEngine(), scheduledTasks);
}
catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
Expand Down
6 changes: 6 additions & 0 deletions core/src/main/java/lucee/runtime/config/ConfigWebImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import lucee.commons.io.res.Resource;
import lucee.commons.io.res.ResourcesImpl.ResourceProviderFactory;
import lucee.commons.lang.PhysicalClassLoader;
import lucee.loader.engine.CFMLEngine;
import lucee.runtime.ai.AIEngineFactory;
import lucee.runtime.ai.AIEnginePool;
import lucee.runtime.config.gateway.GatewayMap;
Expand Down Expand Up @@ -1960,4 +1961,9 @@ public AIEngineFactory getAIEngineFactory(String name) {
public AIEnginePool getAIEnginePool() {
return instance.getAIEnginePool();
}

@Override
public CFMLEngine getEngine() {
return instance.getEngine();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import lucee.commons.io.res.ResourceProvider;
import lucee.commons.io.res.ResourcesImpl;
import lucee.commons.lock.KeyLock;
import lucee.loader.engine.CFMLEngine;
import lucee.runtime.CFMLFactory;
import lucee.runtime.CFMLFactoryImpl;
import lucee.runtime.CIPage;
Expand Down Expand Up @@ -632,4 +633,9 @@ public AIEngineFactory getAIEngineFactory(String name) {
public AIEnginePool getAIEnginePool() {
return configServer.getAIEnginePool();
}

@Override
public CFMLEngine getEngine() {
return configServer.getEngine();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import lucee.commons.lang.PhysicalClassLoader;
import lucee.commons.lang.types.RefBoolean;
import lucee.commons.lock.KeyLock;
import lucee.loader.engine.CFMLEngine;
import lucee.runtime.CFMLFactory;
import lucee.runtime.CFMLFactoryImpl;
import lucee.runtime.CIPage;
Expand Down Expand Up @@ -2137,4 +2138,9 @@ public AIEngineFactory getAIEngineFactory(String name) {
public AIEnginePool getAIEnginePool() {
return cs.getAIEnginePool();
}

@Override
public CFMLEngine getEngine() {
return cs.getEngine();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static Struct call(PageContext pc) throws PageException {
ConfigServer cs = cw.getConfigServer("server");
ConfigWeb[] webs = cs.getConfigWebs();
CFMLEngineFactory.getInstance();
CFMLEngineImpl engine = (CFMLEngineImpl) cs.getCFMLEngine();
CFMLEngineImpl engine = (CFMLEngineImpl) cs.getEngine();

Struct sct = new StructImpl();

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/lucee/runtime/tag/Admin.java
Original file line number Diff line number Diff line change
Expand Up @@ -1584,7 +1584,7 @@ private void doGetInfo() throws PageException {
// Servlets
if (config instanceof ConfigServer) {
ConfigServer cs = (ConfigServer) config;
CFMLEngineImpl engine = (CFMLEngineImpl) cs.getCFMLEngine();
CFMLEngineImpl engine = (CFMLEngineImpl) cs.getEngine();
Struct srv = new StructImpl(), params;

ServletConfig[] configs = engine.getServletConfigs();
Expand Down
2 changes: 1 addition & 1 deletion loader/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<project default="core" basedir="." name="Lucee"
xmlns:resolver="antlib:org.apache.maven.resolver.ant">

<property name="version" value="6.2.0.90-SNAPSHOT"/>
<property name="version" value="6.2.0.91-SNAPSHOT"/>

<taskdef uri="antlib:org.apache.maven.resolver.ant" resource="org/apache/maven/resolver/ant/antlib.xml">
<classpath>
Expand Down
2 changes: 1 addition & 1 deletion loader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>org.lucee</groupId>
<artifactId>lucee</artifactId>
<version>6.2.0.90-SNAPSHOT</version>
<version>6.2.0.91-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Lucee Loader Build</name>
Expand Down

0 comments on commit 166498e

Please sign in to comment.