tapestry-spring autowiring

View: New views
6 Messages — Rating Filter:   Alert me  

tapestry-spring autowiring

by Ari Miller :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

We are using hivemind 1.1.
Many of our services are autowired with our existing persistence services.
We want to switch to injecting in our persistence services from Spring, to take advantage of container managed transactions.
I can inject in spring beans using the tapestry-spring functionality, but autowiring doesn't seem to be available.
Is there an established pattern for also considering Spring beans when autowiring within hivemind?

P.S.
I am aware of hivetranse, but would prefer to use Spring for this purpose.

RE: tapestry-spring autowiring

by Marcus.Schulte :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

have a look at tapernate (http://www.carmanconsulting.com/tapernate/)

> -----Original Message-----
> From: Ari Miller [mailto:ari@...]
> Sent: Friday, August 31, 2007 12:35 AM
> To: user@...
> Subject: tapestry-spring autowiring
>
>
> We are using hivemind 1.1.
> Many of our services are autowired with our existing
> persistence services.
> We want to switch to injecting in our persistence services
> from Spring, to take advantage of container managed transactions.
> I can inject in spring beans using the tapestry-spring
> functionality, but autowiring doesn't seem to be available.
> Is there an established pattern for also considering Spring
> beans when autowiring within hivemind?
>
> P.S.
> I am aware of hivetranse, but would prefer to use Spring for
> this purpose.
> --
> View this message in context:
> http://www.nabble.com/tapestry-spring-autowiring-tf4357304.htm
l#a12417539
> Sent from the Hivemind - User mailing list archive at Nabble.com.
>
>

Re: tapestry-spring autowiring

by jwcarman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Even Tapernate won't consider spring beans for autowiring.  Spring
beans aren't "services" in the HiveMind world.  That's not to say that
you can't expose them as services, but you have to explicitly set up a
service declaration and use the SpringLookupFactory as your
implementation factory.  Tapestry 4.x has built-in (used to be an
external module called tapestry-autowire) support for autowiring of
HiveMind services.  All you have to do is declare an abstract "getter"
of the type you need (as long as there's exactly one service in the
registry that has that service interface, which is usually the case)
on your component/page class.

On 8/31/07, Marcus.Schulte@... <Marcus.Schulte@...> wrote:

> have a look at tapernate (http://www.carmanconsulting.com/tapernate/)
>
> > -----Original Message-----
> > From: Ari Miller [mailto:ari@...]
> > Sent: Friday, August 31, 2007 12:35 AM
> > To: user@...
> > Subject: tapestry-spring autowiring
> >
> >
> > We are using hivemind 1.1.
> > Many of our services are autowired with our existing
> > persistence services.
> > We want to switch to injecting in our persistence services
> > from Spring, to take advantage of container managed transactions.
> > I can inject in spring beans using the tapestry-spring
> > functionality, but autowiring doesn't seem to be available.
> > Is there an established pattern for also considering Spring
> > beans when autowiring within hivemind?
> >
> > P.S.
> > I am aware of hivetranse, but would prefer to use Spring for
> > this purpose.
> > --
> > View this message in context:
> > http://www.nabble.com/tapestry-spring-autowiring-tf4357304.htm
> l#a12417539
> > Sent from the Hivemind - User mailing list archive at Nabble.com.
> >
> >
>

Re: tapestry-spring autowiring

by jwcarman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Tapernate is based on the hivemind-hibernate3 library
(http://svn.javaforge.com/svn/hivemind/hivemind-hibernate3/trunk)
which basically allows you to set up Spring's hibernate support via
HiveMind.  It "hivemindizes" the Spring hibernate classes.

On 8/31/07, Marcus.Schulte@... <Marcus.Schulte@...> wrote:

> have a look at tapernate (http://www.carmanconsulting.com/tapernate/)
>
> > -----Original Message-----
> > From: Ari Miller [mailto:ari@...]
> > Sent: Friday, August 31, 2007 12:35 AM
> > To: user@...
> > Subject: tapestry-spring autowiring
> >
> >
> > We are using hivemind 1.1.
> > Many of our services are autowired with our existing
> > persistence services.
> > We want to switch to injecting in our persistence services
> > from Spring, to take advantage of container managed transactions.
> > I can inject in spring beans using the tapestry-spring
> > functionality, but autowiring doesn't seem to be available.
> > Is there an established pattern for also considering Spring
> > beans when autowiring within hivemind?
> >
> > P.S.
> > I am aware of hivetranse, but would prefer to use Spring for
> > this purpose.
> > --
> > View this message in context:
> > http://www.nabble.com/tapestry-spring-autowiring-tf4357304.htm
> l#a12417539
> > Sent from the Hivemind - User mailing list archive at Nabble.com.
> >
> >
>

RE: tapestry-spring autowiring

by Marcus.Schulte :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If I understood him correctly, Ari considered switching from HiveMind to
Spring to use spring-ta-management. From my memory, I thought tapernate
would just wire up the Spring ta-manager to make it usable with
HM-services. So, he could stay with HiveMind and still "enjoy" ;) the
Spring transaction stuff.

> -----Original Message-----
> From: jcarman@...
> [mailto:jcarman@...] On Behalf Of James Carman
> Sent: Friday, August 31, 2007 2:49 PM
> To: user@...
> Subject: Re: tapestry-spring autowiring
>
> Even Tapernate won't consider spring beans for autowiring.  
> Spring beans aren't "services" in the HiveMind world.  That's
> not to say that you can't expose them as services, but you
> have to explicitly set up a service declaration and use the
> SpringLookupFactory as your implementation factory.  Tapestry
> 4.x has built-in (used to be an external module called
> tapestry-autowire) support for autowiring of HiveMind
> services.  All you have to do is declare an abstract "getter"
> of the type you need (as long as there's exactly one service
> in the registry that has that service interface, which is
> usually the case) on your component/page class.
>
> On 8/31/07, Marcus.Schulte@... <Marcus.Schulte@...> wrote:
> > have a look at tapernate
> (http://www.carmanconsulting.com/tapernate/)
> >
> > > -----Original Message-----
> > > From: Ari Miller [mailto:ari@...]
> > > Sent: Friday, August 31, 2007 12:35 AM
> > > To: user@...
> > > Subject: tapestry-spring autowiring
> > >
> > >
> > > We are using hivemind 1.1.
> > > Many of our services are autowired with our existing persistence
> > > services.
> > > We want to switch to injecting in our persistence services from
> > > Spring, to take advantage of container managed transactions.
> > > I can inject in spring beans using the tapestry-spring
> > > functionality, but autowiring doesn't seem to be available.
> > > Is there an established pattern for also considering Spring beans
> > > when autowiring within hivemind?
> > >
> > > P.S.
> > > I am aware of hivetranse, but would prefer to use Spring for this
> > > purpose.
> > > --
> > > View this message in context:
> > > http://www.nabble.com/tapestry-spring-autowiring-tf4357304.htm
> > l#a12417539
> > > Sent from the Hivemind - User mailing list archive at Nabble.com.
> > >
> > >
> >
>

Re: tapestry-spring autowiring

by Ari Miller :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for the advice, I hadn't heard of tapernate.
Basically, I'm trying to expose all of my spring beans to make them available for autowiring.  I don't want to explicitly declare each one in my hivemodule.xml if I can avoid it.   I was hoping there might be an existing module that would take a SpringBeanFactory, iterate through the beans, find the declared interfaces, and register them with the RegistryInfrastructureimpl as a ServicePoint (handwave, handwave).
Customizations might include the ability to package specify what interfaces to expose, allow for logic to log.error if multiple beans from Spring support the same interface, etc.  I could definitely see writing a custom SpringBeanExposer (handwave) that, given a list of spring beans, returns a map of interfaces to particular spring beans, that the end user had to implement.
At the end of the day, regardless of implementation, I'm basically just trying to register the interface implemented by the Spring beans in such a way that those beans are available to the autowiring functionality of hivemind when an object with a setter matching that interface is being constructed.  This seemed similar to the existing tapestry-spring exposure, where any spring bean is available through the spring: namespace, without having to individually declare each one.


James Carman wrote:
Even Tapernate won't consider spring beans for autowiring.  Spring
beans aren't "services" in the HiveMind world.  That's not to say that
you can't expose them as services, but you have to explicitly set up a
service declaration and use the SpringLookupFactory as your
implementation factory.  Tapestry 4.x has built-in (used to be an
external module called tapestry-autowire) support for autowiring of
HiveMind services.  All you have to do is declare an abstract "getter"
of the type you need (as long as there's exactly one service in the
registry that has that service interface, which is usually the case)
on your component/page class.

On 8/31/07, Marcus.Schulte@bmw.ch <Marcus.Schulte@bmw.ch> wrote:
> have a look at tapernate (http://www.carmanconsulting.com/tapernate/)
>
> > -----Original Message-----
> > From: Ari Miller [mailto:ari@virtualtourist.com]
> > Sent: Friday, August 31, 2007 12:35 AM
> > To: user@hivemind.apache.org
> > Subject: tapestry-spring autowiring
> >
> >
> > We are using hivemind 1.1.
> > Many of our services are autowired with our existing
> > persistence services.
> > We want to switch to injecting in our persistence services
> > from Spring, to take advantage of container managed transactions.
> > I can inject in spring beans using the tapestry-spring
> > functionality, but autowiring doesn't seem to be available.
> > Is there an established pattern for also considering Spring
> > beans when autowiring within hivemind?
> >
> > P.S.
> > I am aware of hivetranse, but would prefer to use Spring for
> > this purpose.
> > --
> > View this message in context:
> > http://www.nabble.com/tapestry-spring-autowiring-tf4357304.htm
> l#a12417539
> > Sent from the Hivemind - User mailing list archive at Nabble.com.
> >
> >
>