From c4282a516108d936112fbd4b91291563ec30a5e4 Mon Sep 17 00:00:00 2001 From: Mathieu Baudier Date: Mon, 30 Nov 2015 12:23:44 +0000 Subject: [PATCH] Adapt to changes in Commons git-svn-id: https://svn.argeo.org/slc/trunk@8655 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- demo/slc_demo_rap.properties | 5 ++-- .../META-INF/spring/jcr-osgi.xml | 4 +-- .../META-INF/spring/jcr.xml | 12 ++++---- org.argeo.slc.agent/META-INF/spring/osgi.xml | 8 ++++-- .../META-INF/spring/osgi.xml | 2 +- .../META-INF/spring/osgi.xml | 2 +- .../slc/core/execution/DefaultAgentCli.java | 28 ++++++++----------- .../slc/core/execution/ExecutionThread.java | 13 ++++----- .../slc/core/execution/ProcessThread.java | 13 ++++----- .../core/execution/ProcessThreadGroup.java | 18 ++++-------- .../slc/core/execution/tasks/SystemCall.java | 14 ++++------ .../META-INF/spring/jackrabbit-osgi.xml | 4 +-- .../META-INF/spring/jackrabbit.xml | 2 +- pom.xml | 4 +-- 14 files changed, 58 insertions(+), 71 deletions(-) diff --git a/demo/slc_demo_rap.properties b/demo/slc_demo_rap.properties index adbb47dd5..4bd4985bc 100644 --- a/demo/slc_demo_rap.properties +++ b/demo/slc_demo_rap.properties @@ -1,12 +1,12 @@ argeo.osgi.start.2.http=\ org.eclipse.equinox.http.servlet,\ -org.eclipse.equinox.http.jetty +org.eclipse.equinox.http.jetty,\ +org.eclipse.rap.rwt.osgi argeo.osgi.start.3.node=\ org.argeo.cms argeo.osgi.start.4.apps=\ -org.eclipse.rap.rwt.osgi,\ org.eclipse.gemini.blueprint.extender argeo.osgi.start.4.workbench=\ @@ -42,6 +42,7 @@ argeo.server.port.http=7070 # DON'T CHANGE BELOW UNLESS YOU KNOW WHAT YOU ARE DOING eclipse.ignoreApp=true osgi.noShutdown=true +org.eclipse.equinox.http.jetty.autostart=false # Avoid errors logs (see https://issues.apache.org/jira/browse/JCR-2226) org.apache.jackrabbit.core.statementcache=false \ No newline at end of file diff --git a/org.argeo.slc.agent.jcr/META-INF/spring/jcr-osgi.xml b/org.argeo.slc.agent.jcr/META-INF/spring/jcr-osgi.xml index ef95f7c02..9362f10f3 100644 --- a/org.argeo.slc.agent.jcr/META-INF/spring/jcr-osgi.xml +++ b/org.argeo.slc.agent.jcr/META-INF/spring/jcr-osgi.xml @@ -13,8 +13,8 @@ - + + diff --git a/org.argeo.slc.agent.jcr/META-INF/spring/jcr.xml b/org.argeo.slc.agent.jcr/META-INF/spring/jcr.xml index 5fe028e1f..84b32268e 100644 --- a/org.argeo.slc.agent.jcr/META-INF/spring/jcr.xml +++ b/org.argeo.slc.agent.jcr/META-INF/spring/jcr.xml @@ -12,7 +12,7 @@ - + - - - + + + - + - + diff --git a/org.argeo.slc.agent/META-INF/spring/osgi.xml b/org.argeo.slc.agent/META-INF/spring/osgi.xml index f22371189..2b9dee685 100644 --- a/org.argeo.slc.agent/META-INF/spring/osgi.xml +++ b/org.argeo.slc.agent/META-INF/spring/osgi.xml @@ -32,6 +32,8 @@ cardinality="0..N"> + + @@ -42,11 +44,13 @@ - + - + + + \ No newline at end of file diff --git a/org.argeo.slc.client.rap/META-INF/spring/osgi.xml b/org.argeo.slc.client.rap/META-INF/spring/osgi.xml index bb3095bfa..557350b8e 100644 --- a/org.argeo.slc.client.rap/META-INF/spring/osgi.xml +++ b/org.argeo.slc.client.rap/META-INF/spring/osgi.xml @@ -14,6 +14,6 @@ filter="(argeo.jcr.repository.alias=node)" /> - + \ No newline at end of file diff --git a/org.argeo.slc.client.ui.dist/META-INF/spring/osgi.xml b/org.argeo.slc.client.ui.dist/META-INF/spring/osgi.xml index e8bc02d24..590f3c37f 100644 --- a/org.argeo.slc.client.ui.dist/META-INF/spring/osgi.xml +++ b/org.argeo.slc.client.ui.dist/META-INF/spring/osgi.xml @@ -12,7 +12,7 @@ filter="(argeo.jcr.repository.alias=java)" /> - + diff --git a/org.argeo.slc.core/src/org/argeo/slc/core/execution/DefaultAgentCli.java b/org.argeo.slc.core/src/org/argeo/slc/core/execution/DefaultAgentCli.java index f790a7945..e02d50f2f 100644 --- a/org.argeo.slc.core/src/org/argeo/slc/core/execution/DefaultAgentCli.java +++ b/org.argeo.slc.core/src/org/argeo/slc/core/execution/DefaultAgentCli.java @@ -10,7 +10,6 @@ import java.util.Map; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.argeo.security.OsAuthenticationToken; import org.argeo.slc.DefaultNameVersion; import org.argeo.slc.NameVersion; import org.argeo.slc.SlcException; @@ -20,9 +19,6 @@ import org.argeo.slc.execution.ExecutionSpec; import org.argeo.slc.execution.ExecutionSpecAttribute; import org.argeo.slc.execution.SlcAgent; import org.argeo.slc.execution.SlcAgentCli; -import org.springframework.security.core.Authentication; -import org.springframework.security.authentication.AuthenticationManager; -import org.springframework.security.core.context.SecurityContextHolder; /** * Authenticates thread and executes synchronously a command line execution. @@ -33,18 +29,18 @@ public class DefaultAgentCli implements SlcAgentCli { private final static String UTF8 = "UTF-8"; private SlcAgent agent; - private AuthenticationManager authenticationManager; +// private AuthenticationManager authenticationManager; private Long timeout = 24 * 60 * 60 * 1000l; public String process(String[] args) { - if (SecurityContextHolder.getContext().getAuthentication() == null) { - OsAuthenticationToken oat = new OsAuthenticationToken(); - Authentication authentication = authenticationManager - .authenticate(oat); - SecurityContextHolder.getContext() - .setAuthentication(authentication); - } +// if (SecurityContextHolder.getContext().getAuthentication() == null) { +// OsAuthenticationToken oat = new OsAuthenticationToken(); +// Authentication authentication = authenticationManager +// .authenticate(oat); +// SecurityContextHolder.getContext() +// .setAuthentication(authentication); +// } if (args.length > 0 && args[0].equals("help")) { StringBuilder buf = new StringBuilder(); @@ -230,10 +226,10 @@ public class DefaultAgentCli implements SlcAgentCli { this.agent = agent; } - public void setAuthenticationManager( - AuthenticationManager authenticationManager) { - this.authenticationManager = authenticationManager; - } +// public void setAuthenticationManager( +// AuthenticationManager authenticationManager) { +// this.authenticationManager = authenticationManager; +// } public void setTimeout(Long timeout) { this.timeout = timeout; diff --git a/org.argeo.slc.core/src/org/argeo/slc/core/execution/ExecutionThread.java b/org.argeo.slc.core/src/org/argeo/slc/core/execution/ExecutionThread.java index 48a5df38b..f29e2938f 100644 --- a/org.argeo.slc.core/src/org/argeo/slc/core/execution/ExecutionThread.java +++ b/org.argeo.slc.core/src/org/argeo/slc/core/execution/ExecutionThread.java @@ -20,13 +20,10 @@ import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.argeo.slc.SlcException; import org.argeo.slc.execution.ExecutionFlowDescriptor; import org.argeo.slc.execution.ExecutionModulesManager; import org.argeo.slc.execution.ExecutionStep; import org.argeo.slc.execution.RealizedFlow; -import org.springframework.security.core.Authentication; -import org.springframework.security.core.context.SecurityContextHolder; /** Thread of a single execution */ public class ExecutionThread extends Thread { @@ -49,11 +46,11 @@ public class ExecutionThread extends Thread { public void run() { // authenticate thread - Authentication authentication = getProcessThreadGroup() - .getAuthentication(); - if (authentication == null) - throw new SlcException("Can only execute authenticated threads"); - SecurityContextHolder.getContext().setAuthentication(authentication); +// Authentication authentication = getProcessThreadGroup() +// .getAuthentication(); +// if (authentication == null) +// throw new SlcException("Can only execute authenticated threads"); +// SecurityContextHolder.getContext().setAuthentication(authentication); // Retrieve execution flow descriptor ExecutionFlowDescriptor executionFlowDescriptor = realizedFlow diff --git a/org.argeo.slc.core/src/org/argeo/slc/core/execution/ProcessThread.java b/org.argeo.slc.core/src/org/argeo/slc/core/execution/ProcessThread.java index 9b8f9cc3f..b17e478f7 100644 --- a/org.argeo.slc.core/src/org/argeo/slc/core/execution/ProcessThread.java +++ b/org.argeo.slc.core/src/org/argeo/slc/core/execution/ProcessThread.java @@ -23,13 +23,10 @@ import java.util.Set; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.argeo.slc.SlcException; import org.argeo.slc.execution.ExecutionModulesManager; import org.argeo.slc.execution.ExecutionProcess; import org.argeo.slc.execution.ExecutionStep; import org.argeo.slc.execution.RealizedFlow; -import org.springframework.security.core.Authentication; -import org.springframework.security.core.context.SecurityContextHolder; /** * Main thread coordinating an {@link ExecutionProcess}, launching parallel or @@ -59,11 +56,11 @@ public class ProcessThread extends Thread { public final void run() { // authenticate thread - Authentication authentication = getProcessThreadGroup() - .getAuthentication(); - if (authentication == null) - throw new SlcException("Can only execute authenticated threads"); - SecurityContextHolder.getContext().setAuthentication(authentication); +// Authentication authentication = getProcessThreadGroup() +// .getAuthentication(); +// if (authentication == null) +// throw new SlcException("Can only execute authenticated threads"); +// SecurityContextHolder.getContext().setAuthentication(authentication); log.info("\n##\n## SLC Process #" + process.getUuid() + " STARTED\n##\n"); diff --git a/org.argeo.slc.core/src/org/argeo/slc/core/execution/ProcessThreadGroup.java b/org.argeo.slc.core/src/org/argeo/slc/core/execution/ProcessThreadGroup.java index c18eaedbb..17dbff83b 100644 --- a/org.argeo.slc.core/src/org/argeo/slc/core/execution/ProcessThreadGroup.java +++ b/org.argeo.slc.core/src/org/argeo/slc/core/execution/ProcessThreadGroup.java @@ -20,14 +20,10 @@ import java.util.concurrent.BlockingQueue; import org.argeo.slc.execution.ExecutionProcess; import org.argeo.slc.execution.ExecutionStep; -import org.springframework.security.core.Authentication; -import org.springframework.security.core.context.SecurityContextHolder; /** The thread group attached to a given {@link SlcExecution}. */ public class ProcessThreadGroup extends ThreadGroup { - // private final ExecutionModulesManager executionModulesManager; - // private final ProcessThread processThread; - private final Authentication authentication; +// private final Authentication authentication; private final static Integer STEPS_BUFFER_CAPACITY = 5000; private BlockingQueue steps = new ArrayBlockingQueue( @@ -37,15 +33,13 @@ public class ProcessThreadGroup extends ThreadGroup { public ProcessThreadGroup(ExecutionProcess executionProcess) { super("SLC Process #" + executionProcess.getUuid() + " thread group"); - // this.executionModulesManager = executionModulesManager; - // this.processThread = processThread; - this.authentication = SecurityContextHolder.getContext() - .getAuthentication(); +// this.authentication = SecurityContextHolder.getContext() +// .getAuthentication(); } - public Authentication getAuthentication() { - return authentication; - } +// public Authentication getAuthentication() { +// return authentication; +// } public void dispatchAddStep(ExecutionStep step) { // ExecutionProcess slcProcess = processThread.getProcess(); diff --git a/org.argeo.slc.core/src/org/argeo/slc/core/execution/tasks/SystemCall.java b/org.argeo.slc.core/src/org/argeo/slc/core/execution/tasks/SystemCall.java index b2d8723a6..27cc59d60 100644 --- a/org.argeo.slc.core/src/org/argeo/slc/core/execution/tasks/SystemCall.java +++ b/org.argeo.slc.core/src/org/argeo/slc/core/execution/tasks/SystemCall.java @@ -54,8 +54,6 @@ import org.argeo.slc.core.test.SimpleResultPart; import org.argeo.slc.test.TestResult; import org.argeo.slc.test.TestStatus; import org.springframework.core.io.Resource; -import org.springframework.security.core.Authentication; -import org.springframework.security.core.context.SecurityContextHolder; /** Execute an OS specific system call. */ public class SystemCall implements Runnable { @@ -98,7 +96,7 @@ public class SystemCall implements Runnable { private Boolean exceptionOnFailed = true; private Boolean mergeEnvironmentVariables = true; - private Authentication authentication; +// private Authentication authentication; private String osConsole = null; private String generateScript = null; @@ -160,7 +158,7 @@ public class SystemCall implements Runnable { /** Executes the system call. */ public void run() { - authentication = SecurityContextHolder.getContext().getAuthentication(); +// authentication = SecurityContextHolder.getContext().getAuthentication(); // Manage streams Writer stdOutWriter = null; @@ -535,10 +533,10 @@ public class SystemCall implements Runnable { /** Log from the underlying streams. */ protected void log(String logLevel, String line) { // TODO optimize - if (SecurityContextHolder.getContext().getAuthentication() == null) { - SecurityContextHolder.getContext() - .setAuthentication(authentication); - } +// if (SecurityContextHolder.getContext().getAuthentication() == null) { +// SecurityContextHolder.getContext() +// .setAuthentication(authentication); +// } if ("ERROR".equals(logLevel)) log.error(line); diff --git a/org.argeo.slc.node.jackrabbit/META-INF/spring/jackrabbit-osgi.xml b/org.argeo.slc.node.jackrabbit/META-INF/spring/jackrabbit-osgi.xml index 734721a72..c03708206 100644 --- a/org.argeo.slc.node.jackrabbit/META-INF/spring/jackrabbit-osgi.xml +++ b/org.argeo.slc.node.jackrabbit/META-INF/spring/jackrabbit-osgi.xml @@ -13,8 +13,8 @@ - + + diff --git a/org.argeo.slc.node.jackrabbit/META-INF/spring/jackrabbit.xml b/org.argeo.slc.node.jackrabbit/META-INF/spring/jackrabbit.xml index 6b0680053..f86c7d7ea 100644 --- a/org.argeo.slc.node.jackrabbit/META-INF/spring/jackrabbit.xml +++ b/org.argeo.slc.node.jackrabbit/META-INF/spring/jackrabbit.xml @@ -28,7 +28,7 @@ - + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 2c3298dfb..972130b70 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.argeo.commons argeo-commons - 2.1.29-SNAPSHOT + 2.1.31-SNAPSHOT org.argeo.slc argeo-slc @@ -16,7 +16,7 @@ 2015-02-12 2.1.1-SNAPSHOT - 2.1.5 + 2.1.7 -- 2.39.2