In the following scenario:
public void contributeMyConfiguration(Configuration<Foo>
configuration, @Autobuild FooImpl foo)
{
configuration.add(foo);
}
Tapestry will autobuild foo using the same rules as services. Another approach:
public void contributeMyConfiguration(Configuration<Foo> configuration)
{
configuration.addInstance(FooImpl.class);
}
This is an alternate way to inject an autobuild instance of the class.
On Wed, Apr 29, 2009 at 10:56 AM, daniel joyce <[email protected]> wrote:
> Is there any way to have a non-component class work with injection,
> w/o having to turn it into a service itself?
>
> @Inject
> private SystemProperties sysProps;
>
> I have a class that simply zips up files, and it needs access to a
> system properties service. IIRC, but when I tried this in the past, it
> didn't work for classes that were not pages/components. I also don't
> want to necessarily turn a class into a service merely to give it
> access to another service.
>
> Any way to do this? Or was I simply doing it wrong before?
>
> -Daniel
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
--
Howard M. Lewis Ship
Creator of Apache Tapestry
Director of Open Source Technology at Formos
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]