diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2014-09-09 12:13:21 +0200 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2014-09-09 12:13:21 +0200 |
| commit | da731d2bb81666b9c697d9099da632e7dfcdc0f7 (patch) | |
| tree | 567693c3c48f3d15ecbb2dac4f9db03bb6e58c72 /src/main/java/com/c2kernel/lifecycle/instance/JobPusher.java | |
| parent | ae1e79e33fd30e3d8bcedbef8891a14a048276d7 (diff) | |
Replaced int sysKey Item identifier with UUID, which is now portable.
ItemPath objects are now used to identify Items throughout the kernel,
replacing ints and Integers.
Diffstat (limited to 'src/main/java/com/c2kernel/lifecycle/instance/JobPusher.java')
| -rw-r--r-- | src/main/java/com/c2kernel/lifecycle/instance/JobPusher.java | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/main/java/com/c2kernel/lifecycle/instance/JobPusher.java b/src/main/java/com/c2kernel/lifecycle/instance/JobPusher.java index 89e7708..d134daf 100644 --- a/src/main/java/com/c2kernel/lifecycle/instance/JobPusher.java +++ b/src/main/java/com/c2kernel/lifecycle/instance/JobPusher.java @@ -6,6 +6,7 @@ import com.c2kernel.entity.Agent; import com.c2kernel.entity.AgentHelper;
import com.c2kernel.entity.agent.JobArrayList;
import com.c2kernel.lookup.AgentPath;
+import com.c2kernel.lookup.ItemPath;
import com.c2kernel.lookup.Path;
import com.c2kernel.lookup.RolePath;
import com.c2kernel.process.Gateway;
@@ -14,43 +15,43 @@ import com.c2kernel.utils.Logger; final class JobPusher extends Thread {
private final Activity activity;
private final RolePath myRole;
- private final int itemSysKey;
+ private final ItemPath itemPath;
- JobPusher(Activity activity, int itemSysKey, RolePath role) {
+ JobPusher(Activity activity, ItemPath itemPath, RolePath role) {
this.activity = activity;
- this.itemSysKey = itemSysKey;
+ this.itemPath = itemPath;
this.myRole = role;
}
@Override
public void run()
{
- Thread.currentThread().setName("Agent job pusher for "+itemSysKey+":"+activity.getName()+" to role "+myRole);
+ Thread.currentThread().setName("Agent job pusher for "+itemPath+":"+activity.getName()+" to role "+myRole);
for (Iterator<Path> e = myRole.getChildren(); e.hasNext();)
{
AgentPath nextAgent = (AgentPath)e.next();
- Logger.msg(7, "Activity.pushJobsToAgents() - Calculating jobs for " + nextAgent.getAgentName());
+ Logger.msg(7, "Activity.pushJobsToAgents() - Calculating jobs for " + nextAgent);
try
{
// get joblist for user
- JobArrayList jobList = new JobArrayList(this.activity.calculateJobs(nextAgent, itemSysKey, false));
+ JobArrayList jobList = new JobArrayList(this.activity.calculateJobs(nextAgent, itemPath, false));
Logger.msg(7, "Activity.pushJobsToAgents() - User will receive " + jobList.list.size() + " jobs");
String stringJobs = Gateway.getMarshaller().marshall(jobList);
// push it to the agent
org.omg.CORBA.Object agentIOR = nextAgent.getIOR();
Agent thisAgent = AgentHelper.narrow(agentIOR);
Logger.msg(7, "Calling agent "+thisAgent.getSystemKey()+" from "+activity.getPath());
- thisAgent.refreshJobList(itemSysKey, activity.getPath(), stringJobs);
+ thisAgent.refreshJobList(itemPath.getSystemKey(), activity.getPath(), stringJobs);
}
catch (Exception ex)
{
Logger.error(
"Agent "
- + nextAgent.getAgentName()
+ + nextAgent
+ " of role "
+ myRole
+ " could not be found to be informed of a change in "
- + itemSysKey);
+ + itemPath);
Logger.error(ex);
}
}
|
