Skip to content
Browse files

Use a special context parameter to indicate that ConversationFilter h…

…as been registered
  • Loading branch information...
1 parent caafe29 commit 871059a00657bc5893829ffa9efea7ba6abf5dbd @jharting jharting committed Apr 6, 2013
View
11 subsystem/src/main/java/org/jboss/as/weld/deployment/processors/WebIntegrationProcessor.java
@@ -40,6 +40,7 @@
import org.jboss.as.weld.WeldDeploymentMarker;
import org.jboss.as.weld.WeldLogger;
import org.jboss.as.weld.webtier.jsp.JspInitializationListener;
+import org.jboss.metadata.javaee.spec.ParamValueMetaData;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
import org.jboss.metadata.web.spec.FilterMappingMetaData;
import org.jboss.metadata.web.spec.FilterMetaData;
@@ -64,6 +65,8 @@
private static final String CONVERSATION_FILTER_CLASS = ConversationFilter.class.getName();
private static final String CONVERSATION_FILTER_NAME = "CDI Conversation Filter";
+ private static final ParamValueMetaData CONVERSATION_FILTER_INITIALIZED = new ParamValueMetaData();
+
public WebIntegrationProcessor() {
// create wbl listener
@@ -73,6 +76,8 @@ public WebIntegrationProcessor() {
conversationFilterMetadata.setFilterClass(CONVERSATION_FILTER_CLASS);
conversationFilterMetadata.setFilterName(CONVERSATION_FILTER_NAME);
conversationFilterMetadata.setAsyncSupported(true);
+ CONVERSATION_FILTER_INITIALIZED.setParamName(ConversationFilter.CONVERSATION_FILTER_REGISTERED);
+ CONVERSATION_FILTER_INITIALIZED.setParamValue(Boolean.TRUE.toString());
}
@Override
@@ -149,6 +154,11 @@ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitPro
}
webMetaData.getFilters().add(conversationFilterMetadata);
registerAsComponent(CONVERSATION_FILTER_CLASS, module, deploymentUnit, applicationClasses);
+ List<ParamValueMetaData> contextParams = webMetaData.getContextParams();
+ if (contextParams == null) {
+ webMetaData.setContextParams(new ArrayList<ParamValueMetaData>());
+ }
+ webMetaData.getContextParams().add(CONVERSATION_FILTER_INITIALIZED);
}
}
@@ -162,5 +172,6 @@ public void undeploy(DeploymentUnit context) {
private void registerAsComponent(String listener, EEModuleDescription module, DeploymentUnit deploymentUnit, EEApplicationClasses applicationClasses) {
final WebComponentDescription componentDescription = new WebComponentDescription(listener, listener, module, deploymentUnit.getServiceName(), applicationClasses);
module.addComponent(componentDescription);
+ deploymentUnit.addToAttachmentList(WebComponentDescription.WEB_COMPONENTS, componentDescription.getStartServiceName());
}
}

0 comments on commit 871059a

Please sign in to comment.
Something went wrong with that request. Please try again.