Re: Groovy + JXTA

"Bruno E. Grossi" <[email protected]> Fri, 22 Dec 2006 17:33:43 -0200 (BRDT)
Newsgroups gmane.comp.java.jxta.user
Message-ID <[email protected]>
Guillaume,

I will be on vacation on next week. On january I will study groovy and it's
integration with jxta...

Happy holidays!

Bruno Grossi

---- Mensagem Original ----
From: "Guillaume Laforge" <[email protected]>
To: [email protected]
Sent: Sex, Dezembro 22, 2006 5:15 am
Subject: Re: [JXTA user] Groovy + JXTA

Hello Bruno,

There are various tricks to achieve that goal.

The idea would be to add a new method on NetworkConfiguration called
configure() that would take a Closure object.
The curly braced block of code after configure is the closure body,
and it's the first argument passed to the configure method (i.e.
configure {} is like configure( {} ) )

It's possible to create a GroovyNetworkConfigurator class directly
with that method, or virtually add this configure() method to the
normal NetworkConfiguration class by using a category method, as
explained at the very end of that page:
http://groovy.codehaus.org/Closures.

Then, in your configure() method, you could set the "delegate" of that
closure to the instance of the network configurator, so that the
assignments are done to the configurator.

On 12/21/06, Bruno E. Grossi <[email protected]> wrote:
> Guillaume,
>
>
> I don't known Groovy. Please, can you explain what's necessary to create a
> method to do something like:
>  def conf = new NetworkConfigurator().configure {
>      home = new File(jxtaHome)
>      peerId = "..."
>      name = "my name"
>      multicast = false
>      // etc...
> }
>
> Bruno E. Grossi
>
>
> ---- Mensagem Original ----
> From: "Guillaume Laforge" <[email protected]>
> To: [email protected]
> Sent: Qua, Dezembro 20, 2006 3:39 pm
> Subject: Re: [JXTA user] Groovy + JXTA
>
> I'm "trying" to use JXTA a bit at the moment, so if ever I manage to
> find some places where some Groovy wrappers might help, I'll try my
> best.
> A first area is the configurator, for instance.
> But I'm sure we might add some other interesting stuffs.
> But I'm not a guru of JXTA in any way :-(
>
> On 12/19/06, Bruno E. Grossi <[email protected]> wrote:
> > +1
> >
> > It's a great idea! Can we help you?
> >
> > Bruno E. Grossi
> >
> > ---- Mensagem Original ----
> > From: "Guillaume Laforge" <[email protected]>
> > To: [email protected]
> > Sent: Ter, Dezembro 19, 2006 11:15 am
> > Subject: Re: [JXTA user] Groovy + JXTA
> >
> > In fact, it wouldn't have to be a "port" of JXTA in Groovy, but the
> > idea could be to provide a thin layer on top of the JXTA apis that
> > would add some more "grooviness" to them :-)
> >
> > On 12/19/06, Walter Barnes <[email protected]> wrote:
> > > I think it would be great to have a Groovy port of JXTA. I'm new to
both
> > JXTA and Groovy and have been working on creating a JXTA app using
Groovy.
> > So far the results are more Java than Groovy but I'm getting there :-)
> > >
> > > ----- Original Message ----
> > > From: Guillaume Laforge <[email protected]>
> > > To: [email protected]
> > > Sent: Monday, December 18, 2006 4:35:58 PM
> > > Subject: [JXTA user] Groovy + JXTA
> > >
> > >
> > > Hello,
> > >
> > > I'm working on the Groovy project, the dynamic language for the JVM.
> > > For one of my customers, I was investigating the JXTA technology.
> > > And I was wondering whether there could be some ways to make JXTA more
> > Groovy.
> > >
> > > For instance, it could be nice to use the configurator that way:
> > >
> > > def conf = new NetworkConfigurator().configure {
> > >     home = new File(jxtaHome)
> > >     peerId = "..."
> > >     name = "my name"
> > >     multicast = false
> > >     // etc...
> > > }
> > >
> > > We could also use Groovy's coercion mechanism to transform closures
> > > into rendezvous listeners in a single line:
> > >
> > > def listener = { RendezvousEvent evt -> println evt.toString() } as
> > > RendezvousListener
> > >
> > > It'd be nice to have some easy ways for creating peer groups, pipes or
> > > other JXTA artifacts.
> > > I feel that JXTA is quite complicated to master and understand, and
> > > that some Groovy basic layer above raw JXTA libraries could help
> > > foster the adoption of JXTA for building simple P2P applications --
> > > while still being able to fine-tune more complex applications with the
> > > raw power and capabilities of JXTA.
> > >
> > > What do you think?
> > >
> > > Guillaume
> > >
> > > PS: I'm really just thinking aloud, and I'm neither an exeprt of JXTA,
> > > not able to implement those ideas as I'm a total JXTA newbie
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [email protected]
> > > For additional commands, e-mail: [email protected]
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam protection around
> > > http://mail.yahoo.com
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [email protected]
> > > For additional commands, e-mail: [email protected]
> > >
> > >
> >
> >
> > --
> > Guillaume Laforge
> > Groovy Project Manager
> > http://glaforge.free.fr/blog/groovy
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
> >
>
>
> --
> Guillaume Laforge
> Groovy Project Manager
> http://glaforge.free.fr/blog/groovy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>


--
Guillaume Laforge
Groovy Project Manager
http://glaforge.free.fr/blog/groovy

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]