Re: [SmartFrog-support] question on naming of components
Steve Loughran <[email protected]> Fri, 26 Jan 2007 15:40:52 +0000
| Newsgroups | gmane.comp.java.smartfrog.user |
|---|---|
| Message-ID | <[email protected]> |
Guijarro, Julio wrote:
> Hi Andreas,
>
> How will you provide the username?
>
> The easiest way is to modify the "smartfrog" script . In the long term,
> we could modify the scripts so that they prefix the component name with
> an environment property if it exists and you would only need to provide
> that property (We accept patches :-) )
>
> What do you think?
>
> Julio
>
> -----Original Message-----
> From: smartfrog-support-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> [mailto:smartfrog-support-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of
> Andreas Unterkircher
> Sent: 26 January 2007 14:27
> To: smartfrog-support
> Subject: [Smartfrog-support] question on naming of components
>
> Hello,
>
> we'd like to know who deployed a component by having the username in the
>
> components name, e.g. one would have to do something like this:
>
> sfStart host1 username_myComponent txt.sf
>
> Now I'd like to have the username added automatically, i.e. the user
> types
>
> sfStart host1 myComponent txt.sf
>
> and the component gets deployed as username_myComponent.
> The most obvious way to achieve this for me would be to modify the
> sfStart script. I wonder if there is some other (easy) way to achieve
> this in SmartFrog ?
>
> Thanks,
> Andreas
There's no real notion of username in java, because it isnt there in all
versions of windows, mobile phones, printers, etc.
${user.home} is the closest there is to a username, and its really just
the path to a home directory. This is implicitly available in a
deployment descriptor, so could be extracted:
user.home PROPERTY user.home
However, your request makes me think. It makes me think that perhaps
deployed components really need some metadata attached to them that
records how they were deployed -hostname/ipaddr, time, ${user.home}.
etc. You could certainly tweak the code behind sfStart to add these
attributes, though there is always a risk of side effects.
-steve
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV