Author: dan.j.allen
Date: 2009-11-13 12:40:36 -0500 (Fri, 13 Nov 2009)
New Revision: 5048
Added:
extensions/trunk/faces/src/main/java/org/jboss/weldx/faces/
extensions/trunk/faces/src/main/java/org/jboss/weldx/faces/FacesContextProducer.java
Removed:
extensions/trunk/faces/src/main/java/org/jboss/weld/faces/
Log:
change package to org.jboss.weldx to avoid conflicts with core
Copied:
extensions/trunk/faces/src/main/java/org/jboss/weldx/faces/FacesContextProducer.java (from
rev 5047,
extensions/trunk/faces/src/main/java/org/jboss/weld/faces/FacesContextProducer.java)
===================================================================
--- extensions/trunk/faces/src/main/java/org/jboss/weldx/faces/FacesContextProducer.java
(rev 0)
+++
extensions/trunk/faces/src/main/java/org/jboss/weldx/faces/FacesContextProducer.java 2009-11-13
17:40:36 UTC (rev 5048)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.weldx.faces;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Produces;
+import javax.faces.context.FacesContext;
+
+/**
+ * <p>
+ * A producer which retrieves the current JSF FacesContext by calling
+ * {@link FacesContext#getCurrentInstance}, thus allowing it to be injected.
+ * </p>
+ *
+ * @author Gavin King
+ * @author Dan Allen
+ */
+public class FacesContextProducer
+{
+ public
+ @Produces
+ @RequestScoped
+ FacesContext getFacesContext()
+ {
+ return FacesContext.getCurrentInstance();
+ }
+}