Skip to main content

How to inject @Resource for the handler ?

2 replies [Last post]
jxf6483
Offline
Joined: 2005-07-14

Hi,

I read JSR 250 and saw the follow description,

"The runtime MUST then carry out any injections requested by the handler, typically via the javax.annotation.Resource annotation. After all the injections have been carried out, including in the case where no injections were requested, the runtime MUST invoke the method carrying a javax.annotation .PostConstruct annotation, if present."

It seems the @Resource annotation can be used for injecting init-params to the handler. I looked at the class HandlerAnnotationProcessor, there is indeed processing for @PostConstruct, but seems nothing for @Resource processing. Thus, I can not see how the injection is done. Or do I miss something here? Which part of the code is for @Resource injection?

Thanks in advance,

Jian

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
bbissett
Offline
Joined: 2003-06-16

>
> "The runtime MUST then carry out any injections
> requested by the handler, typically via the
> javax.annotation.Resource annotation. After all the
> injections have been carried out, including in the
> case where no injections were requested, the runtime
> MUST invoke the method carrying a javax.annotation
> .PostConstruct annotation, if present."

I think this is only in the EE case, but I don't know if it has been implemented yet in the app server. I don't know of any way to pass parameters into the handler automatically anymore in the standalone case, but I have some questions out about it internally and hope to have more info soon.

Cheers,
Bobby

jxf6483
Offline
Joined: 2005-07-14

Sorry, the description is in JAX-WS specification final draft, not JSR 250. No one knows about it? Or it is not implemented yet?