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

Sam Wright commented on ARIES-1464:
-----------------------------------

>From http://docs.oracle.com/javaee/7/api/javax/inject/Scope.html

bq. By default, if no scope annotation is present, the injector creates an 
instance (by injecting the type's constructor), uses the instance for one 
injection, and then forgets it

It goes on to give @Singleton as an example (which itself is @Scope-annotated). 
So without any @Scope annotations the default behaviour is to inject a 
newly-created and instantly-forgotten object (i.e. a prototype).

> Improve blueprint-maven-plugin: add prototype-scope support
> -----------------------------------------------------------
>
>                 Key: ARIES-1464
>                 URL: https://issues.apache.org/jira/browse/ARIES-1464
>             Project: Aries
>          Issue Type: Improvement
>          Components: Blueprint
>            Reporter: Sam Wright
>            Assignee: Christian Schneider
>             Fix For: blueprint-maven-plugin-1.3.0
>
>
> -I propose adding support for configuring bean scope using 
> blueprint-maven-plugin, e.g. annotating a class with `@Scope("prototype")` 
> will add `scope = "prototype"` to the bean's xml element.-
> The JSR-330 spec says that a class can be defined as a prototype-scoped bean 
> by applying only the @Named annotation, and that to give the bean a 
> singleton-scope the @Singleton annotation should then be applied (either with 
> or replacing @Named), e.g.
> {code}
> @Singleton class AutonamedSingleton {}
> @Singleton @Named("foo") class NamedSingleton {}
> @Named AutonamedPrototype {}
> @Named("bar") NamedPrototype {}
> {code}
> The pull request implements this. NB this maintains backwards-compatibility 
> with classes annotated using @Singleton or @Component, with or without @Named.
> [[email protected]] is probably the person to review this.



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

Reply via email to