summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/process/Bootstrap.java
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@cern.ch>2014-05-07 17:33:13 +0200
committerAndrew Branson <andrew.branson@cern.ch>2014-05-08 16:37:39 +0200
commita1f0ecbb6a2bea6aa214322c412af2f3c5ce124b (patch)
tree4d74229b6dd9cfd7ce054e06bf740b9a63a578d6 /src/main/java/com/c2kernel/process/Bootstrap.java
parent6dfa1bbe05a712174e937af89d5223e98d9d7d06 (diff)
Agent now extends Item, so they can have workflows. All traces of the
old 'Entity' superclasses should be removed, including proxies and paths. Very large change, breaks API compatibility with CRISTAL 2.x. Fixes #135
Diffstat (limited to 'src/main/java/com/c2kernel/process/Bootstrap.java')
-rw-r--r--src/main/java/com/c2kernel/process/Bootstrap.java23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/main/java/com/c2kernel/process/Bootstrap.java b/src/main/java/com/c2kernel/process/Bootstrap.java
index 601db31..e2ad24e 100644
--- a/src/main/java/com/c2kernel/process/Bootstrap.java
+++ b/src/main/java/com/c2kernel/process/Bootstrap.java
@@ -10,7 +10,6 @@ import org.custommonkey.xmlunit.Diff;
import org.custommonkey.xmlunit.XMLUnit;
import com.c2kernel.common.ObjectNotFoundException;
-import com.c2kernel.entity.TraceableEntity;
import com.c2kernel.entity.proxy.ItemProxy;
import com.c2kernel.events.Event;
import com.c2kernel.events.History;
@@ -22,7 +21,7 @@ import com.c2kernel.lifecycle.instance.predefined.ServerPredefinedStepContainer;
import com.c2kernel.lifecycle.instance.stateMachine.Transition;
import com.c2kernel.lookup.AgentPath;
import com.c2kernel.lookup.DomainPath;
-import com.c2kernel.lookup.EntityPath;
+import com.c2kernel.lookup.ItemPath;
import com.c2kernel.lookup.LDAPLookup;
import com.c2kernel.lookup.Path;
import com.c2kernel.lookup.RolePath;
@@ -128,7 +127,7 @@ public class Bootstrap
}
else {
DomainPath path = (DomainPath)en.nextElement();
- thisProxy = (ItemProxy)Gateway.getProxyManager().getProxy(path);
+ thisProxy = Gateway.getProxyManager().getProxy(path);
// Verify module property and location
@@ -150,7 +149,7 @@ public class Bootstrap
if (!modDomPath.equals(path)) { // move item to module subtree
Logger.msg("Module item "+itemName+" found with path "+path.toString()+". Moving to "+modDomPath.toString());
- modDomPath.setEntity(new EntityPath(thisProxy.getSystemKey()));
+ modDomPath.setEntity(new ItemPath(thisProxy.getSystemKey()));
if (!modDomPath.exists())
Gateway.getLDAPLookup().add(modDomPath);
Gateway.getLDAPLookup().delete(path);
@@ -247,17 +246,15 @@ public class Bootstrap
}
- EntityPath entityPath = Gateway.getLDAPLookup().getNextKeyManager().generateNextEntityKey();
- TraceableEntity newItem = (TraceableEntity)Gateway.getCorbaServer().createEntity(entityPath);
+ ItemPath entityPath = Gateway.getLDAPLookup().getNextKeyManager().generateNextEntityKey();
+ Gateway.getCorbaServer().createEntity(entityPath);
Gateway.getLDAPLookup().add(entityPath);
- newItem.initialise(
- 1,
- Gateway.getMarshaller().marshall(props),
- Gateway.getMarshaller().marshall(ca));
DomainPath newDomPath = impHandler.getPath(itemName, ns);
newDomPath.setEntity(entityPath);
Gateway.getLDAPLookup().add(newDomPath);
- return (ItemProxy)Gateway.getProxyManager().getProxy(entityPath);
+ ItemProxy newItemProxy = Gateway.getProxyManager().getProxy(entityPath);
+ newItemProxy.initialise( 1, props, ca, null);
+ return newItemProxy;
}
/**************************************************************************
@@ -281,7 +278,7 @@ public class Bootstrap
}
try {
- EntityPath entityPath = lookup.getNextKeyManager().generateNextEntityKey();
+ ItemPath entityPath = lookup.getNextKeyManager().generateNextEntityKey();
AgentPath agentPath = new AgentPath(entityPath.getSysKey(), name);
agentPath.setPassword(pass);
Gateway.getCorbaServer().createEntity(agentPath);
@@ -318,7 +315,7 @@ public class Bootstrap
public static void createServerItem() throws Exception {
String serverName = Gateway.getProperties().getProperty("ItemServer.name");
thisServerPath = new DomainPath("/servers/"+serverName);
- EntityPath serverEntity;
+ ItemPath serverEntity;
try {
serverEntity = thisServerPath.getEntity();
} catch (ObjectNotFoundException ex) {