[forge-issues] [JBoss JIRA] (FORGE-1792) Add scopes to a the faces-new-bean command
Antonio Goncalves (JIRA)
issues at jboss.org
Wed Aug 12 03:33:02 EDT 2015
[ https://issues.jboss.org/browse/FORGE-1792?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Work on FORGE-1792 started by Antonio Goncalves.
------------------------------------------------
> Add scopes to a the faces-new-bean command
> ------------------------------------------
>
> Key: FORGE-1792
> URL: https://issues.jboss.org/browse/FORGE-1792
> Project: Forge
> Issue Type: Sub-task
> Components: Java EE
> Affects Versions: 2.5.0.Final
> Reporter: Antonio Goncalves
> Assignee: Antonio Goncalves
> Labels: Starter
> Fix For: 2.x Future
>
>
> The command {{faces-new-bean}} should be able to add a scope. Then, depending on the scope, the generated code would be different (e.g. implements Serializable for most of the other stateful scopes)
> {code}
> faces-new-bean --named MyBean --scoped SESSION
> {code}
> This would generate the following code
> {code}
> @Named
> @SessionScoped
> public class MyBean implements Serializable {
> }
> {code}
> For the conversation scope we could add more code :
> {code}
> faces-new-bean --named MyBean --scoped Conversation
> {code}
> This would generate the following code
> {code}
> @Named
> @ConversationScoped
> public class MyBean implements Serializable {
> @Inject
> private Conversation conversation;
> public String begin() {
> conversation.begin();
> return null;
> }
> public String end() {
> conversation.end();
> return null;
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
More information about the forge-issues
mailing list