Thank you very much! That was it.
Just one more catch: Injecting the Services like I did doesn't work with
@EagerLoad. One needs to either cache them by providing a module constructor
or inject them at the method parameters as described here:
http://tapestry.apache.org/tapestry5/tapestry-ioc/module.html#Caching%20Services
Regards,
Otho

2007/6/11, Davor Hrg <[EMAIL PROTECTED]>:

you missed it just sligtly,

anotating your Impl works if you use "bind"

here, because you are constructing th Impl tapestry is not
checking out annotations on it.
you have to annotate you build Method
extract from doc:
-------------------------------
Eager Loading Services
Services are normally created only as needed (per the scope discussion
above).
This can be tweaked slightly; by adding the EagerLoad annotation to the
service builder method,....
...................................


put:
@EagerLoad
public MyInterface buildMyInterface(final Log log)
{
   log.debug("Creating service MyInterface");
   return new MyInterfaceImpl(springService);
}



On 6/11/07, Otho <[EMAIL PROTECTED]> wrote:
>
> Any hints as to how that exactly works?
>
> I wrote a service interface,
>
> public interface MyInterface
> {
> }
>
> implemented it and annotated it with @EagerLoad
>
> @EagerLoad
> public class MyInterfaceImpl implemets MyInterface
> {
>     public MyInterfaceImpl(SpringService springService)
>     {
>         doSomeStuff(springService);
>     }
>
>     private void doSomeStuff(SpringService springService);
> }
>
> and in the app module wrote:
>
> @Inject
> @Service("SpringService")
> private SpringService springService; //will be reused in other services
>
> public MyInterface buildMyInterface(final Log log)
> {
>     log.debug("Creating service MyInterface");
>     return new MyInterfaceImpl(springService); <=
> }
>
>
> Still... when debugging with Tomcat the buildMyInterface method isn't
> executed, in contrast to all other methods (like the example timing
filter
> from the archetype). I am a bit lost at that.
>
> Regards,
> Otho
>

Reply via email to