Is there anything like ComponentDestructionListener ?

Because right now I'm implementing it with JDK proxy, so overload is bigger
(lookup every single method call) and only works with interfaces.

With DestructionListener I can inject the real service on instantiation and
unget the service on destruction of the component.

Thank you.

Hendy

On Sun, Nov 18, 2012 at 1:21 PM, Hendy Irawan <he...@soluvas.com> wrote:

> Hi Andreas,
>
> This is my attempt:
> https://github.com/soluvas/soluvas-web/commit/ef81705fd6ad4f69e75b247ac2dc6d387487eb97
>
> So far it seems to work... Do I need to do anything else to account for
> Pax Wicket, or there's needs to be some support in Pax Wicket itself?
>
> I reused JSR330 @Inject, but use our own qualifiers (@Namespace, @Filter,
> @Supplied) because we have our own conventions regarding OSGi service
> properties.
>
> In the future, my hope is that one day this will transition nicely (i.e.
> no change to Components) into Pax CDI/weld-osgi when they are finalized, so
> I'll reimplement the hook for these when the time comes. (and hopefully Pax
> Wicket will also support them)
>
> Hendy
>
>
> On Fri, Nov 16, 2012 at 7:29 PM, Andreas Pieber <anpie...@gmail.com>wrote:
>
>> Hey,
>>
>> 1) do you want to use/implement JSR330 OR something custom?
>> 2) It's not really possible doing this as a simple hook-in; you would
>> rather need to provide your own injection mechanism
>> 3) BUT if basically all you want is JSR330 we can come up with
>> something; I'm not a big fan of @PaxWicketBean (it's name) anyhow...
>>
>> Kind regards,
>> Andreas
>>
>> On Thu, Nov 15, 2012 at 6:19 AM, Hendy Irawan <he...@soluvas.com> wrote:
>> > Hi all,
>> >
>> > Currently we use a subclass of WebPage which provides the injection upon
>> > constructor and uninjects during onRemove(), finalize(). But this is
>> > problematic.
>> >
>> > Our injection looks like following:
>> >
>> > @Inject @Namespaced("product") @Filtered("(repositoryMode=normal)")
>> > private ImageRepository productImageRepo;
>> > @Inject @Supplied @Filtered("(layer=application)")
>> > private Banner banner;
>> >
>> > Is it possible to hook into the Pax Wicket serialization mechanism (like
>> > @PaxWicketBean does) so that the injection is performed on
>> deserialization
>> > and uninjection is performed on serialization? And this will work for
>> all
>> > components, not just specially crafted Pages.
>> >
>> > Thank you.
>> >
>> > --
>> > Hendy Irawan - on Twitter - on LinkedIn
>> > Web Developer | Bippo Indonesia | Akselerator Bisnis | Bandung
>> >
>> >
>> > _______________________________________________
>> > general mailing list
>> > general@lists.ops4j.org
>> > http://lists.ops4j.org/mailman/listinfo/general
>> >
>>
>> _______________________________________________
>> general mailing list
>> general@lists.ops4j.org
>> http://lists.ops4j.org/mailman/listinfo/general
>>
>
>
>
> --
> Hendy Irawan - on Twitter <http://twitter.com/hendybippo> - on 
> LinkedIn<http://id.linkedin.com/in/hendyirawan>
> Web Developer | Bippo Indonesia <http://www.bippo.co.id/> | Akselerator
> Bisnis | Bandung
>
>


-- 
Hendy Irawan - on Twitter <http://twitter.com/hendybippo> - on
LinkedIn<http://id.linkedin.com/in/hendyirawan>
Web Developer | Bippo Indonesia <http://www.bippo.co.id/> | Akselerator
Bisnis | Bandung
_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to