Runtime: provide runtime args interactively
Brought to you by:
ymartin
Hi,
I have seen that el4ant 0.9.3 brings the possibility
to add arguments to the launch of java main classes,
through the use of runtime.arguments attribute.
In my project, when I was using el4ant 0.9.2, I had
developed a hook that was doing the same thing, but
that also allows me to enter arguments interactively.
I think this feature would be a cool add-on to el4ant.
I post my hook here if you want to take a look at it
and take some excerpts in the next el4ant version.
Jean-Francois
Hook with examples
Logged In: YES
user_id=98998
Thank you very much for your contribution.
I just wonder why the command line properties
(-Druntime.arguments= or -Druntime.append.arguments=) are
not enough.
What is your specific use case ?
Logged In: NO
Hello Yves,
I just used the interactive arguments for a sample client
module that allowed me to test (manually) an exchange with
a server.
When launching that client, I wanted to determine which
protocol I would use to connect to the server (in my case,
that was either hessian or burlap). I wanted also to be
able to select the user to connect to the server.
Since the code of the client was exactly the same I did
not want to create several modules or eu with different
args (in my specific cases, I had a combination of 4
possibilities for these 2 args).
Of course I know that I could have spent some more time on
my example to make it a JUnit test that would also have
tested all combinations of args, but I was a bit lazy at
that time;-) In addition, the sample client I had written
printed useful performance information about the exchange.
I can see another use case. In a client/server system, I
may have several servers (dev, tests, integration...), and
when I launch the client, I would like to be able to
choose -interactively- which server I am going to connect
to (through an arg of the client).
Logged In: NO
Hi,
I forgot one point (that cannot be provided with
-Druntime.arguments=..., the hook I have done shows what
is expected as arguments (how many; meaning of each), and
allows allows to set some default values.
This proves useful when you go back to a runtime target
that you have not used for some time (how can you remember
the number of args, the meaning of each... Of course, I
know that, anyway, this can be printed by the application
itself as "usage").
So that is not an urgent enhancement.
Cheers
Jean-Francois