users@glassfish.java.net

Re: [Asking]About org.jvnet.hk2.annotations.Decorate

From: Tang Yong <tangyong_at_cn.fujitsu.com>
Date: Wed, 27 Feb 2013 22:55:48 +0900

Hi JWells,

Thanks your reply very much!

> PopulatorPostProcessor which can be used in the HK2Populator methods.
I see.

> What is the use case for which you need a Decorator?
Currently, I myself am trying to bring stopped Glassfish PaaS back into
current gf trunk. And in the stopped Glassfish PaaS, there is a class
called "org.glassfish.virtualization.config.ServerPoolConfig" in
iaas-mgmt/virt-api module and @Decorate annotates this class as following:

...
@Decorate(targetType = Domain.class, methodName = "getExtensions", with
= Create.class )
public interface ServerPoolConfig extends ConfigBeanProxy {
...
}

Because current gf uses the newest HK2, in order to build
iaas-mgmt/virt-api module, I must replace @Decorate with some new HK2
API or use hk2-deprecated-XXX.jar.

This is a true case.

Thanks
--Tang

John Wells wrote:
> So the Decorator concept has been changed in the HK2 2.0 API, and so the
> Decorate annotation has been removed. Instead we have things called
> PopulatorPostProcessor which can be used in the HK2Populator methods.
> There is an outstanding feature enhancement request to add some standard
> PopulatorPostProcessors that will do things like read from
> META-INF/services or be configurable.
>
> What is the use case for which you need a Decorator?
>
> On 2/27/2013 2:18 AM, Tang Yong wrote:
>> Jwells,
>>
>> I found that the Decorate annotation definitions between
>> hk2-deprecated-XXX.jar and hk2-api-2.0.0.jar are different as following:
>>
>> [hk2-api-2.0.0.jar]
>> ...
>> Class<? extends Annotation>[] with();
>> ...
>>
>> [hk2-deprecated-XXX.jar]
>> ...
>> Class<? extends Annotation> with();
>> ...
>>
>> So, do you notice the change?
>>
>> Thanks
>> --Tang
>>
>> Tang Yong wrote:
>>> Hi Jwells, Team
>>>
>>> I have a question about org.jvnet.hk2.annotations.Decorate.
>>>
>>> Now, this org.jvnet.hk2.annotations.Decorate has been deprecated and can
>>> be found in hk2-deprecated.jar.
>>>
>>> I want to ask how to replace org.jvnet.hk2.annotations.Decorate with
>>> some annotation in current hk2 release?
>>>
>>> Thanks
>>> --Tang
>>>
>>>
>
>
>