Since Spring 3.0, scoped proxies are Serializable. So, it's perfectly
possible to use @Configurable, @Autowired, and lots of AspectJ magic,
for Pages and Components, instead of wicket-spring/@SpringBean.

Provided, of course, that all beans you inject into Components are
scope-proxied (<aop:scoped-proxy/> or @Scope(value = "singleton",
proxyMode = ScopedProxyMode.INTERFACES)).



On Tue, Feb 22, 2011 at 7:10 PM, Bruno Borges <[email protected]> wrote:
> If enough documentation is supplied, to state that usage of such annotations
> can only be used this way:
>
> class MyPage extends WebPage {
>  @Autowired
>  private transient MyService service;
> }
>
> Annotations like @Configured (at type level of panels, pages and components
> in general) and @Component would be ignored (or reported).
>
> Is this feature still inviable?
>
> Bruno Borges
> www.brunoborges.com.br
> +55 21 76727099
>
> "The glory of great men should always be
> measured by the means they have used to
> acquire it."
>  - Francois de La Rochefoucauld
>
>
>
> On Tue, Feb 22, 2011 at 6:38 PM, James Carman 
> <[email protected]>wrote:
>
>> The problem with that is that it doesn't address the situation where
>> the reference is passed elsewhere (like to a DataProvider).  With the
>> proxy-based approach (which wicket-spring does now), it does.
>>
>> On Tue, Feb 22, 2011 at 4:34 PM, Bruno Borges <[email protected]>
>> wrote:
>> > Hi everyone,
>> >
>> >    A friend was playing with Wicket and Spring and suggested that the
>> > Spring integration could have a injector that could call the
>> > AutowireCapableFactory of Spring to process Spring-native annotations,
>> like
>> > @Autowired and @Value.
>> >
>> >      @Override
>> > public void onInstantiation(Component arg0) {
>> >
>> contextLocator.getSpringContext().getAutowireCapableBeanFactory().autowireBean(arg0);
>> > }
>> >
>> > What do you guys think of this?
>> >
>> > Best regards,
>> >
>> > Bruno Borges
>> > www.brunoborges.com.br
>> > +55 21 76727099
>> >
>> > "The glory of great men should always be
>> > measured by the means they have used to
>> > acquire it."
>> >  - Francois de La Rochefoucauld
>> >
>>
>

Reply via email to