how to get attribute value
Andreas Unterkircher <[email protected]> Tue, 21 Feb 2006 11:45:54 +0100 (CET)
| Newsgroups | gmane.comp.java.smartfrog.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I'm deveolping a component "RollbackSequence" which might have a
description as follows (I omit testA's description):
sfConfig extends RollbackSequence {
action1 extends {
first extends testA {
message "first";
}
second extends testA {
message "second";
}
third extends testA {
message "third";
}
}
}
Now in it's sfStart phase RollbackSequence should deploy one of the 3
descriptions found in "action1" based on some additional information. My
problem is how to get the desrciption of first, second or third. In
RollbackSequence's sfStart() I have the following code:
act = (ComponentDescription) actions.get(componentName);
System.out.println(act.toString());
if(act.sfContainsAttribute("first")) System.out.println("Contains first");
for(Iterator ii = act.sfAttributes();ii.hasNext();)
System.out.println(ii.next());
This gives
first extends {
sfCodeBase "default";
sfClass "ch.cern.openlab.smartfrog.test.TestA";
sfExport false;
sfShouldTerminate true;
message "first";
}
second extends {
sfCodeBase "default";
sfClass "ch.cern.openlab.smartfrog.test.TestA";
sfExport false;
sfShouldTerminate true;
message "second";
}
third extends {
sfCodeBase "default";
sfClass "ch.cern.openlab.smartfrog.test.TestA";
sfExport false;
sfShouldTerminate true;
message "third";
}
Contains first
first
second
third
act is a ComponentDescription... how can I get the value for an attribute
(which describes a component I want to deploy) ? E.g. out of "first",
"second", "third" I'd like to deploy "second". For ComponentDescription I
find the method sfAttributeKeyFor, but I would need somehow the reverse of
this. How can I solve this problem ? Thanks for your help !
Best regards,
Andreas
--
http://cern.ch/openlab
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642