ant elder wrote:
On Sun, Jul 4, 2010 at 9:19 PM, Jean-Sebastien Delfino
<[email protected]> wrote:
ant elder wrote:
On Fri, Jul 2, 2010 at 11:14 PM, Jean-Sebastien Delfino
<[email protected]> wrote:
Hi all,

I've committed a little program that I find useful to start and stop
Tuscany
nodes interactively under samples/launcher-shell.

It just reads and executes commands from input. The following commands
are
supported:
start <node-name> <contrib-uri> <contrib-location>
stop <node-name>
status
history
bye to exit

For details to build and run it, see the README [1].

I've been thinking about adding a little more to it, like support for
multiple contributions, display the composites, or more node status info
for example.

Hope this helps.
[1]

http://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/samples/launcher-shell/README
--
Jean-Sebastien

I like it. There are already some scripts in the binary distribution
that run contributions, but its nicer to to run interactively like
this does so we could update the distribution scripts to use this. It
would be good to support all the other domain operations too so I'd
like to help do that if thats ok with you.

  ...ant
Hi Ant,

Thanks for volunteering. I'm glad you like it, I've been using this little
shell to start/stop my apps and found it quite easy to use so I thought it'd
help others too.

If you want to help, I need more commands (to support apps made of multiple
contribs etc), illustrated by the following example script:

=> install c1 http://foo.org/c.jar

=> install c2 http://foo.org/d.jar

=> install c3 http://foo.org/e.jar

=> installed
c1 http://foo.org/c.jar http://myns foo
c2 http://foo.org/d.jar http://myns bar
c3 http://foo.org/e.jar

=> installed c1
c1 http://foo.org/c.jar http://myns foo

=> validate c1
resolved c3
missing http://otherns x4 (a namespace provided by c4)

=> install c4 http://foo.org/f.jar

=> start nodeA c1 http://myns foo

=> start nodeB c2 http://myns bar

=> status
nodeA c1 http://myns foo
nodeB c2 http://myns bar

=> status nodeA
nodeA c1 http://myns foo

=> stop nodeA

=> stop nodeB

=> bye

In this example, c1 is a contribution URI, http://foo.org/c.jar its
location, nodeA is a node name, http://myns foo is a composite qname.

I was going to code these commands myself as I'll need them mid of this
week, but I could use your help as I'm quite busy with other things too.

So if you have time, do you think you could add the above commands sometime
this week? That would really help me a lot!

Thanks!
--
Jean-Sebastien


I've been looking at this in the trunk module tuscany-shell (if you
didn't see that from the commits), its not completely the same as what
you've been doing as i wanted to be exercising the domain-node api,
but it should be close enough that we should hopefully be able to get
to something we all like.  Its still work in progress but you can try
it out by adding running the class org.apache.tuscany.shell.Shell and
including the dependency tuscany-shell (and jline if you want to use
that), or more simply by building shaded base-nodep and doing java
-jar tuscany-base-nodep-2.0-SNAPSHOT.jar.

   ...ant

Thanks Ant, I have a few comments and questions.

I'm confused as you've switched o.a.t.node.NodeFactory to a different o.a.t.node2.NodeFactory. I see 49 references to node.NodeFactory in the source tree, everywhere people need to create nodes. node2.NodeFactory looks like a parallel implementation, with only 3 references, if I'm not mistaken only from this new shell. What happened?

I don't really understand the new implementation of start() which initially just started a node, and now calls addToDomainLevelComposite()??

I'm puzzled as well with the logic in stop(), which now calls node.stop() + factory.stop() + removeFromDomainLevelComposite(). For me starting / stopping components in nodes is really orthogonal to adding / removing composites to / from the domain.

I think we should revert back to specific parameters on the command methods, like you still have on start() instead of just a list of toks like you now have on stop(). Passing the list of toks defeats the purpose of the eval() method.

Also this new shell seems to use a single node. It's fine with me if that's what you want to do here, but that's not what I need. What I need is a collection of independent nodes, each loaded with a deployable composite, each with its own lifecycle, like I had in the original code.

I like the jline thing though. I guess for now I'll probably steal that idea into the sample shell :) until your shell meets my needs. I'll be happy to switch to using your new shell later when you support multiple nodes again...

--
Jean-Sebastien

Reply via email to