Seam SVN: r12550 - in modules/faces/trunk: examples/short-ly and 2 other directories.
by seam-commits@lists.jboss.org
Author: lincolnthree
Date: 2010-04-21 16:28:47 -0400 (Wed, 21 Apr 2010)
New Revision: 12550
Added:
modules/faces/trunk/examples/short-ly/readme.txt
modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/environment/SeamApplicationWrapper.java
Modified:
modules/faces/trunk/examples/short-ly/pom.xml
modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/cdi/JndiBeanManagerProvider.java
modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/cdi/ServletContextBeanManagerProvider.java
modules/faces/trunk/readme.txt
Log:
Updates for java 1.5 compatibility
Updated pom/readmes
Modified: modules/faces/trunk/examples/short-ly/pom.xml
===================================================================
--- modules/faces/trunk/examples/short-ly/pom.xml 2010-04-21 19:35:09 UTC (rev 12549)
+++ modules/faces/trunk/examples/short-ly/pom.xml 2010-04-21 20:28:47 UTC (rev 12550)
@@ -6,7 +6,7 @@
<artifactId>seam-faces-examples-short-ly</artifactId>
<packaging>war</packaging>
- <version>0.0.1-SNAPSHOT</version>
+ <version>3.0.0-SNAPSHOT</version>
<name>Seam Faces Example bit.ly clone with PrettyFaces</name>
<url>http://seamframework.org</url>
Added: modules/faces/trunk/examples/short-ly/readme.txt
===================================================================
--- modules/faces/trunk/examples/short-ly/readme.txt (rev 0)
+++ modules/faces/trunk/examples/short-ly/readme.txt 2010-04-21 20:28:47 UTC (rev 12550)
@@ -0,0 +1,6 @@
+ - Purpose of the example - for example, to demonstrate feature X by illustrate how that API can be used to perform A, B and C.
+ - Prerequisites - The AS has been installed and the appropriate properties files have been updated
+ - Step by Step setup for the example -
+ - Step by Step execution of the example - "ant deploy" or "mvn clean install" or "run -c server1" + "run -c server2" or "using your browser hit: http://localhost:8080/MyNewApp"
+ - Expected results - you should see "Hello World" on the console or you can now navigate the web-based application
+ - the readme.txt should include the maintainer of the example (along with contact info). This may simply point to the examples' POM.
\ No newline at end of file
Modified: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/cdi/JndiBeanManagerProvider.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/cdi/JndiBeanManagerProvider.java 2010-04-21 19:35:09 UTC (rev 12549)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/cdi/JndiBeanManagerProvider.java 2010-04-21 20:28:47 UTC (rev 12550)
@@ -29,21 +29,20 @@
* A BeanManager provider for JNDI contexts
*
* @author Nicklas Karlsson
- *
+ *
*/
public class JndiBeanManagerProvider implements BeanManagerProvider
{
- private String location;
+ private final String location;
public static final JndiBeanManagerProvider DEFAULT = new JndiBeanManagerProvider("java:comp/BeanManager");
public static final JndiBeanManagerProvider JBOSS_HACK = new JndiBeanManagerProvider("java:app/BeanManager");
- protected JndiBeanManagerProvider(String location)
+ protected JndiBeanManagerProvider(final String location)
{
this.location = location;
}
- @Override
public BeanManager getBeanManager()
{
try
Modified: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/cdi/ServletContextBeanManagerProvider.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/cdi/ServletContextBeanManagerProvider.java 2010-04-21 19:35:09 UTC (rev 12549)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/cdi/ServletContextBeanManagerProvider.java 2010-04-21 20:28:47 UTC (rev 12550)
@@ -26,16 +26,16 @@
import javax.servlet.ServletContext;
/**
- * A BeanManager provider for the Servlet Context attribute "javax.enterprise.inject.spi.BeanManager"
+ * A BeanManager provider for the Servlet Context attribute
+ * "javax.enterprise.inject.spi.BeanManager"
*
* @author Nicklas Karlsson
- *
+ *
*/
public class ServletContextBeanManagerProvider implements BeanManagerProvider
{
public static final ServletContextBeanManagerProvider DEFAULT = new ServletContextBeanManagerProvider();
- @Override
public BeanManager getBeanManager()
{
ServletContext servletContext = (ServletContext) FacesContext.getCurrentInstance().getExternalContext().getContext();
Added: modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/environment/SeamApplicationWrapper.java
===================================================================
--- modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/environment/SeamApplicationWrapper.java (rev 0)
+++ modules/faces/trunk/impl/src/main/java/org/jboss/seam/faces/environment/SeamApplicationWrapper.java 2010-04-21 20:28:47 UTC (rev 12550)
@@ -0,0 +1,137 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.seam.faces.environment;
+
+import java.util.Set;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.faces.FactoryFinder;
+import javax.faces.application.Application;
+import javax.faces.application.ApplicationFactory;
+import javax.faces.application.ApplicationWrapper;
+import javax.faces.convert.Converter;
+import javax.faces.event.PostConstructApplicationEvent;
+import javax.faces.validator.Validator;
+import javax.inject.Inject;
+
+import org.jboss.seam.faces.event.PhaseEventBridge;
+
+/**
+ * Provides @{@link Inject} support for JSF artifacts such as {@link Converter},
+ * {@link Validator}.
+ *
+ * @author <a href="mailto:lincolnbaxter@gmail.com>Lincoln Baxter, III</a>
+ *
+ */
+@ApplicationScoped
+public class SeamApplicationWrapper extends ApplicationWrapper
+{
+ private Application parent;
+
+ @Inject
+ BeanManager manager;
+
+ public void installWrapper(@Observes final PostConstructApplicationEvent event)
+ {
+ ApplicationFactory factory = (ApplicationFactory) FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
+ parent = factory.getApplication();
+ factory.setApplication(this);
+ }
+
+ @Override
+ public Converter createConverter(final Class<?> targetClass)
+ {
+ Converter result = null;
+
+ Set<Bean<?>> beans = manager.getBeans(targetClass);
+ if (!beans.isEmpty())
+ {
+ Bean<?> bean = beans.iterator().next();
+ CreationalContext<?> context = manager.createCreationalContext(bean);
+ result = (Converter) manager.getReference(bean, PhaseEventBridge.class, context);
+ }
+
+ if (result == null)
+ {
+ result = parent.createConverter(targetClass);
+ }
+
+ return result;
+ }
+
+ @Override
+ public Converter createConverter(final String converterId)
+ {
+ /*
+ * We need to ask for an instance because we have no way of getting the
+ * type information by id
+ */
+ Converter result = parent.createConverter(converterId);
+ if (result != null)
+ {
+ Class<? extends Converter> targetClass = result.getClass();
+ Set<Bean<?>> beans = manager.getBeans(targetClass);
+ if (!beans.isEmpty())
+ {
+ Bean<?> bean = beans.iterator().next();
+ CreationalContext<?> context = manager.createCreationalContext(bean);
+ result = (Converter) manager.getReference(bean, targetClass, context);
+ }
+ }
+
+ return result;
+ }
+
+ @Override
+ public Validator createValidator(final String validatorId)
+ {
+ /*
+ * We need to ask for an instance because we have no way of getting the
+ * type information by id
+ */
+ Validator result = parent.createValidator(validatorId);
+ if (result != null)
+ {
+ Class<? extends Validator> targetClass = result.getClass();
+ Set<Bean<?>> beans = manager.getBeans(targetClass);
+ if (!beans.isEmpty())
+ {
+ Bean<?> bean = beans.iterator().next();
+ CreationalContext<?> context = manager.createCreationalContext(bean);
+ result = (Validator) manager.getReference(bean, targetClass, context);
+ }
+ }
+
+ return result;
+ }
+
+ @Override
+ public Application getWrapped()
+ {
+ return parent;
+ }
+}
Modified: modules/faces/trunk/readme.txt
===================================================================
--- modules/faces/trunk/readme.txt 2010-04-21 19:35:09 UTC (rev 12549)
+++ modules/faces/trunk/readme.txt 2010-04-21 20:28:47 UTC (rev 12550)
@@ -42,4 +42,10 @@
Release Notes
=============
- ...
+ * View actions
+ * javax.faces.bean.*Scoped aliases
+ * @FlashScoped and @ViewScoped
+ * CDI / Faces Phase & System Event bridge
+ * JSF API producers (FacesContext, ExternalContext, NavigationHandler, etc...)
+ * Simplified EL name to conversation: #{conversation.transient}
+
16 years
Seam SVN: r12549 - in modules/drools/trunk/impl/src/test: java/org/jboss/seam/drools/test/interceptors and 5 other directories.
by seam-commits@lists.jboss.org
Author: tsurdilovic
Date: 2010-04-21 15:35:09 -0400 (Wed, 21 Apr 2010)
New Revision: 12549
Added:
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/interceptors/
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/interceptors/InterceptorsTest.java
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/interceptors/InterceptorsTestBean.java
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/interceptors/InterceptorsTestFilter.java
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/interceptors/Person.java
modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/interceptors/
modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/interceptors/InterceptorsTest-beans.xml
modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/interceptors/interceptorstest.drl
Modified:
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/ksession/KSessionTest.java
modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/cep/CEPTest-beans.xml
modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/flow/FlowTest-beans.xml
Log:
Added: modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/interceptors/InterceptorsTest.java
===================================================================
--- modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/interceptors/InterceptorsTest.java (rev 0)
+++ modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/interceptors/InterceptorsTest.java 2010-04-21 19:35:09 UTC (rev 12549)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.drools.test.interceptors;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertNotSame;
+
+import javax.inject.Inject;
+import javax.validation.constraints.AssertTrue;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.drools.KnowledgeBaseProducer;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.Archives;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.weld.extensions.resources.ResourceProvider;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class InterceptorsTest
+{
+ @Deployment
+ public static JavaArchive createTestArchive()
+ {
+ String pkgPath = InterceptorsTest.class.getPackage().getName().replaceAll("\\.", "/");
+ JavaArchive archive = Archives.create("test.jar", JavaArchive.class)
+ .addPackages(true, new InterceptorsTestFilter(), KnowledgeBaseProducer.class.getPackage())
+ .addPackages(true, ResourceProvider.class.getPackage())
+ .addClass(Person.class)
+ .addClass(InterceptorsTestBean.class)
+ .addResource(pkgPath + "/interceptorstest.drl", ArchivePaths.create("interceptorstest.drl"))
+ .addManifestResource(pkgPath + "/InterceptorsTest-beans.xml", ArchivePaths.create("beans.xml"));
+ //System.out.println(archive.toString(Formatters.VERBOSE));
+ return archive;
+ }
+
+ @Inject InterceptorsTestBean ibean;
+
+ @Test
+ public void testInterceptors() {
+ assertNotNull(ibean);
+
+ ibean.getPerson();
+ assertTrue(true);
+ }
+}
Added: modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/interceptors/InterceptorsTestBean.java
===================================================================
--- modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/interceptors/InterceptorsTestBean.java (rev 0)
+++ modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/interceptors/InterceptorsTestBean.java 2010-04-21 19:35:09 UTC (rev 12549)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.drools.test.interceptors;
+
+import javax.enterprise.inject.Default;
+
+import org.jboss.seam.drools.annotations.InsertFact;
+import org.jboss.seam.drools.qualifiers.config.DefaultConfig;
+
+public class InterceptorsTestBean
+{
+ @InsertFact(fire=true) @Default @DefaultConfig
+ public Person getPerson() {
+ System.out.println("*********** \n\nIN GETPERSON\n\n**************");
+ return new Person();
+ }
+}
Added: modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/interceptors/InterceptorsTestFilter.java
===================================================================
--- modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/interceptors/InterceptorsTestFilter.java (rev 0)
+++ modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/interceptors/InterceptorsTestFilter.java 2010-04-21 19:35:09 UTC (rev 12549)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.drools.test.interceptors;
+
+import org.jboss.shrinkwrap.api.Filter;
+
+public class InterceptorsTestFilter implements Filter<Class<?>>
+{
+
+ public boolean include(Class<?> clazz)
+ {
+ // exclude classes in all other test packages except your own
+ if(clazz.getPackage().getName().startsWith("org.jboss.seam.drools.test")
+ && !clazz.getPackage().getName().equals(InterceptorsTestFilter.class.getPackage().getName())) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+
+}
\ No newline at end of file
Added: modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/interceptors/Person.java
===================================================================
--- modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/interceptors/Person.java (rev 0)
+++ modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/interceptors/Person.java 2010-04-21 19:35:09 UTC (rev 12549)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.drools.test.interceptors;
+
+public class Person
+{
+ private String name;
+ private String telephoneNumber;
+ private int age;
+ private boolean eligible;
+
+ public String getName()
+ {
+ return name;
+ }
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+ public String getTelephoneNumber()
+ {
+ return telephoneNumber;
+ }
+ public void setTelephoneNumber(String telephoneNumber)
+ {
+ this.telephoneNumber = telephoneNumber;
+ }
+
+ public int getAge()
+ {
+ return age;
+ }
+
+ public void setAge(int age)
+ {
+ this.age = age;
+ }
+
+ public boolean isEligible()
+ {
+ return eligible;
+ }
+
+ public void setEligible(boolean eligible)
+ {
+ this.eligible = eligible;
+ }
+
+
+
+}
Modified: modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/ksession/KSessionTest.java
===================================================================
--- modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/ksession/KSessionTest.java 2010-04-21 18:32:06 UTC (rev 12548)
+++ modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/ksession/KSessionTest.java 2010-04-21 19:35:09 UTC (rev 12549)
@@ -77,11 +77,5 @@
assertNotSame(ksession, mvelksession);
assertSame(mvelksession, mvelksession2);
- doSomething();
}
-
- @InsertFact @Default @DefaultConfig
- public void doSomething() {
-
- }
-}
+ }
Modified: modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/cep/CEPTest-beans.xml
===================================================================
--- modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/cep/CEPTest-beans.xml 2010-04-21 18:32:06 UTC (rev 12548)
+++ modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/cep/CEPTest-beans.xml 2010-04-21 19:35:09 UTC (rev 12549)
@@ -22,7 +22,7 @@
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:s="urn:java:seam:core"
xmlns:d="urn:java:org.jboss.seam.drools:org.jboss.seam.drools.config"
- xmlns:test="urn:java:org.jboss.seam.drools.test.ksession">
+ xmlns:test="urn:java:org.jboss.seam.drools.test.cep">
<d:CEPPseudoClockRuleResources>
<s:specializes/>
Modified: modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/flow/FlowTest-beans.xml
===================================================================
--- modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/flow/FlowTest-beans.xml 2010-04-21 18:32:06 UTC (rev 12548)
+++ modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/flow/FlowTest-beans.xml 2010-04-21 19:35:09 UTC (rev 12549)
@@ -22,7 +22,7 @@
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:s="urn:java:seam:core"
xmlns:d="urn:java:org.jboss.seam.drools:org.jboss.seam.drools.config"
- xmlns:test="urn:java:org.jboss.seam.drools.test.ksession">
+ xmlns:test="urn:java:org.jboss.seam.drools.test.flow">
<d:DefaultRuleResources>
<s:specializes/>
Added: modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/interceptors/InterceptorsTest-beans.xml
===================================================================
--- modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/interceptors/InterceptorsTest-beans.xml (rev 0)
+++ modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/interceptors/InterceptorsTest-beans.xml 2010-04-21 19:35:09 UTC (rev 12549)
@@ -0,0 +1,38 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright ${year}, Red Hat, Inc., and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-->
+<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:s="urn:java:seam:core"
+ xmlns:d="urn:java:org.jboss.seam.drools:org.jboss.seam.drools.config"
+ xmlns:test="urn:java:org.jboss.seam.drools.test.interceptors">
+
+ <d:DefaultRuleResources>
+ <s:specializes/>
+ <d:resources>
+ <s:value>classpath;interceptorstest.drl;DRL</s:value>
+ </d:resources>
+ </d:DefaultRuleResources>
+
+ <test:InterceptorsTestBean>
+ <s:overrides/>
+ </test:InterceptorsTestBean>
+
+</beans>
Added: modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/interceptors/interceptorstest.drl
===================================================================
--- modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/interceptors/interceptorstest.drl (rev 0)
+++ modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/interceptors/interceptorstest.drl 2010-04-21 19:35:09 UTC (rev 12549)
@@ -0,0 +1,14 @@
+package org.jboss.seam.drools.test.interceptors
+
+import org.jboss.seam.drools.test.interceptors.Person;
+
+rule "is person eligible for buss pass"
+lock-on-active
+when
+ $p : Person( age >=18 )
+then
+ modify($p) {
+ setEligible(true);
+ }
+end
+
16 years
Seam SVN: r12548 - in modules/faces/trunk: examples/short-ly and 1 other directories.
by seam-commits@lists.jboss.org
Author: lincolnthree
Date: 2010-04-21 14:32:06 -0400 (Wed, 21 Apr 2010)
New Revision: 12548
Modified:
modules/faces/trunk/docs/reference/src/main/docbook/en-US/author_group.xml
modules/faces/trunk/docs/reference/src/main/docbook/en-US/events.xml
modules/faces/trunk/docs/reference/src/main/docbook/en-US/installation.xml
modules/faces/trunk/examples/short-ly/pom.xml
modules/faces/trunk/examples/short-ly/src/main/webapp/META-INF/MANIFEST.MF
Log:
Fixed broken example build (example still not functional)
Documentation updates
Modified: modules/faces/trunk/docs/reference/src/main/docbook/en-US/author_group.xml
===================================================================
--- modules/faces/trunk/docs/reference/src/main/docbook/en-US/author_group.xml 2010-04-21 16:41:56 UTC (rev 12547)
+++ modules/faces/trunk/docs/reference/src/main/docbook/en-US/author_group.xml 2010-04-21 18:32:06 UTC (rev 12548)
@@ -10,6 +10,10 @@
<firstname>Lincoln</firstname>
<surname>Baxter III</surname>
</author>
+ <author>
+ <firstname>Nicklas</firstname>
+ <surname>Karlsson</surname>
+ </author>
<!--
vim:et:ts=3:sw=3:tw=120
Modified: modules/faces/trunk/docs/reference/src/main/docbook/en-US/events.xml
===================================================================
--- modules/faces/trunk/docs/reference/src/main/docbook/en-US/events.xml 2010-04-21 16:41:56 UTC (rev 12547)
+++ modules/faces/trunk/docs/reference/src/main/docbook/en-US/events.xml 2010-04-21 18:32:06 UTC (rev 12548)
@@ -9,47 +9,54 @@
</para>
<para>
There are two categories of events: JSF phase events, and JSF system events. Phase events are triggered
- as JSF processes HTTP requests, while system events are raised at specific events during the JSF lifecycle.
+ as JSF processes each lifecycle phase, while system events are raised at more specific, fine-grained events during
+ request processing.
</para>
<section id="events.phases">
- <title>JSF phases events</title>
+ <title>JSF Phase events</title>
+
<para>
- A JSF phase listener is a class that implements the <literal>javax.faces.event.PhaseListener</literal> and
- is registered in the web applications <literal>faces-config.xml</literal>. By implementing the methods of the
+ A JSF phase listener is a class that implements <literal>javax.faces.event.PhaseListener</literal> and
+ is registered in the web application's <literal>faces-config.xml</literal> file. By implementing the methods of the
interfaces, the user can observe events fired before or after any of the six lifecycle phases of a JSF request:
<literal>restore view</literal>, <literal>apply request values</literal>, <literal>process validations</literal>,
<literal>update model values</literal>, <literal>invoke application</literal> or <literal>render view</literal>.
</para>
- <para>
- Instead of registering your own phase listener, you can use the seam-faces module to have the events propagated
- to the CDI event bus where they can be observed using the normal CDI <literal>@Observes</literal> methods. Bringing
- the events to your beans saves you the trouble of registering your own phase listeners and gives you the added
- benfit of injection, alternatives, interceptors and other features of CDI you already have available in your beans!
- </para>
- <para>
- CDI observation works by providing a method in a managed bean that has a method parameter annotated
- <literal>@Observes</literal>. This method parameter is the event object passed along when firing the event and
- can be further narrowed down by adding qualifiers. The naming of the method itself is not significant.
- See the Seam Reference Guide for more information on events and observing.
- </para>
- <para>
- The event object passed along from the phase listener is a <literal>javax.faces.event.PhaseEvent</literal>. So if
- you would like to observe the full spectrum of events propagated you would write the following method in your
- observer bean
- <programlisting role="Java">
+
+ <section id="events.phases.seam">
+ <title>Seam Faces Phase events</title>
+ <para>
+ What Seam provides is propagation of these Phase events to the CDI event bus; therefore, you can observe events
+ using normal CDI <literal>@Observes</literal> methods. Bringing the events to CDI beans removes the need to
+ register phase listener classes via XML, and gives the added benefit of injection, alternatives, interceptors
+ and access to all other features of CDI.
+ </para>
+ <para>
+ Creating an observer method in CDI is simple; just provide a method in a managed bean that is annotated with
+ <literal>@Observes</literal>. Each observer method must accept one method parameter: the event object;
+ the type of this object determines the type of event being observed.
+ </para>
+ <para>
+ In this case, the event object passed along from the phase listener is a
+ <literal>javax.faces.event.PhaseEvent</literal>. The following example observes all Phase events.
+
+ <programlisting role="Java">
public void observeAll(@Observes PhaseEvent e)
{
// Do something with the event object
} </programlisting>
- </para>
- <para>
- Since the example above flushes you with a lot of events you have to sort out yourself, you might want to
- consider flitering them out a bit. We mentioned that there are six phases in the JSF lifecycle and each of
- these phases fire one event before executing and one after. This will result in 12 events fired, six
- "before" and six "after" events which have their corresponding temportal qualifiers <literal>@Before</literal> and
- <literal>@After</literal>. In order to split out the events into these categories, you would write two
- observer methods like
- <programlisting role="Java">
+ </para>
+ <para>
+ Events can be further filtered by adding Qualifiers. The name of the method itself is not significant.
+ (See the CDI Reference Guide for more information on events and observing.)
+ </para>
+ <para>
+ Since the example above simply processes all events, however, it might be appropriate to filter out some events
+ that we aren't interested in. As stated earlier, there are six phases in the JSF lifecycle, and an event is
+ fired before and after each, for a total of 12 events. The <literal>@Before</literal> and
+ <literal>@After</literal> "temporal" qualifiers can be used to observe events occurring only before or only after
+ a Phase event. For example:
+ <programlisting role="Java">
public void observeBefore(@Observes @Before PhaseEvent e)
{
// Do something with the "before" event object
@@ -59,210 +66,250 @@
{
// Do something with the "after" event object
} </programlisting>
- </para>
- <para>
- If you are interested in both the "before" and "after" event of a particular phase, you can limit them
- by adding a lifecycle qualifer that corresponds to the phase:
- <programlisting role="Java">
+ </para>
+ <para>
+ If we are interested in both the "before" and "after" event of a particular phase, we can limit them
+ by adding a "lifecycle" qualifier that corresponds to the phase:
+ <programlisting role="Java">
public void observeRenderResponse(@Observes @RenderResponse PhaseEvent e)
{
// Do something with the "render response" event object
} </programlisting>
- </para>
- <para>
- By combining a temporal qualifier with a lifecycel one you can achieve the tightest qualification:
- <programlisting role="Java">
+ </para>
+ <para>
+ By combining a temporal and lifecycle qualifier, we can achieve the most specific qualification:
+ <programlisting role="Java">
public void observeBeforeRenderResponse(@Observes @Before @RenderResponse PhaseEvent e)
{
// Do something with the "before render response" event object
} </programlisting>
- </para>
- <para>
- This is the full list of temporal and lifecycle qualifers
- <informaltable>
- <tgroup cols="3">
- <colspec colnum="1" colwidth="1*" />
- <colspec colnum="2" colwidth="1*" />
- <colspec colnum="3" colwidth="3*" />
- <thead>
- <row>
- <entry>Qualifier</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>@Before</entry>
- <entry>temporal</entry>
- <entry>Qualifies events before lifecycle phases</entry>
- </row>
- <row>
- <entry>@After</entry>
- <entry>temporal</entry>
- <entry>Qualifies events after lifecycle phases</entry>
- </row>
- <row>
- <entry>@RestoreView</entry>
- <entry>lifecycle</entry>
- <entry>Qualifies events from the "restore view" phase</entry>
- </row>
- <row>
- <entry>@ApplyRequestValues</entry>
- <entry>lifecycle</entry>
- <entry>Qualifies events from the "apply request values" phase</entry>
- </row>
- <row>
- <entry>@ProcessValidations</entry>
- <entry>lifecycle</entry>
- <entry>Qualifies events from the "process validations" phase</entry>
- </row>
- <row>
- <entry>@UpdateModelValues</entry>
- <entry>lifecycle</entry>
- <entry>Qualifies events from the "update model values" phase</entry>
- </row>
- <row>
- <entry>@InvokeApplication</entry>
- <entry>lifecycle</entry>
- <entry>Qualifies events from the "invoke application" phase</entry>
- </row>
- <row>
- <entry>@RenderResponse</entry>
- <entry>lifecycle</entry>
- <entry>Qualifies events from the "render response" phase</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- The event object is always a <literal>javax.faces.event.PhaseEvent</literal> and according to the general
- CDI principle, filtering is tightened by adding qualifiers and loosened by omitting them.
- </para>
+ </para>
+ </section>
+
+
+ <section id="events.phases.seam.table">
+ <title>Phase events listing</title>
+ <para>
+ This is the full list of temporal and lifecycle qualifiers
+ <informaltable>
+ <tgroup cols="3">
+ <colspec colnum="1" colwidth="1*" />
+ <colspec colnum="2" colwidth="1*" />
+ <colspec colnum="3" colwidth="3*" />
+ <thead>
+ <row>
+ <entry>Qualifier</entry>
+ <entry>Type</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>@Before</entry>
+ <entry>temporal</entry>
+ <entry>Qualifies events before lifecycle phases</entry>
+ </row>
+ <row>
+ <entry>@After</entry>
+ <entry>temporal</entry>
+ <entry>Qualifies events after lifecycle phases</entry>
+ </row>
+ <row>
+ <entry>@RestoreView</entry>
+ <entry>lifecycle</entry>
+ <entry>Qualifies events from the "restore view" phase</entry>
+ </row>
+ <row>
+ <entry>@ApplyRequestValues</entry>
+ <entry>lifecycle</entry>
+ <entry>Qualifies events from the "apply request values" phase</entry>
+ </row>
+ <row>
+ <entry>@ProcessValidations</entry>
+ <entry>lifecycle</entry>
+ <entry>Qualifies events from the "process validations" phase</entry>
+ </row>
+ <row>
+ <entry>@UpdateModelValues</entry>
+ <entry>lifecycle</entry>
+ <entry>Qualifies events from the "update model values" phase</entry>
+ </row>
+ <row>
+ <entry>@InvokeApplication</entry>
+ <entry>lifecycle</entry>
+ <entry>Qualifies events from the "invoke application" phase</entry>
+ </row>
+ <row>
+ <entry>@RenderResponse</entry>
+ <entry>lifecycle</entry>
+ <entry>Qualifies events from the "render response" phase</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ The event object is always a <literal>javax.faces.event.PhaseEvent</literal> and according to the general
+ CDI principle, filtering is tightened by adding qualifiers and loosened by omitting them.
+ </para>
+ </section>
</section>
+
+
+
<section id="events.system">
<title>JSF system events</title>
<para>
- JSF 2.0 brings along system events and seam-faces provides a CDI bridge which allows you to observe them.
- Since all JSF system event objects are distinct, no qualifiers are needed to observe them, all the CDI bridge
- does it pass them along
+ Similar to JSF Phase Events, System Events take place when specific events occur within the JSF life-cycle. Seam
+ Faces provides a bridge for all JSF System Events, and propagates these events to CDI.
</para>
- <para>
- Here is the complete list of event objects available for observation
- <informaltable>
- <tgroup cols="3">
- <colspec colnum="1" colwidth="3*" />
- <colspec colnum="2" colwidth="1*" />
- <colspec colnum="3" colwidth="4*" />
- <thead>
- <row>
- <entry>Event object</entry>
- <entry>Context</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>SystemEvent</entry>
- <entry>all</entry>
- <entry>All events</entry>
- </row>
- <row>
- <entry>ComponentSystemEvent</entry>
- <entry>component</entry>
- <entry>All component events</entry>
- </row>
- <row>
- <entry>PostAddToViewEvent</entry>
- <entry>component</entry>
- <entry>After a component was added to the view</entry>
- </row>
- <row>
- <entry>PostConstructViewMapEvent</entry>
- <entry>view</entry>
- <entry>After a view map was created</entry>
- </row>
- <row>
- <entry>PostRestoreStateEvent</entry>
- <entry>component</entry>
- <entry>After a component has its state restored</entry>
- </row>
- <row>
- <entry>PostValidateEvent</entry>
- <entry>component</entry>
- <entry>After a component has been validated</entry>
- </row>
- <row>
- <entry>PreDestroyViewMapEvent</entry>
- <entry>view</entry>
- <entry>Before a view map has been restored</entry>
- </row>
- <row>
- <entry>PreRemoveFromViewEvent</entry>
- <entry>component</entry>
- <entry>Before a component has been removed from the view</entry>
- </row>
- <row>
- <entry>PreRenderComponentEvent</entry>
- <entry>component</entry>
- <entry>After a component has been rendered</entry>
- </row>
- <row>
- <entry>PreRenderViewEvent</entry>
- <entry>view</entry>
- <entry>Before a view has been rendered</entry>
- </row>
- <row>
- <entry>PreValidateEvent</entry>
- <entry>component</entry>
- <entry>Before a component has been validated</entry>
- </row>
- <row>
- <entry>ExceptionQueuedEvent</entry>
- <entry>system</entry>
- <entry>When an exception has been queued</entry>
- </row>
- <row>
- <entry>PostConstructApplicationEvent</entry>
- <entry>system</entry>
- <entry>After the application has been constructed</entry>
- </row>
- <row>
- <entry>PostConstructCustomScopeEvent</entry>
- <entry>system</entry>
- <entry>After a custom scope has been constructed</entry>
- </row>
- <row>
- <entry>PreDestroyApplicationEvent</entry>
- <entry>system</entry>
- <entry>Before the application is destroyed</entry>
- </row>
- <row>
- <entry>PreDestroyCustomScopeEvent</entry>
- <entry>system</entry>
- <entry>Before a custom scope is destroyed</entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- Component events can further be qualified with the <literal>@Component</literal> qualifer, which takes the component id
- as the value. The corresponding qualifier for view events is <literal>@View</literal>.
- <programlisting role="Java">
-public void observePrePasswordValidation(@Observes @Component("form:password") PreValidateEvent e)
+
+
+
+
+
+ <section id="events.system.seam">
+ <title>Seam Faces System events</title>
+ <para>
+ This is an example of observing a Faces system event:
+ </para>
+ <para>
+ <programlisting role="Java">
+public void observesThisEvent(@Observes ExceptionQueuedEvent e)
{
- // Do something with the "before password is validated" event object
+ // Do something with the event object
} </programlisting>
- <programlisting role="Java">
-public void observePreFooViewRendered(@Observes @View("/foo.xhtml") PreRenderViewEvent e)
+ </para>
+ </section>
+
+
+
+
+ <section id="events.system.seam.listing">
+ <title>System events listing</title>
+ <para>
+ Since all JSF system event objects are distinct, no qualifiers are needed to observe them. The following events
+ may be observed:
+ <informaltable>
+ <tgroup cols="3">
+ <colspec colnum="1" colwidth="3*" />
+ <colspec colnum="2" colwidth="1*" />
+ <colspec colnum="3" colwidth="4*" />
+ <thead>
+ <row>
+ <entry>Event object</entry>
+ <entry>Context</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>SystemEvent</entry>
+ <entry>all</entry>
+ <entry>All events</entry>
+ </row>
+ <row>
+ <entry>ComponentSystemEvent</entry>
+ <entry>component</entry>
+ <entry>All component events</entry>
+ </row>
+ <row>
+ <entry>PostAddToViewEvent</entry>
+ <entry>component</entry>
+ <entry>After a component was added to the view</entry>
+ </row>
+ <row>
+ <entry>PostConstructViewMapEvent</entry>
+ <entry>component</entry>
+ <entry>After a view map was created</entry>
+ </row>
+ <row>
+ <entry>PostRestoreStateEvent</entry>
+ <entry>component</entry>
+ <entry>After a component has its state restored</entry>
+ </row>
+ <row>
+ <entry>PostValidateEvent</entry>
+ <entry>component</entry>
+ <entry>After a component has been validated</entry>
+ </row>
+ <row>
+ <entry>PreDestroyViewMapEvent</entry>
+ <entry>component</entry>
+ <entry>Before a view map has been restored</entry>
+ </row>
+ <row>
+ <entry>PreRemoveFromViewEvent</entry>
+ <entry>component</entry>
+ <entry>Before a component has been removed from the view</entry>
+ </row>
+ <row>
+ <entry>PreRenderComponentEvent</entry>
+ <entry>component</entry>
+ <entry>After a component has been rendered</entry>
+ </row>
+ <row>
+ <entry>PreRenderViewEvent</entry>
+ <entry>component</entry>
+ <entry>Before a view has been rendered</entry>
+ </row>
+ <row>
+ <entry>PreValidateEvent</entry>
+ <entry>component</entry>
+ <entry>Before a component has been validated</entry>
+ </row>
+ <row>
+ <entry>ExceptionQueuedEvent</entry>
+ <entry>system</entry>
+ <entry>When an exception has been queued</entry>
+ </row>
+ <row>
+ <entry>PostConstructApplicationEvent</entry>
+ <entry>system</entry>
+ <entry>After the application has been constructed</entry>
+ </row>
+ <row>
+ <entry>PostConstructCustomScopeEvent</entry>
+ <entry>system</entry>
+ <entry>After a custom scope has been constructed</entry>
+ </row>
+ <row>
+ <entry>PreDestroyApplicationEvent</entry>
+ <entry>system</entry>
+ <entry>Before the application is destroyed</entry>
+ </row>
+ <row>
+ <entry>PreDestroyCustomScopeEvent</entry>
+ <entry>system</entry>
+ <entry>Before a custom scope is destroyed</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ </section>
+
+
+
+ <section id="events.system.component">
+ <title>Component system events</title>
+ <para>
+ There is one qualifier, <literal>@Component</literal> that can be used with component events by specifying the component ID. Note that
+ view-centric component events <literal>PreRenderViewEvent</literal>, <literal>PostConstructViewMapEvent</literal> and
+ <literal>PreDestroyViewMapEvent</literal> do not fire with the <literal>@Component</literal> qualifier.
+ <programlisting role="Java">
+public void observePrePasswordValidation(@Observes @Component("form:password") PreValidateEvent e)
{
- // Do something with the "before view is rendered" event object
+// Do something with the "before password is validated" event object
} </programlisting>
- Global system events are observer without the component qualifier
- <programlisting role="Java">
+ Global system events are observer without the component qualifier
+ <programlisting role="Java">
public void observeApplicationConstructed(@Observes PostConstructApplicationEvent e)
{
- // Do something with the "after application is constructed" event object
+// Do something with the "after application is constructed" event object
} </programlisting>
- The name of the observing method is insignificant.
- </para>
+ The name of the observing method is not relevant; observers are defined solely via annotations.
+ </para>
+ </section>
+
+
</section>
</chapter>
\ No newline at end of file
Modified: modules/faces/trunk/docs/reference/src/main/docbook/en-US/installation.xml
===================================================================
--- modules/faces/trunk/docs/reference/src/main/docbook/en-US/installation.xml 2010-04-21 16:41:56 UTC (rev 12547)
+++ modules/faces/trunk/docs/reference/src/main/docbook/en-US/installation.xml 2010-04-21 18:32:06 UTC (rev 12548)
@@ -16,6 +16,8 @@
<tip>
<para>Replace ${seam-faces-version} with the most recent or appropriate version of Seam Faces.</para>
</tip>
+
+<!--
<section id="configuration">
<title>Configuration</title>
<para>
@@ -52,10 +54,11 @@
<entry>Conversation Support</entry>
<entry>interceptor</entry>
<entry>org.jboss.seam.faces.context.conversation.ConversationBoundaryInterceptor</entry>
- </row>
+ </row>
</tbody>
</tgroup>
</informaltable>
</para>
</section>
+ -->
</chapter>
\ No newline at end of file
Modified: modules/faces/trunk/examples/short-ly/pom.xml
===================================================================
--- modules/faces/trunk/examples/short-ly/pom.xml 2010-04-21 16:41:56 UTC (rev 12547)
+++ modules/faces/trunk/examples/short-ly/pom.xml 2010-04-21 18:32:06 UTC (rev 12548)
@@ -45,7 +45,7 @@
<dependency>
<groupId>com.ocpsoft</groupId>
<artifactId>ocpsoft-pretty-faces</artifactId>
- <version>2.0.5-SNAPSHOT</version>
+ <version>2.0.4</version>
</dependency>
<dependency>
Modified: modules/faces/trunk/examples/short-ly/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- modules/faces/trunk/examples/short-ly/src/main/webapp/META-INF/MANIFEST.MF 2010-04-21 16:41:56 UTC (rev 12547)
+++ modules/faces/trunk/examples/short-ly/src/main/webapp/META-INF/MANIFEST.MF 2010-04-21 18:32:06 UTC (rev 12548)
@@ -1,3 +1,2 @@
Manifest-Version: 1.0
-Class-Path:
16 years
Seam SVN: r12547 - in modules/drools/trunk/impl/src: main/java/org/jboss/seam/drools/interceptor and 5 other directories.
by seam-commits@lists.jboss.org
Author: tsurdilovic
Date: 2010-04-21 12:41:56 -0400 (Wed, 21 Apr 2010)
New Revision: 12547
Added:
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/InsertFactInterceptor.java
Removed:
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/InsertInterceptor.java
modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/insertion/
Modified:
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/InsertFact.java
modules/drools/trunk/impl/src/main/resources/META-INF/beans.xml
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/flow/FlowTest.java
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/ksession/KSessionTest.java
modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/ksession/KSessionTest-beans.xml
Log:
insertfact interceptor.
Modified: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/InsertFact.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/InsertFact.java 2010-04-21 16:34:34 UTC (rev 12546)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/InsertFact.java 2010-04-21 16:41:56 UTC (rev 12547)
@@ -26,7 +26,6 @@
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Documented;
-import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
@@ -34,7 +33,7 @@
import javax.interceptor.InterceptorBinding;
/**
- * Insert fact into WM or EntryPoint. Also determine firing rules decisions.
+ * Interceptor binding for inserting facts into the KnowledgeSession.
*
* @author Tihomir Surdilovic
*/
@@ -42,21 +41,8 @@
@Target( { TYPE, METHOD })
@Documented
@Retention(RUNTIME)
-@Inherited
public @interface InsertFact
{
- @Nonbinding
- int ksessionId() default -1;
-
- @Nonbinding
- boolean fireAllRules() default false;
-
- @Nonbinding
- int fireCount() default -1;
-
- @Nonbinding
- boolean fireUntilHalt() default false;
-
- @Nonbinding
- String entryPointName() default "";
+ @Nonbinding boolean fire() default false;
+ @Nonbinding String entrypoint() default "";
}
Copied: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/InsertFactInterceptor.java (from rev 12499, modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/InsertInterceptor.java)
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/InsertFactInterceptor.java (rev 0)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/InsertFactInterceptor.java 2010-04-21 16:41:56 UTC (rev 12547)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.drools.interceptor;
+
+import java.lang.annotation.Annotation;
+
+import javax.enterprise.inject.spi.BeanManager;
+import javax.inject.Inject;
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+
+import org.jboss.seam.drools.annotations.InsertFact;
+
+@InsertFact
+@Interceptor
+public class InsertFactInterceptor
+{
+ @Inject
+ BeanManager manager;
+
+ @AroundInvoke
+ public Object insertFact(InvocationContext ctx) throws Exception
+ {
+ System.out.println("*******\n\nIN INTERCEPTOR! \n\n ********");
+ Annotation[] methodAnnotations = ctx.getMethod().getAnnotations();
+ for(Annotation nextAnnotation : methodAnnotations) {
+ if(manager.isQualifier(nextAnnotation.getClass())) {
+ System.out.println("**************** \n\n\nNEXT QUALIFIER: " + nextAnnotation);
+ }
+ if(manager.isInterceptorBinding(nextAnnotation.getClass())) {
+ System.out.println("**************** \n\n\n\n NEXT INTERCEPTOR BINDING: " + nextAnnotation);
+ }
+ }
+
+ return ctx.proceed();
+ }
+}
Deleted: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/InsertInterceptor.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/InsertInterceptor.java 2010-04-21 16:34:34 UTC (rev 12546)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/InsertInterceptor.java 2010-04-21 16:41:56 UTC (rev 12547)
@@ -1,42 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.seam.drools.interceptor;
-
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.Interceptor;
-import javax.interceptor.InvocationContext;
-
-import org.jboss.seam.drools.annotations.InsertFact;
-
-@InsertFact
-@Interceptor
-public class InsertInterceptor
-{
- @AroundInvoke
- public Object manageTransaction(InvocationContext ctx) throws Exception
- {
- InsertFact insertFactAnnotation = ctx.getMethod().getAnnotation(InsertFact.class);
- System.out.println("ksession id: " + insertFactAnnotation.ksessionId());
-
- return ctx.proceed();
- }
-}
Modified: modules/drools/trunk/impl/src/main/resources/META-INF/beans.xml
===================================================================
--- modules/drools/trunk/impl/src/main/resources/META-INF/beans.xml 2010-04-21 16:34:34 UTC (rev 12546)
+++ modules/drools/trunk/impl/src/main/resources/META-INF/beans.xml 2010-04-21 16:41:56 UTC (rev 12547)
@@ -331,4 +331,9 @@
</d:RuleResources>
</s:parameters>
</d:DroolsConfig>
+
+
+ <interceptors>
+ <class>org.jboss.seam.drools.interceptor.InsertFactInterceptor</class>
+ </interceptors>
</beans>
\ No newline at end of file
Modified: modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/flow/FlowTest.java
===================================================================
--- modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/flow/FlowTest.java 2010-04-21 16:34:34 UTC (rev 12546)
+++ modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/flow/FlowTest.java 2010-04-21 16:41:56 UTC (rev 12547)
@@ -76,7 +76,7 @@
ksession.fireAllRules();
assertTrue( ((ArrayList<String>) ksession.getGlobal("errors")).size() == 1 );
- assertTrue(((ArrayList<String>) ksession.getGlobal("errors")).get(0).equals("You must enter a Telephone Number"));
+ assertTrue( ((ArrayList<String>) ksession.getGlobal("errors")).get(0).equals("You must enter a Telephone Number") );
}
Modified: modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/ksession/KSessionTest.java
===================================================================
--- modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/ksession/KSessionTest.java 2010-04-21 16:34:34 UTC (rev 12546)
+++ modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/ksession/KSessionTest.java 2010-04-21 16:41:56 UTC (rev 12547)
@@ -33,6 +33,7 @@
import org.jboss.arquillian.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.seam.drools.KnowledgeBaseProducer;
+import org.jboss.seam.drools.annotations.InsertFact;
import org.jboss.seam.drools.qualifiers.config.DefaultConfig;
import org.jboss.seam.drools.qualifiers.config.MVELDialectConfig;
import org.jboss.shrinkwrap.api.ArchivePaths;
@@ -76,5 +77,11 @@
assertNotSame(ksession, mvelksession);
assertSame(mvelksession, mvelksession2);
+ doSomething();
}
+
+ @InsertFact @Default @DefaultConfig
+ public void doSomething() {
+
+ }
}
Modified: modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/ksession/KSessionTest-beans.xml
===================================================================
--- modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/ksession/KSessionTest-beans.xml 2010-04-21 16:34:34 UTC (rev 12546)
+++ modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/ksession/KSessionTest-beans.xml 2010-04-21 16:41:56 UTC (rev 12547)
@@ -37,5 +37,4 @@
<s:value>classpath;ksessiontest.drl;DRL</s:value>
</d:resources>
</d:MVELDialectRuleResources>
-
</beans>
16 years
Seam SVN: r12546 - in modules/drools/trunk: api and 1 other directories.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-04-21 12:34:34 -0400 (Wed, 21 Apr 2010)
New Revision: 12546
Modified:
modules/drools/trunk/
modules/drools/trunk/api/
modules/drools/trunk/impl/
Log:
ignores
Property changes on: modules/drools/trunk
___________________________________________________________________
Name: svn:ignore
+
.project
.settings
Property changes on: modules/drools/trunk/api
___________________________________________________________________
Name: svn:ignore
- .classpath
.settings
.project
+
.classpath
.project
.settings
target
Property changes on: modules/drools/trunk/impl
___________________________________________________________________
Name: svn:ignore
- .classpath
.project
.settings
+
.classpath
.project
.settings
target
16 years
Seam SVN: r12545 - in modules/drools/trunk: docs and 1 other directories.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-04-21 12:31:46 -0400 (Wed, 21 Apr 2010)
New Revision: 12545
Modified:
modules/drools/trunk/api/
modules/drools/trunk/docs/
modules/drools/trunk/impl/
Log:
ignores
Property changes on: modules/drools/trunk/api
___________________________________________________________________
Name: svn:ignore
+ .classpath
.settings
.project
Property changes on: modules/drools/trunk/docs
___________________________________________________________________
Name: svn:ignore
+ .settings
drools-reference.pdf
target
.classpath
.project
Property changes on: modules/drools/trunk/impl
___________________________________________________________________
Name: svn:ignore
+ .classpath
.project
.settings
16 years
Seam SVN: r12544 - modules/drools/trunk.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-04-21 12:31:16 -0400 (Wed, 21 Apr 2010)
New Revision: 12544
Modified:
modules/drools/trunk/pom.xml
Log:
switch to seam parent
Modified: modules/drools/trunk/pom.xml
===================================================================
--- modules/drools/trunk/pom.xml 2010-04-21 16:17:01 UTC (rev 12543)
+++ modules/drools/trunk/pom.xml 2010-04-21 16:31:16 UTC (rev 12544)
@@ -3,9 +3,9 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>weld-parent</artifactId>
- <groupId>org.jboss.weld</groupId>
- <version>8</version>
+ <artifactId>seam-parent</artifactId>
+ <groupId>org.jboss.seam</groupId>
+ <version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.seam.drools</groupId>
16 years
Seam SVN: r12543 - build/trunk.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-04-21 12:17:01 -0400 (Wed, 21 Apr 2010)
New Revision: 12543
Modified:
build/trunk/checkout.sh
Log:
add jms wicket and servlet modules to checkout
Modified: build/trunk/checkout.sh
===================================================================
--- build/trunk/checkout.sh 2010-04-21 16:15:10 UTC (rev 12542)
+++ build/trunk/checkout.sh 2010-04-21 16:17:01 UTC (rev 12543)
@@ -86,7 +86,7 @@
SVNARGS=
SVNUPDATE=1
-MODULES="remoting drools faces international persistence security xml"
+MODULES="remoting drools faces international persistence security xml jms wicket servlet"
while getopts “hrd:v” OPTION
do
16 years
Seam SVN: r12541 - modules/jms/trunk.
by seam-commits@lists.jboss.org
Author: jganoff
Date: 2010-04-20 21:22:20 -0400 (Tue, 20 Apr 2010)
New Revision: 12541
Modified:
modules/jms/trunk/pom.xml
Log:
distribution project built from parent pom only when 'distribution' profile is active
Modified: modules/jms/trunk/pom.xml
===================================================================
--- modules/jms/trunk/pom.xml 2010-04-21 01:06:48 UTC (rev 12540)
+++ modules/jms/trunk/pom.xml 2010-04-21 01:22:20 UTC (rev 12541)
@@ -26,9 +26,18 @@
<!--
<module>examples</module>
-->
- <module>dist</module>
</modules>
+ <!-- Only build the distribution if requested explicitly -->
+ <profiles>
+ <profile>
+ <id>distribution</id>
+ <modules>
+ <module>dist</module>
+ </modules>
+ </profile>
+ </profiles>
+
<developers>
<developer>
<name>Jordan Ganoff</name>
16 years