cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-6854) Application subclass can't be injected into an application lass field
Date Thu, 31 Mar 2016 09:35:25 GMT

    [ https://issues.apache.org/jira/browse/CXF-6854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15219657#comment-15219657
] 

Sergey Beryozkin commented on CXF-6854:
---------------------------------------

Section 9.2.1: 
"The instance of the application-supplied Application subclass can be injected into a class
field or method parameter using the @Context annotation. Access to the Application subclass
instance allows configuration information to be centralized in that class. Note that this
cannot be injected into the Application subclass itself since this would create a circular
dependency."

So, this is a case of the circular dependency, right ?

> Application subclass can't be injected into an application lass field
> ---------------------------------------------------------------------
>
>                 Key: CXF-6854
>                 URL: https://issues.apache.org/jira/browse/CXF-6854
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.1.6, 3.0.9
>            Reporter: Jim Ma
>            Assignee: Jim Ma
>             Fix For: 3.0.10, 3.1.7, 3.2.0
>
>         Attachments: injectionUtil.diff
>
>
> public class MyApplication extends Application {
> 	@Context
> 	Application application;
> 	@Context
> 	UriInfo info;
> 	@Context
> 	Request request;
> 	@Context
> 	HttpHeaders headers;
> 	public java.util.Set<java.lang.Class<?>> getClasses() {
> 		Set<Class<?>> resources = new HashSet<Class<?>>();
> 		resources.add(Resource.class);
> 		return resources;
>    }
> The application field is expected to be injected with value of MyApplication object(this),
not a null value after this application is started. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message