diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2012-06-19 21:00:29 +0200 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2012-06-19 21:00:29 +0200 |
| commit | 2827a4b2d5aea32dc3c26a80f47309a6b68ac34b (patch) | |
| tree | fc5639f566cc0efa9081a18114ea9106a519e4d1 /src/main/java/com/c2kernel/process/Bootstrap.java | |
| parent | 839ff8b7380e31c260fe50994d20a53b1ec0327f (diff) | |
Refactor modules
Support workflows on module resources
Diffstat (limited to 'src/main/java/com/c2kernel/process/Bootstrap.java')
| -rw-r--r-- | src/main/java/com/c2kernel/process/Bootstrap.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/main/java/com/c2kernel/process/Bootstrap.java b/src/main/java/com/c2kernel/process/Bootstrap.java index 99b40f3..39a13d2 100644 --- a/src/main/java/com/c2kernel/process/Bootstrap.java +++ b/src/main/java/com/c2kernel/process/Bootstrap.java @@ -60,9 +60,11 @@ public class Bootstrap Thread.currentThread().setName("Bootstrapper");
// make sure all of the boot items are up-to-date
+ Logger.msg("Bootstrap.run() - Verifying kernel boot data items");
verifyBootDataItems();
// verify the server item's wf
+ Logger.msg("Bootstrap.run() - Initialising Server Item Workflow");
initServerItemWf();
// register modules
@@ -159,6 +161,18 @@ public class Bootstrap String propVal = propName.equals("Name")?itemName:pd.getDefaultValue();
props.list.add(new Property(propName, propVal));
}
+
+ // HACK: this gives all module resources a workflow. Maybe have a 'debug' flag in the module xml or server config to do this. Normally module resources should be read-only, as they would be reset at next boot.
+ CompositeActivity ca = new CompositeActivity();
+ if (ns!=null) {
+ String wf;
+ if (itemType.equals("CA")) wf = "ManageCompositeActDef";
+ else if (itemType.equals("EA")) wf = "ManageElementaryActDef";
+ else if (itemType.equals("OD")) wf = "ManageSchema";
+ else if (itemType.equals("SC")) wf = "ManageScript";
+ else throw new Exception("Unknown bootstrap item type: "+itemType);
+ ca = (CompositeActivity) ((CompositeActivityDef)LocalObjectLoader.getActDef(wf, "last")).instantiate();
+ }
EntityPath entityPath = Gateway.getLDAPLookup().getNextKeyManager().generateNextEntityKey();
TraceableEntity newItem = (TraceableEntity)Gateway.getCorbaServer().createEntity(entityPath);
@@ -166,7 +180,7 @@ public class Bootstrap newItem.initialise(
1,
CastorXMLUtility.marshall(props),
- CastorXMLUtility.marshall(new CompositeActivity()));
+ CastorXMLUtility.marshall(ca));
DomainPath newDomPath = new DomainPath(getTypeRoot(itemType).toString()+"/system/"+(ns==null?"kernel":ns)+"/"+itemName);
newDomPath.setEntity(entityPath);
Gateway.getLDAPLookup().add(newDomPath);
|
