Re: sfStart and program arguments
"Guijarro, Julio" <[email protected]> Fri, 17 Aug 2007 11:09:10 +0100
| Newsgroups | gmane.comp.java.smartfrog.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Gary,
No problem, we will try to help you. It is the same with every new
system; it takes a while to get used to it.
I don't know exactly your use case but SmartFrog is all about
configuration and therefore what I would do is to put these parameters
as SmartFrog configuration attributes that the component then reads and
sets as system properties.
Ex.
sfConfig extends MyComponent {
javaPropertyFile "...file url";
}
Then in the component you can read that information and set the
java.policy.property.
Void readAttriutes() {
String javaPropFile = "defaultValue";
// true = mandatory
javaPropertiesFile = sfResolve ("javaPropertyFile", javaPropFile,
true);
System.setProperty("java.security.policy", javaPropertiesFile);
}
Something like this would work. What you cannot do is to set any -D type
of parameters but if that is what you need then you could use
SubProcesses to do that. But I don't want to confuse you with too much
information unless you need it.
Regards,
Julio
> -----Original Message-----
> From: Robinson, Gary [mailto:[email protected]]
> Sent: 16 August 2007 15:32
> To: Guijarro, Julio
> Subject: RE: [Smartfrog-support] sfStart and program arguments
>
> Hi Julio,
>
> Thanks for your prompt reply. As you may have guessed I am quite new
to
> the SmartFrog framework and any help is greatly appreciated. How would
I
> create a component to pass these parameters onto another daemon? Do
you
> have any examples?
>
> Kind Regards,
> Gary
>
> -----Original Message-----
> From: Guijarro, Julio [mailto:[email protected]]
> Sent: 16 August 2007 15:02
> To: Robinson, Gary; smartfrog-support-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> Subject: RE: [Smartfrog-support] sfStart and program arguments
>
> Hi Gary,
>
> Welcome to the list.
>
> What I get from your question is that you are trying to pass some java
> properties to a program that is deployed using sfStart. If my
> understanding is correct then what you need to do is to have a daemon
> that either was started with those parameters included on the command
> line or you will need your component to use something like system
> properties to get those parameters to your other program.
>
> sfStart is used to parse a description and verify that everything is
> correct and then to pass that description to the daemon. Then, the
> daemon is the one that deploys the components that will load your
> application.
>
> To start a daemon with special parameters you can use -J . For
example:
> rem JVMARGS are declared using -J token
> rem e.g. -J "-Djava.library.path=/libs -Xmx400M"
> rem e.g. -J "-Djava.library.path=/libs" -J -Xmx400M
>
> If you use SmartFrog with security on you will find that SmartFrog
uses
> the Java Security Manager and also needs a java security policy file.
> This file is set in the script setSFSecurityProperties. For both to
work
> together, you should merge all the security policies in one file. If
you
> only need that policy file because or RMI, and you don't care about
its
> restrictions, then you could enable the "all permitted" policy file
that
> we have for dynamic classloading with no security by just removing the
> comment (#) in
>
> # export SFDYNAMICCLASSLOADING_ON=ENABLED
>
> I haven't tried it but to hard code a security policy in a java
program
> you could try this:
>
> String myFile="....";
> System.setProperty("java.security.policy",myFile);
> System.setSecurityManager(new SecurityManager());
>
>
> Julio
>
> > -----Original Message-----
> > From: smartfrog-support-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> [mailto:smartfrog-
> > support-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of Robinson, Gary
> > Sent: 16 August 2007 11:29
> > To: smartfrog-support-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> > Subject: [Smartfrog-support] sfStart and program arguments
> >
> > Hi all, hopefully someone here can help me.
> >
> > Is there a way to pass Java program arguments into the sfStart
> command?
> >
> > I have deployed a description that loads a Java RMI server
> application.
> > And
> > for the the server application to work it needs to bind itself with
an
> > RMI
> > registry and therefore needs to have a java security policy file
> > associated
> > with it passed in as an argument.
> >
> > Also, does anyone have any information about how i can hard code a
> java
> > secuirty policy into a Java program?
> >
> > Many thanks,
> > Gary
> >
> >
>
------------------------------------------------------------------------
> -
> > This SF.net email is sponsored by: Splunk Inc.
> > Still grepping through log files to find problems? Stop.
> > Now Search log events and configuration files using AJAX and a
> browser.
> > Download your FREE copy of Splunk now >> http://get.splunk.com/
> > _______________________________________________
> > Smartfrog-support mailing list
> > Smartfrog-support-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> > https://lists.sourceforge.net/lists/listinfo/smartfrog-support
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/