X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.core%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fcore%2Fexecution%2Ftasks%2FSlcManager.java;h=9fff5ba8062c67b049163cacd372c7ee760c0829;hb=1fdb1b4e7b1d2b0cabb6483238301b857a6392fa;hp=58397d3ca112bdccc91a64b3ab9bcd48aee3fe05;hpb=ee6c3543a0ff9403420ce6a9c647723269f14331;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/tasks/SlcManager.java b/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/tasks/SlcManager.java index 58397d3ca..9fff5ba80 100644 --- a/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/tasks/SlcManager.java +++ b/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/tasks/SlcManager.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2010 Mathieu Baudier + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.argeo.slc.core.execution.tasks; import java.lang.reflect.Method; @@ -11,11 +27,13 @@ import org.argeo.slc.process.SlcExecutionRelated; import org.argeo.slc.process.SlcExecutionStep; import org.argeo.slc.structure.StructureRegistry; +/** Use {@link MethodCall} instead. */ +@Deprecated public class SlcManager implements Runnable, SlcExecutionRelated { private String uuid; private String slcExecutionUuid; private String slcExecutionStepUuid; - + private String action; private DeployedSystemManager manager; @@ -23,17 +41,19 @@ public class SlcManager implements Runnable, SlcExecutionRelated { uuid = UUID.randomUUID().toString(); executeActions(StructureRegistry.ALL); } - + protected void executeActions(String mode) { try { - Method method = manager.getClass().getMethod(action, null); - method.invoke(manager, null); + Class[] argClasses = null; + Method method = manager.getClass().getMethod(action, argClasses); + Object[] argObjects = null; + method.invoke(manager, argObjects); } catch (Exception e) { throw new SlcException("Cannot execute action " + action + " for manager " + manager, e); } } - + public void setAction(String action) { this.action = action; } @@ -65,7 +85,7 @@ public class SlcManager implements Runnable, SlcExecutionRelated { public void setSlcExecutionStepUuid(String slcExecutionStepUuid) { this.slcExecutionStepUuid = slcExecutionStepUuid; } - + public void notifySlcExecution(SlcExecution slcExecution) { if (slcExecution != null) { slcExecutionUuid = slcExecution.getUuid();