Skip to content

Commit

Permalink
Spec 1342 : Make Flows Injectable (#619)
Browse files Browse the repository at this point in the history
  • Loading branch information
volosied authored Oct 4, 2023
1 parent f9aaff9 commit 7905297
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import jakarta.faces.context.ExternalContext;
import jakarta.faces.context.FacesContext;
import jakarta.faces.context.Flash;
import jakarta.faces.flow.Flow;
import jakarta.faces.flow.builder.FlowBuilder;
import jakarta.faces.flow.builder.FlowBuilderParameter;
import jakarta.faces.lifecycle.ClientWindow;
Expand Down Expand Up @@ -226,6 +227,13 @@ public FlowBuilder getFlowBuilderInstance()
{
return new FlowBuilderImpl();
}

@Produces
@FacesScoped
public Flow getCurrentFlow()
{
return FacesContext.getCurrentInstance().getApplication().getFlowHandler().getCurrentFlow();
}

@Produces
@Push
Expand All @@ -236,6 +244,12 @@ public PushContext getPushContext(InjectionPoint ip, BeanManager beanManager)
return new PushContextImpl(channel, beanManager);
}

/*
* Convserations are made injectiable via CDI
*/
// @Produces
// public Conversation getConversation() { ... }

/*
The spec actually forces us the use producers for "session" and "request" but this conflicts with CDI spec actually,
because CDI is responsible for producing HttpServletRequest and HttpSession
Expand Down

0 comments on commit 7905297

Please sign in to comment.