You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "H. Ferdinand Nölscher" <fe...@noelscher.com> on 2012/03/15 16:18:42 UTC

JSVC Daemon: Pass arguments to application

Hello!

I need to pass some arguments to my application, which is using the jsvc
daemon loader. How could I possibly do that?

kind regards,
F. Nölscher

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: JSVC Daemon: Pass arguments to application

Posted by "H. Ferdinand Nölscher" <fe...@noelscher.com>.
On 15.03.2012 17:08, Konstantin Kolinko wrote:
> 2012/3/15 "H. Ferdinand Nölscher" <fe...@noelscher.com>:
>> Hello!
>>
>> I need to pass some arguments to my application, which is using the jsvc
>> daemon loader. How could I possibly do that?
>>
> From the docs:
>> http://commons.apache.org/daemon/jsvc.html
>> ./jsvc -help
>> Usage: jsvc [-options] class [args...]
>
> Those "args..." is what you are asking for.
>
> There is also
>>    -D<name>=<value>
>>        set a Java system property
> Best regards,
> Konstantin Kolinko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>

Let's say I run

jsvc [-options] class myargs anotherArgument

I check for arguments with something like:

String[] args = dc.getArguments(); (dc is the DaemonContext)

But that just gives me an empty list.


kind regards,
F. Nölscher

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: JSVC Daemon: Pass arguments to application

Posted by Konstantin Kolinko <kn...@gmail.com>.
2012/3/15 "H. Ferdinand Nölscher" <fe...@noelscher.com>:
> Hello!
>
> I need to pass some arguments to my application, which is using the jsvc
> daemon loader. How could I possibly do that?
>

>From the docs:
> http://commons.apache.org/daemon/jsvc.html

> ./jsvc -help
> Usage: jsvc [-options] class [args...]


Those "args..." is what you are asking for.

There is also
>    -D<name>=<value>
>        set a Java system property

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org