]> git.argeo.org Git - gpl/argeo-slc.git/commitdiff
Introduce JCR agent. Client agent not needed anymore.
authorMathieu Baudier <mbaudier@argeo.org>
Mon, 18 Apr 2011 08:52:50 +0000 (08:52 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Mon, 18 Apr 2011 08:52:50 +0000 (08:52 +0000)
NEW - bug 17: Generalize agent management and registration beyond JMS
https://bugzilla.argeo.org/show_bug.cgi?id=17

git-svn-id: https://svn.argeo.org/slc/trunk@4446 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

16 files changed:
eclipse/modules/org.argeo.slc.client.agent/META-INF/spring/client.xml
eclipse/plugins/org.argeo.slc.client.rcp/META-INF/spring/osgi.xml
modules/agent/org.argeo.slc.agent.jms/META-INF/spring/jms.xml
modules/server/org.argeo.slc.server.jcr/META-INF/MANIFEST.MF
modules/server/org.argeo.slc.server.jcr/META-INF/spring/jcr-osgi.xml
modules/server/org.argeo.slc.server.jcr/META-INF/spring/jcr.xml
runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/runtime/DefaultAgent.java
runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/deploy/ModuleDescriptor.java
runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/execution/ExecutionSpec.java
runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/execution/ExecutionSpecAttribute.java
runtime/org.argeo.slc.support.activemq/src/main/java/org/argeo/slc/jms/JmsAgent.java
runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/JcrAgent.java [deleted file]
runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/SlcJcrConstants.java [new file with mode: 0644]
runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/SlcNames.java
runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/execution/JcrAgent.java [new file with mode: 0644]
runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/execution/JcrExecutionModulesListener.java

index ab0f408867b13efd53f81ff99d932d9335d8845f..5d7b3c0474059e3193668e65fdf93f89cc95a8fa 100644 (file)
@@ -9,12 +9,12 @@
        <bean id="slcAgentFactory" class="org.argeo.slc.core.runtime.SimpleAgentFactory">
                <property name="agents">
                        <list>
-                       <ref bean="slcAgent"/>
+                               <ref bean="slcAgent" />
                        </list>
                </property>
        </bean>
 
        <bean id="slcAgent" class="org.argeo.slc.core.runtime.DefaultAgent"
-               p:modulesManager-ref="modulesManager" />
+               init-method="init" destroy-method="dispose" p:modulesManager-ref="modulesManager" />
 
 </beans>
index 6247a21f0316a1262518f60c8b2ce7b8b70105ca..a945cdcbe7d8421928d5e3555bd02482723b5819 100644 (file)
@@ -32,8 +32,8 @@
        <!-- UI Components -->
        <bundle id="slc.node.jackrabbit" symbolic-name="org.argeo.slc.node.jackrabbit"
                action="start" />
-       <bundle id="slc.client.agent" symbolic-name="org.argeo.slc.client.agent"
-               action="start" />
+<!--   <bundle id="slc.client.agent" symbolic-name="org.argeo.slc.client.agent" -->
+<!--           action="start" /> -->
        <bundle id="slc.client.hibernate" symbolic-name="org.argeo.slc.client.hibernate"
                action="start" />
        <bundle id="slc.client.oxm" symbolic-name="org.argeo.slc.client.oxm"
index 78a15fee6cf6b364e34679763d07529535990eff..7924dfe2d2ad553083d01e3a11db4a6b6721cdf5 100644 (file)
@@ -8,7 +8,8 @@
        <import resource="classpath:org/argeo/slc/activemq/destinations.xml" />
 
        <!-- Agent implementation -->
-       <bean id="jmsAgent" class="org.argeo.slc.jms.JmsAgent">
+       <bean id="jmsAgent" class="org.argeo.slc.jms.JmsAgent"
+               init-method="init" destroy-method="dispose">
                <property name="agentRegister" ref="slcJms.destination.agent.register" />
                <property name="agentUnregister" ref="slcJms.destination.agent.unregister" />
                <property name="modulesManager" ref="modulesManager" />
@@ -16,7 +17,7 @@
                <property name="jmsTemplate" ref="jmsTemplate" />
        </bean>
 
-       <!--  Listeners -->
+       <!-- Listeners -->
        <bean id="jmsAgent.listener.request" parent="listenerTemplate">
                <property name="destination" ref="slcJms.destination.agent.request" />
                <property name="messageSelector">
@@ -32,7 +33,7 @@
        <!-- Services -->
        <bean id="resultListener" class="org.argeo.slc.jms.JmsTreeTestResultListener">
                <property name="executionEventDestination" ref="slcJms.destination.execution.event" />
-               <property name="onlyOnClose" value="${slc.agent.jms.resultListener.onlyOnClose}"/>
+               <property name="onlyOnClose" value="${slc.agent.jms.resultListener.onlyOnClose}" />
                <property name="jmsTemplate" ref="jmsTemplate" />
        </bean>
        <bean id="attachmentUploader" class="org.argeo.slc.jms.JmsAttachmentUploader">
index e0cdde8c14914964d60a81124ebfdc2d3d27725c..023fd63dfc239786bbf4877d8edebe8d4b968442 100644 (file)
@@ -7,6 +7,7 @@ Import-Package: javax.jcr,
  org.argeo.jcr.mvc,
  org.argeo.jcr.spring,
  org.argeo.security,
+ org.argeo.security.core,
  org.argeo.security.jcr,
  org.argeo.slc.core.attachment,
  org.argeo.slc.core.execution,
@@ -26,4 +27,5 @@ Import-Package: javax.jcr,
  org.argeo.slc.test,
  org.springframework.beans.factory.config,
  org.springframework.osgi.util,
+ org.springframework.security;specification-version="2.0.6.RELEASE",
  org.springframework.web.context.request
index d1a550c180dd56a01d13f764ca4d8cc9762a9e6d..f682f931e173330d1ec3facdcef8f71f0335d044 100644 (file)
@@ -9,11 +9,17 @@
        <!-- REFERENCES -->\r
        <reference id="nodeRepository" interface="javax.jcr.Repository"\r
                filter="(argeo.jcr.repository.alias=slc)" />\r
-       <reference id="systemExecutionService" interface="org.argeo.security.SystemExecutionService" />\r
+\r
+       <reference id="modulesManager"\r
+               interface="org.argeo.slc.execution.ExecutionModulesManager" />\r
+       <reference id="authenticationManager"\r
+               interface="org.springframework.security.AuthenticationManager" />\r
 \r
        <!-- SERVICES -->\r
        <service interface="org.argeo.slc.execution.ExecutionModulesListener"\r
                ref="executionModulesListener" />\r
+       <service ref="agent" interface="org.argeo.slc.runtime.SlcAgentFactory" />\r
+       <service ref="agent" interface="org.argeo.slc.runtime.SlcAgent" />\r
 \r
        <!-- <service interface="org.argeo.slc.dao.process.SlcExecutionDao" -->\r
        <!-- ref="slcExecutionDao" /> -->\r
index 4d9983cfd4f9a27c8f9880c50a4d61cd83aa2340..bd435bbd1466664aa30fa2537525bc79c0ed2ba6 100644 (file)
        <!-- </property> -->\r
        <!-- </bean> -->\r
 \r
+       <bean id="agent" class="org.argeo.slc.jcr.execution.JcrAgent"\r
+               init-method="init" destroy-method="dispose">\r
+               <property name="session" ref="session" />\r
+               <property name="modulesManager" ref="modulesManager" />\r
+       </bean>\r
+\r
        <bean id="executionModulesListener" class="org.argeo.slc.jcr.execution.JcrExecutionModulesListener"\r
                init-method="init" destroy-method="dispose">\r
+               <property name="agent" ref="agent" />\r
                <property name="session" ref="session" />\r
        </bean>\r
 \r
-       <bean id="session" class="org.argeo.security.jcr.SystemSession">\r
+       <bean id="session" class="org.argeo.security.jcr.SecureThreadBoundSession">\r
                <property name="repository" ref="nodeRepository" />\r
-               <property name="systemExecutionService" ref="systemExecutionService" />\r
+       </bean>\r
+\r
+       <bean class="org.argeo.security.core.SystemExecutionBeanPostProcessor">\r
+               <property name="authenticationManager" ref="authenticationManager" />\r
        </bean>\r
 \r
        <!-- <bean id="slcAgentDescriptorDao" class="org.argeo.slc.jcr.dao.SlcAgentDescriptorDaoJcr" -->\r
index 430b6bd973e6c12df8228b5993c3e7bbc1620956..ca230856f4f2103f3288dfacf49cd52edb52d382 100644 (file)
@@ -28,22 +28,39 @@ import org.argeo.slc.process.SlcExecution;
 import org.argeo.slc.runtime.SlcAgent;
 import org.argeo.slc.runtime.SlcAgentDescriptor;
 
+/** Implements the base methods of an SLC agent. */
 public class DefaultAgent implements SlcAgent {
-       // private final static Log log = LogFactory.getLog(AbstractAgent.class);
-
-       private final SlcAgentDescriptor agentDescriptor;
+       private SlcAgentDescriptor agentDescriptor;
        private ExecutionModulesManager modulesManager;
 
-       public DefaultAgent() {
+       /*
+        * LIFECYCLE
+        */
+       public void init() {
                try {
                        agentDescriptor = new SlcAgentDescriptor();
-                       agentDescriptor.setUuid(UUID.randomUUID().toString());
+                       agentDescriptor.setUuid(initAgentUuid());
                        agentDescriptor.setHost(InetAddress.getLocalHost().getHostName());
                } catch (UnknownHostException e) {
                        throw new SlcException("Unable to create agent descriptor.", e);
                }
        }
 
+       public void dispose() {
+
+       }
+
+       /**
+        * Called during initialization in order to determines the agent UUID. To be
+        * overridden. By default creates a new one per instance.
+        */
+       protected String initAgentUuid() {
+               return UUID.randomUUID().toString();
+       }
+
+       /*
+        * SLC AGENT
+        */
        public void runSlcExecution(final SlcExecution slcExecution) {
                modulesManager.process(slcExecution);
        }
@@ -61,20 +78,19 @@ public class DefaultAgent implements SlcAgent {
                return true;
        }
 
+       /*
+        * BEAN
+        */
        public void setModulesManager(ExecutionModulesManager modulesManager) {
                this.modulesManager = modulesManager;
        }
 
-       public ExecutionModulesManager getModulesManager() {
-               return modulesManager;
-       }
-
        protected SlcAgentDescriptor getAgentDescriptor() {
                return agentDescriptor;
        }
 
        public String getAgentUuid() {
-               return getAgentDescriptor().getUuid();
+               return agentDescriptor.getUuid();
        }
 
        @Override
index 84608a15c432506709ca9195b7a68fc661b18d54..0a36002fb605151323a727077ed2e6df97aa7d24 100644 (file)
@@ -18,17 +18,18 @@ package org.argeo.slc.deploy;
 
 import org.argeo.slc.BasicNameVersion;
 
+/** The description of a versioned module. */
 public class ModuleDescriptor extends BasicNameVersion {
-       private static final long serialVersionUID = 3703329250058821882L;
-       private String label;
+       private static final long serialVersionUID = 4310820315478645419L;
+       private String title;
        private String description;
 
-       public String getLabel() {
-               return label;
+       public String getTitle() {
+               return title;
        }
 
-       public void setLabel(String label) {
-               this.label = label;
+       public void setTitle(String title) {
+               this.title = title;
        }
 
        public String getDescription() {
@@ -39,4 +40,14 @@ public class ModuleDescriptor extends BasicNameVersion {
                this.description = description;
        }
 
+       /** @deprecated use {@link #getTitle()} instead */
+       public String getLabel() {
+               return title;
+       }
+
+       /** @deprecated use {@link #setTitle(String)} instead */
+       public void setLabel(String label) {
+               this.title = label;
+       }
+
 }
index 899b76f9630a56b909c82fdbb27f365f699134d5..8111cc7d9cda529ef30cf76613283c0fa1a4ba2b 100644 (file)
@@ -21,8 +21,6 @@ import java.util.Map;
 /**
  * The class implementing this interface defines the map of attributes that are
  * necessary for the corresponding ExecutionFlow.
- * 
- * @author bsinou
  */
 public interface ExecutionSpec {
        public Map<String, ExecutionSpecAttribute> getAttributes();
index 22d981f4412616d3cc0a69ae8feca2002370f7e8..4866f637702f3e635c47a5138773da4ce0e1d36f 100644 (file)
@@ -17,7 +17,6 @@
 package org.argeo.slc.execution;
 
 /**
- * 
  * This interface stands for one attribute of a given flow.
  * 
  * We mainly have two implementations :
@@ -29,13 +28,10 @@ package org.argeo.slc.execution;
  * the application context + the display of some choices among which the end
  * user can choose.
  * 
- * Note :
- * 
+ * @see org.argeo.slc.core.execution.PrimitiveSpecAttribute
+ * @see org.argeo.slc.core.execution.RefSpecAttribute
  * @see org.argeo.slc.core.execution.PrimitiveUtils : this class offers some
  *      helper, among others to cast the various type of primitive attribute.
- * 
- * @author bsinou
- * 
  */
 public interface ExecutionSpecAttribute {
        public Object getValue();
index fecb5178bd311d278ea39c4acb8196515345e1ee..33584bb00ca30d9f56544020dbd4bf448d7ef6a8 100644 (file)
@@ -33,15 +33,12 @@ import org.argeo.slc.msg.MsgConstants;
 import org.argeo.slc.msg.ReferenceList;
 import org.argeo.slc.process.SlcExecution;
 import org.argeo.slc.runtime.SlcAgentDescriptor;
-import org.springframework.beans.factory.DisposableBean;
-import org.springframework.beans.factory.InitializingBean;
 import org.springframework.jms.JmsException;
 import org.springframework.jms.core.JmsTemplate;
 import org.springframework.jms.core.MessagePostProcessor;
 
-/** JMS based implementation of SLC Agent. */
-public class JmsAgent extends DefaultAgent implements InitializingBean,
-               DisposableBean, MessageListener {
+/** JMS based implementation of an SLC Agent. */
+public class JmsAgent extends DefaultAgent implements MessageListener {
        public final static String PROPERTY_QUERY = "query";
        public final static String QUERY_PING_ALL = "pingAll";
 
@@ -53,24 +50,24 @@ public class JmsAgent extends DefaultAgent implements InitializingBean,
 
        private Destination responseDestination;
 
-       public void afterPropertiesSet() throws Exception {
+       public void init() {
+               super.init();
                try {
                        jmsTemplate.convertAndSend(agentRegister, getAgentDescriptor());
                        log.info("Agent #" + getAgentUuid() + " registered to "
                                        + agentRegister);
                } catch (JmsException e) {
-                       log
-                                       .warn("Could not register agent "
-                                                       + getAgentDescriptor().getUuid()
-                                                       + " to server: "
-                                                       + e.getMessage()
-                                                       + ". The agent will stay offline but will keep listening for a ping all sent by server.");
+                       log.warn("Could not register agent "
+                                       + getAgentDescriptor().getUuid()
+                                       + " to server: "
+                                       + e.getMessage()
+                                       + ". The agent will stay offline but will keep listening for a ping all sent by server.");
                        if (log.isTraceEnabled())
                                log.debug("Original error.", e);
                }
        }
 
-       public void destroy() throws Exception {
+       public void dispose() {
                try {
                        jmsTemplate.convertAndSend(agentUnregister, getAgentDescriptor());
                        log.info("Agent #" + getAgentUuid() + " unregistered from "
@@ -81,6 +78,7 @@ public class JmsAgent extends DefaultAgent implements InitializingBean,
                        if (log.isTraceEnabled())
                                log.debug("Original error.", e);
                }
+               super.dispose();
        }
 
        public void setAgentRegister(Destination agentRegister) {
diff --git a/runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/JcrAgent.java b/runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/JcrAgent.java
deleted file mode 100644 (file)
index b8e99cb..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.argeo.slc.jcr;
-
-import java.util.List;
-
-import org.argeo.slc.execution.ExecutionModuleDescriptor;
-import org.argeo.slc.process.SlcExecution;
-import org.argeo.slc.runtime.SlcAgent;
-
-public class JcrAgent implements SlcAgent {
-
-       public String getAgentUuid() {
-               // TODO Auto-generated method stub
-               return null;
-       }
-
-       public ExecutionModuleDescriptor getExecutionModuleDescriptor(
-                       String moduleName, String version) {
-               // TODO Auto-generated method stub
-               return null;
-       }
-
-       public List<ExecutionModuleDescriptor> listExecutionModuleDescriptors() {
-               // TODO Auto-generated method stub
-               return null;
-       }
-
-       public void runSlcExecution(SlcExecution slcExecution) {
-               // TODO Auto-generated method stub
-
-       }
-
-       public boolean ping() {
-               // TODO Auto-generated method stub
-               return false;
-       }
-
-}
diff --git a/runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/SlcJcrConstants.java b/runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/SlcJcrConstants.java
new file mode 100644 (file)
index 0000000..eb8b135
--- /dev/null
@@ -0,0 +1,6 @@
+package org.argeo.slc.jcr;
+
+public interface SlcJcrConstants {
+       public final static String AGENTS_BASE_PATH = "/slc/agents";
+       public final static String VM_AGENT_FACTORY_PATH = AGENTS_BASE_PATH + "/vm";
+}
index 55387b27da85a0d0d9c0ccf9d5a4593b821ef119..728d576a51256049977d62442139fc5203015219 100644 (file)
@@ -6,5 +6,6 @@ public interface SlcNames {
        public final static String SLC_NAME = "slc:name";
        public final static String SLC_VERSION = "slc:version";
        public final static String SLC_FLOWS = "slc:flows";
+       public final static String SLC_EXECUTION_MODULES = "slc:executionModules";
 
 }
diff --git a/runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/execution/JcrAgent.java b/runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/execution/JcrAgent.java
new file mode 100644 (file)
index 0000000..9327f8b
--- /dev/null
@@ -0,0 +1,64 @@
+package org.argeo.slc.jcr.execution;
+
+import java.util.List;
+import java.util.UUID;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.argeo.jcr.JcrUtils;
+import org.argeo.slc.SlcException;
+import org.argeo.slc.core.runtime.DefaultAgent;
+import org.argeo.slc.jcr.SlcJcrConstants;
+import org.argeo.slc.runtime.SlcAgent;
+import org.argeo.slc.runtime.SlcAgentFactory;
+
+/** SLC agent synchronizing with a JCR repository. */
+public class JcrAgent extends DefaultAgent implements SlcAgentFactory {
+       private Session session;
+
+       /*
+        * LIFECYCLE
+        */
+       protected String initAgentUuid() {
+               try {
+                       Node vmAgentFactoryNode = JcrUtils.mkdirs(session,
+                                       SlcJcrConstants.VM_AGENT_FACTORY_PATH);
+                       if (!vmAgentFactoryNode.hasNodes()) {
+                               String uuid = UUID.randomUUID().toString();
+                               vmAgentFactoryNode.addNode(uuid);
+                       }
+                       session.save();
+
+                       return vmAgentFactoryNode.getNodes().nextNode().getName();
+               } catch (RepositoryException e) {
+                       throw new SlcException("Cannot find JCR agent UUID", e);
+               } finally {
+                       JcrUtils.discardQuietly(session);
+               }
+       }
+
+       public void dispose() {
+
+       }
+
+       /*
+        * SLC AGENT FACTORY
+        */
+       public SlcAgent getAgent(String uuid) {
+               return this;
+       }
+
+       public void pingAll(List<String> activeAgentIds) {
+               ping();
+       }
+
+       /*
+        * BEAN METHODS
+        */
+       public void setSession(Session session) {
+               this.session = session;
+       }
+
+}
index dd91d5dee21718bab4d558c89eee46ca94b3aa17..c68272dc40b33586c688936f1b04b0144b314a87 100644 (file)
@@ -15,21 +15,24 @@ import org.argeo.slc.deploy.Module;
 import org.argeo.slc.execution.ExecutionContext;
 import org.argeo.slc.execution.ExecutionFlow;
 import org.argeo.slc.execution.ExecutionModulesListener;
+import org.argeo.slc.jcr.SlcJcrConstants;
+import org.argeo.slc.jcr.SlcNames;
+import org.argeo.slc.runtime.SlcAgent;
 
 /**
- * Synchronizes the execution runtime with JCR. For the time being the state is
- * completely reset from one start to another.
+ * Synchronizes the local execution runtime with a JCR repository. For the time
+ * being the state is completely reset from one start to another.
  */
 public class JcrExecutionModulesListener implements ExecutionModulesListener {
        private final static Log log = LogFactory
                        .getLog(JcrExecutionModulesListener.class);
 
-       private String modulesPath = "/slc/modules";
-
        private Session session;
+       private SlcAgent agent;
 
        public void init() {
                try {
+                       String modulesPath = getExecutionModulesPath();
                        // clean up previous state
                        if (session.nodeExists(modulesPath))
                                session.getNode(modulesPath).remove();
@@ -45,6 +48,7 @@ public class JcrExecutionModulesListener implements ExecutionModulesListener {
 
        public void dispose() {
                try {
+                       String modulesPath = getExecutionModulesPath();
                        // clean up previous state
                        if (session.nodeExists(modulesPath))
                                session.getNode(modulesPath).remove();
@@ -60,7 +64,7 @@ public class JcrExecutionModulesListener implements ExecutionModulesListener {
        public void executionModuleAdded(Module module,
                        ExecutionContext executionContext) {
                try {
-                       Node base = session.getNode(modulesPath);
+                       Node base = session.getNode(getExecutionModulesPath());
                        Node moduleName = base.hasNode(module.getName()) ? base
                                        .getNode(module.getName()) : base.addNode(module.getName());
                        Node moduleVersion = moduleName.hasNode(module.getVersion()) ? moduleName
@@ -76,7 +80,7 @@ public class JcrExecutionModulesListener implements ExecutionModulesListener {
        public void executionModuleRemoved(Module module,
                        ExecutionContext executionContext) {
                try {
-                       Node base = session.getNode(modulesPath);
+                       Node base = session.getNode(getExecutionModulesPath());
                        if (base.hasNode(module.getName())) {
                                Node moduleName = base.getNode(module.getName());
                                if (moduleName.hasNode(module.getVersion()))
@@ -96,7 +100,7 @@ public class JcrExecutionModulesListener implements ExecutionModulesListener {
                try {
                        Node flowNode;
                        if (!session.nodeExists(path)) {
-                               Node base = session.getNode(modulesPath);
+                               Node base = session.getNode(getExecutionModulesPath());
                                Node moduleNode = base.getNode(module.getName() + '/'
                                                + module.getVersion());
                                String relativePath = getExecutionFlowRelativePath(executionFlow);
@@ -143,8 +147,8 @@ public class JcrExecutionModulesListener implements ExecutionModulesListener {
        protected String getExecutionFlowPath(Module module,
                        ExecutionFlow executionFlow) {
                String relativePath = getExecutionFlowRelativePath(executionFlow);
-               return modulesPath + '/' + module.getName() + '/' + module.getVersion()
-                               + '/' + relativePath;
+               return getExecutionModulesPath() + '/' + module.getName() + '/'
+                               + module.getVersion() + '/' + relativePath;
        }
 
        /** @return the relative path, never starts with '/' */
@@ -159,8 +163,17 @@ public class JcrExecutionModulesListener implements ExecutionModulesListener {
                return relativePath;
        }
 
+       protected String getExecutionModulesPath() {
+               return SlcJcrConstants.VM_AGENT_FACTORY_PATH + '/'
+                               + agent.getAgentUuid() + '/' + SlcNames.SLC_EXECUTION_MODULES;
+       }
+
        public void setSession(Session session) {
                this.session = session;
        }
 
+       public void setAgent(SlcAgent agent) {
+               this.agent = agent;
+       }
+
 }