From: <met...@cs...> - 2013-08-13 13:44:03
|
Hello Patric, Thanks for your quick response. Let me inform you what i need to do. Firstly, i want to define an attribute called IP inside my main .sf file. Then by using the sequence workflow component i define two sequential components that the first one is actually getting it(by the sfDeploy() function ) and the second one using it by deploying component2 to this very ip i want to know on run time. Something like this sequence ... { ip ?(how to define it?i thought it was TBA) component1 { getting the ip } component2{ sfProcessHost "IP?" <--- i stuck up to this } } I know how to handle the workflow components but the dynamic discovery of value is a problem to me. The 3rd and 4th solutions are sounding very attractive to me. So, regarding the 3rd the first component do learn the IP as part of the deployment procedure but i don't know how all the other components(for example the second one) can obtain it. As for the 4th solution, you mean to define an attribute that works as a function or create a smartfrog function of my own that obtains it? Danos Quoting "Goldsack, Patrick" <pat...@hp...>: > Danos, > > TBD won't work - that will throw an error when you parse as TBD > means that this has to be replaced in the usage (by extension). > > At what point to you know the value of the IP address? I assume that > you do not know it at time of creating the specification since > otherwise you would include it. > > So you have a number of options: > > 1) If you know it when you start the daemon (for example the IP > address of the local host), you could pass it as a java property and > set the "ip" attribute to a "PROPERTY" value (see the documentation > for details). This can be done in a start-up script on the command > line that starts the daemon, in a properties file (I forget the > name, but it is in the documentation), or programmatically by > setting the java property in the code before processing the .sf file. > > You can do the same with environmental variables using ENVPROPERTY > > 2) If you know it at the time you parse the .sf file, you could set > it in you code after the parse, and before the resolution phases. > This is not possible if you are simply using the standard start > script which do not have the opportunity to interject code in > between the parse and phase resolutions. > > 3) One of the components that gets started as part of the deployment > posts the value it obtains to the ip attribute, and all other > components obtain it by derefencing attributes that are LAZY links > to that posted attribute. > > 4) write yourself a smartfrog function that obtains the IP address > in whatever way required, and make the attribute a function invocation > > If none of these help, give more details of exactly what you need to > do and I will come up with some other options! > > Patrick > > > -----Original Message----- > From: met...@cs... [mailto:met...@cs...] > Sent: 13 August 2013 12:00 > To: sma...@li... > Subject: [Smartfrog-users] TBD_ip_address > > Hello to all, > > Is there a way to define an IP on runtime? > > I though the usage of defining an attribute like ip TBA; But how am > i going to resolve it then? > > thanks, > danos > > ---------------------------------------------------------------- > This message was sent using IMP, the Internet Messaging Program. > > > > ------------------------------------------------------------------------------ > Get 100% visibility into Java/.NET code with AppDynamics Lite! > It's a free troubleshooting tool designed for production. > Get down to code-level detail for bottlenecks, with <2% overhead. > Download for free and get started troubleshooting in minutes. > http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk > _______________________________________________ > Smartfrog-users mailing list > Sma...@li... > https://lists.sourceforge.net/lists/listinfo/smartfrog-users > > ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. |