Seam SVN: r13786 - in branches/enterprise/JBPAPP_5_0: ui/src/main/config/component and 1 other directories.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-09-30 04:27:00 -0400 (Thu, 30 Sep 2010)
New Revision: 13786
Modified:
branches/enterprise/JBPAPP_5_0/examples/ui/view/graphicImage.xhtml
branches/enterprise/JBPAPP_5_0/ui/src/main/config/component/graphicImage.xml
branches/enterprise/JBPAPP_5_0/ui/src/main/java/org/jboss/seam/ui/graphicImage/GraphicImageRendererBase.java
branches/enterprise/JBPAPP_5_0/ui/src/main/java/org/jboss/seam/ui/graphicImage/UIGraphicImage.java
Log:
JBPAPP-4771
Modified: branches/enterprise/JBPAPP_5_0/examples/ui/view/graphicImage.xhtml
===================================================================
--- branches/enterprise/JBPAPP_5_0/examples/ui/view/graphicImage.xhtml 2010-09-29 13:01:01 UTC (rev 13785)
+++ branches/enterprise/JBPAPP_5_0/examples/ui/view/graphicImage.xhtml 2010-09-30 08:27:00 UTC (rev 13786)
@@ -11,7 +11,7 @@
<p>Outputs an image</p>
<h:panelGrid>
<s:fragment>
- <s:graphicImage value="#{person.picture.data}">
+ <s:graphicImage value="#{person.picture.data}" cache="true" cacheKey="id-0.5">
<s:transformImageSize factor="0.5" />
</s:graphicImage>
<h:outputText value="No image found (upload one)" rendered="#{person.picture.contentType eq null}" />
Modified: branches/enterprise/JBPAPP_5_0/ui/src/main/config/component/graphicImage.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/ui/src/main/config/component/graphicImage.xml 2010-09-29 13:01:01 UTC (rev 13785)
+++ branches/enterprise/JBPAPP_5_0/ui/src/main/config/component/graphicImage.xml 2010-09-30 08:27:00 UTC (rev 13786)
@@ -29,5 +29,20 @@
<classname>java.lang.String</classname>
<description>File name for the generated URL - allows a stable file name and thus browser caching</description>
</property>
+ <property>
+ <name>cache</name>
+ <classname>boolean</classname>
+ <description>True if this image should be cached</description>
+ </property>
+ <property>
+ <name>cacheKey</name>
+ <classname>java.lang.String</classname>
+ <description>Unique string for a cached image</description>
+ </property>
+ <property>
+ <name>invalidate</name>
+ <classname>boolean</classname>
+ <description>if property resolves to true, current cached key will be removed</description>
+ </property>
</component>
</components>
Modified: branches/enterprise/JBPAPP_5_0/ui/src/main/java/org/jboss/seam/ui/graphicImage/GraphicImageRendererBase.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/ui/src/main/java/org/jboss/seam/ui/graphicImage/GraphicImageRendererBase.java 2010-09-29 13:01:01 UTC (rev 13785)
+++ branches/enterprise/JBPAPP_5_0/ui/src/main/java/org/jboss/seam/ui/graphicImage/GraphicImageRendererBase.java 2010-09-30 08:27:00 UTC (rev 13786)
@@ -6,43 +6,64 @@
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
+import org.jboss.seam.cache.CacheProvider;
import org.jboss.seam.ui.graphicImage.GraphicImageStore.ImageWrapper;
import org.jboss.seam.ui.util.HTML;
import org.jboss.seam.ui.util.cdk.RendererBase;
public class GraphicImageRendererBase extends RendererBase
{
-
+
@Override
protected Class getComponentClass()
{
return UIGraphicImage.class;
}
-
+
@Override
protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException
{
UIGraphicImage graphicImage = (UIGraphicImage) component;
-
+
+ CacheProvider cacheProvider = CacheProvider.instance();
+
String key = graphicImage.getFileName();
String extension = null;
+ ImageWrapper wrapper = null;
+
Image image = Image.instance();
- image.setInput(graphicImage.getValue());
-
- // Do transforms
-
- for (UIComponent cmp : graphicImage.getChildren())
+
+ if (graphicImage.isInvalidate())
+ cacheProvider.remove(graphicImage.getCacheKey());
+
+ if (graphicImage.isCache() && cacheProvider.get(graphicImage.getCacheKey()) != null)
{
- if (cmp instanceof ImageTransform)
+ wrapper = (ImageWrapper) cacheProvider.get(graphicImage.getCacheKey());
+ }
+ else
+ {
+
+ image.setInput(graphicImage.getValue());
+
+ // Do transforms
+
+ for (UIComponent cmp : graphicImage.getChildren())
{
- ImageTransform imageTransform = (ImageTransform) cmp;
- imageTransform.applyTransform(image);
+ if (cmp instanceof ImageTransform)
+ {
+ ImageTransform imageTransform = (ImageTransform) cmp;
+ imageTransform.applyTransform(image);
+ }
}
+
+ wrapper = new ImageWrapper(image.getImage(), image.getContentType());
+
+ if(graphicImage.isCache())
+ cacheProvider.put(graphicImage.getCacheKey(), wrapper);
}
- key = GraphicImageStore.instance().put(new ImageWrapper(image.getImage(), image.getContentType()),
- key);
+ key = GraphicImageStore.instance().put(wrapper, key);
extension = image.getContentType().getExtension();
writer.startElement(HTML.IMG_ELEM, graphicImage);
@@ -50,14 +71,13 @@
{
writer.writeAttribute(HTML.ID_ATTR, graphicImage.getClientId(context), HTML.ID_ATTR);
}
-
- String url = context.getExternalContext().getRequestContextPath()
- + GraphicImageResource.GRAPHIC_IMAGE_RESOURCE_PATH + "/" + key + extension;
+
+ String url = context.getExternalContext().getRequestContextPath() + GraphicImageResource.GRAPHIC_IMAGE_RESOURCE_PATH + "/" + key + extension;
writer.writeAttribute(HTML.SRC_ATTR, url, HTML.SRC_ATTR);
HTML.renderHTMLAttributes(writer, component, HTML.IMG_PASSTHROUGH_ATTRIBUTES);
writer.endElement(HTML.IMG_ELEM);
}
-
+
@Override
public boolean getRendersChildren()
{
Modified: branches/enterprise/JBPAPP_5_0/ui/src/main/java/org/jboss/seam/ui/graphicImage/UIGraphicImage.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/ui/src/main/java/org/jboss/seam/ui/graphicImage/UIGraphicImage.java 2010-09-29 13:01:01 UTC (rev 13785)
+++ branches/enterprise/JBPAPP_5_0/ui/src/main/java/org/jboss/seam/ui/graphicImage/UIGraphicImage.java 2010-09-30 08:27:00 UTC (rev 13786)
@@ -2,15 +2,24 @@
import javax.faces.component.html.HtmlGraphicImage;
-public abstract class UIGraphicImage extends HtmlGraphicImage
-{
+public abstract class UIGraphicImage extends HtmlGraphicImage {
- public static final String FAMILY = "org.jboss.seam.ui.UIGraphicImage";
+ public static final String FAMILY = "org.jboss.seam.ui.UIGraphicImage";
- public abstract String getFileName();
+ public abstract String getFileName();
- public abstract void setFileName(String fileName);
-
-
+ public abstract void setFileName(String fileName);
+ public abstract boolean isCache();
+
+ public abstract void setCache(boolean cache);
+
+ public abstract String getCacheKey();
+
+ public abstract void setCacheKey(String cacheKey);
+
+ public abstract boolean isInvalidate();
+
+ public abstract void setInvalidate(boolean invalidate);
+
}
14 years, 3 months
Seam SVN: r13785 - branches/enterprise/JBPAPP_5_0/examples/seampay/src/org/jboss/seam/example/seampay/test.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-09-29 09:01:01 -0400 (Wed, 29 Sep 2010)
New Revision: 13785
Modified:
branches/enterprise/JBPAPP_5_0/examples/seampay/src/org/jboss/seam/example/seampay/test/PaymentProcessorTest.java
Log:
extended the delay to 1 second between payments JBPAPP-3195, JBPAPP-5013
Modified: branches/enterprise/JBPAPP_5_0/examples/seampay/src/org/jboss/seam/example/seampay/test/PaymentProcessorTest.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/examples/seampay/src/org/jboss/seam/example/seampay/test/PaymentProcessorTest.java 2010-09-29 12:56:22 UTC (rev 13784)
+++ branches/enterprise/JBPAPP_5_0/examples/seampay/src/org/jboss/seam/example/seampay/test/PaymentProcessorTest.java 2010-09-29 13:01:01 UTC (rev 13785)
@@ -74,7 +74,7 @@
private void pause() {
try {
- Thread.sleep(1);
+ Thread.sleep(1000); // extended the delay between payments JBPAPP-3195, JBPAPP-5013
} catch (InterruptedException e) {
}
14 years, 3 months
Seam SVN: r13784 - branches/enterprise/JBPAPP_4_3_FP01/examples/seampay/src/org/jboss/seam/example/seampay/test.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-09-29 08:56:22 -0400 (Wed, 29 Sep 2010)
New Revision: 13784
Modified:
branches/enterprise/JBPAPP_4_3_FP01/examples/seampay/src/org/jboss/seam/example/seampay/test/PaymentProcessorTest.java
Log:
JBPAPP-3195 - extended delay between 2 payments
Modified: branches/enterprise/JBPAPP_4_3_FP01/examples/seampay/src/org/jboss/seam/example/seampay/test/PaymentProcessorTest.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/examples/seampay/src/org/jboss/seam/example/seampay/test/PaymentProcessorTest.java 2010-09-28 15:05:27 UTC (rev 13783)
+++ branches/enterprise/JBPAPP_4_3_FP01/examples/seampay/src/org/jboss/seam/example/seampay/test/PaymentProcessorTest.java 2010-09-29 12:56:22 UTC (rev 13784)
@@ -74,7 +74,7 @@
private void pause() {
try {
- Thread.sleep(1);
+ Thread.sleep(1000); // extended the delay between payments JBPAPP-3195
} catch (InterruptedException e) {
}
14 years, 3 months
Seam SVN: r13783 - in modules/drools/trunk: api/src/main/java/org/jboss/seam/drools/config and 34 other directories.
by seam-commits@lists.jboss.org
Author: tsurdilovic
Date: 2010-09-28 11:05:27 -0400 (Tue, 28 Sep 2010)
New Revision: 13783
Added:
modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/qualifiers/Persisted.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/After.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Before.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Coincides.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/During.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Event.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/EventProducer.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/FinishedBy.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Finishes.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Includes.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Max.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Meets.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/MetBy.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Min.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/OverWindowLength.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/OverWindowTime.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/OverlappedBy.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Overlaps.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/StartedBy.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Starts.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/util/
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/util/DeclaredType.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/util/DroolsExtensionUtils.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/util/LHSTemplates.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/util/Role.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/util/Rule.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/util/RuleBuilder.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/cep/
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/cep/EventInterceptor.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/flow/AbortProcessInterceptor.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/flow/SignalEventInterceptor.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/flow/StartProcessInterceptor.java
modules/drools/trunk/impl/src/main/resources/org/
modules/drools/trunk/impl/src/main/resources/org/jboss/
modules/drools/trunk/impl/src/main/resources/org/jboss/seam/
modules/drools/trunk/impl/src/main/resources/org/jboss/seam/drools/
modules/drools/trunk/impl/src/main/resources/org/jboss/seam/drools/cepvalidation/
modules/drools/trunk/impl/src/main/resources/org/jboss/seam/drools/cepvalidation/templates/
modules/drools/trunk/impl/src/main/resources/org/jboss/seam/drools/cepvalidation/templates/declaredtypes.st
modules/drools/trunk/impl/src/main/resources/org/jboss/seam/drools/cepvalidation/templates/drl.st
modules/drools/trunk/impl/src/main/resources/org/jboss/seam/drools/cepvalidation/templates/imports.st
modules/drools/trunk/impl/src/main/resources/org/jboss/seam/drools/cepvalidation/templates/pattern.st
modules/drools/trunk/impl/src/main/resources/org/jboss/seam/drools/cepvalidation/templates/rules.st
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/cepalerting/
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/cepalerting/AlertingBean.java
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/cepalerting/CepAlertingTest.java
modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/cepalerting/
modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/cepalerting/CepAlertingTest-beans.xml
Removed:
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/AbortProcessInterceptor.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/SignalEventInterceptor.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/StartProcessInterceptor.java
Modified:
modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/config/Drools.java
modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/config/DroolsProperty.java
modules/drools/trunk/impl/pom.xml
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/EntryPointProducer.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/ExecutionResultsProducer.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeAgentProducer.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeBaseProducer.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeLoggerProducer.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeSessionProducer.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/QueryResultsProducer.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/SessionReportProducer.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/DroolsExtension.java
modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/configutil/DroolsConfigUtil.java
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/cep/CEPTest.java
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/channel/ChannelTest.java
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/customoperator/CustomOperatorTest.java
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/delegate/DelegateTest.java
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/interceptors/InterceptorsTest.java
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kagent/KAgentTest.java
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kbase/KBaseTest.java
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/query/QueryTest.java
modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/sessionreport/SessionReportTest.java
modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/interceptors/InterceptorsTest-beans.xml
modules/drools/trunk/pom.xml
Log:
for stuart to test, now using latest weld
Modified: modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/config/Drools.java
===================================================================
--- modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/config/Drools.java 2010-09-27 15:28:45 UTC (rev 13782)
+++ modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/config/Drools.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -48,7 +48,7 @@
public String kbaseConfigFile() default "";
public String ksessionConfigFile() default "";
public String kagentConfigFile() default "";
- public String envConfigFile() default "";
+ public String serializationSigningConfigFile() default "";
public boolean startChangeNotifierService() default false;
public boolean startChangeScannerService() default false;
@@ -69,7 +69,7 @@
public DroolsProperty[] ksessionProperties() default {};
public DroolsProperty[] kagentPropertiest() default {};
-
- public DroolsProperty[] envProperties() default {};
+ public DroolsProperty[] serializationSigningProperties() default {};
+
}
Modified: modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/config/DroolsProperty.java
===================================================================
--- modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/config/DroolsProperty.java 2010-09-27 15:28:45 UTC (rev 13782)
+++ modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/config/DroolsProperty.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -37,4 +37,5 @@
String value();
String name();
+
}
Added: modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/qualifiers/Persisted.java
===================================================================
--- modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/qualifiers/Persisted.java (rev 0)
+++ modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/qualifiers/Persisted.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,48 @@
+/*
+ * 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.qualifiers;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+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;
+
+import javax.inject.Qualifier;
+
+/**
+ *
+ * @author Tihomir Surdilovic
+ */
+@Qualifier
+@Target( { TYPE, METHOD, FIELD, PARAMETER })
+@Documented
+@Retention(RUNTIME)
+@Inherited
+public @interface Persisted {
+
+}
Property changes on: modules/drools/trunk/api/src/main/java/org/jboss/seam/drools/qualifiers/Persisted.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: modules/drools/trunk/impl/pom.xml
===================================================================
--- modules/drools/trunk/impl/pom.xml 2010-09-27 15:28:45 UTC (rev 13782)
+++ modules/drools/trunk/impl/pom.xml 2010-09-28 15:05:27 UTC (rev 13783)
@@ -17,6 +17,11 @@
<dependencies>
<dependency>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-core</artifactId>
+ <version>${weld.version}</version>
+ </dependency>
+ <dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
</dependency>
@@ -71,73 +76,98 @@
<groupId>org.jboss.weld</groupId>
<artifactId>weld-extensions</artifactId>
</dependency>
-
<dependency>
+ <groupId>antlr</groupId>
+ <artifactId>antlr</artifactId>
+ <version>${antlr.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>antlr</groupId>
+ <artifactId>stringtemplate</artifactId>
+ <version>${stringtemplate.version}</version>
+ </dependency>
+ <dependency>
<artifactId>seam-drools-api</artifactId>
<groupId>org.jboss.seam.drools</groupId>
<scope>compile</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging</artifactId>
+ <version>3.0.0.Beta4</version>
+ <scope>provided</scope>
+ </dependency>
<!-- Test Dependencies -->
<dependency>
<groupId>org.jboss.seam.xml</groupId>
<artifactId>seam-xml-config</artifactId>
<scope>test</scope>
- <version>3.0.0-SNAPSHOT</version>
</dependency>
<dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- <scope>test</scope>
- </dependency>
- <!-- Test Dependencies -->
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.jboss.arquillian</groupId>
- <artifactId>arquillian-junit</artifactId>
- <scope>test</scope>
- </dependency>
+ <groupId>org.jboss.arquillian</groupId>
+ <artifactId>arquillian-junit</artifactId>
+ <version>${arquillian.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.arquillian.container</groupId>
+ <artifactId>arquillian-weld-se-embedded-1.1</artifactId>
+ <version>${arquillian.version}</version>
+ <scope>test</scope>
+ </dependency>
+
<dependency>
- <groupId>org.jboss.arquillian.container</groupId>
- <artifactId>arquillian-weld-embedded</artifactId>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-core</artifactId>
+ <version>${weld.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.jboss.weld</groupId>
- <artifactId>weld-core</artifactId>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging</artifactId>
+ <version>3.0.0.Beta4</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <profiles>
- <profile>
- <id>code-coverage</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>emma-maven-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.sonatype.maven.plugin</groupId>
- <artifactId>emma4it-maven-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
+ </dependencies>
+ <profiles>
+ <profile>
+ <id>code-coverage</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>emma-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.sonatype.maven.plugin</groupId>
+ <artifactId>emma4it-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
</project>
Modified: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/EntryPointProducer.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/EntryPointProducer.java 2010-09-27 15:28:45 UTC (rev 13782)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/EntryPointProducer.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -46,18 +46,18 @@
*/
@Veto
@SessionScoped
-(a)Generic(Drools.class)
+//(a)Generic(Drools.class)
public class EntryPointProducer implements Serializable
{
private static final Logger log = LoggerFactory.getLogger(EntryPointProducer.class);
@Inject
- @GenericProduct
+ //@GenericProduct
StatefulKnowledgeSession statefullKsession;
@Inject
@Scanned
- @GenericProduct
+ //@GenericProduct
StatefulKnowledgeSession statefulKnowledgeSession;
@Produces
Modified: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/ExecutionResultsProducer.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/ExecutionResultsProducer.java 2010-09-27 15:28:45 UTC (rev 13782)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/ExecutionResultsProducer.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -64,7 +64,7 @@
*/
@Veto
@Dependent
-(a)Generic(Drools.class)
+//(a)Generic(Drools.class)
public class ExecutionResultsProducer implements Serializable
{
private static final Logger log = LoggerFactory.getLogger(ExecutionResultsProducer.class);
@@ -77,12 +77,12 @@
@Inject
@Default
- @GenericProduct
+ //@GenericProduct
StatelessKnowledgeSession statelessKsession;
@Inject
@Scanned
- @GenericProduct
+ //@GenericProduct
StatelessKnowledgeSession scannedStatelessKsession;
@Inject
@@ -91,7 +91,7 @@
@Inject
@Scanned
- @GenericProduct
+ //@GenericProduct
StatefulKnowledgeSession scannedStatefullKSession;
@SuppressWarnings("unchecked")
Modified: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeAgentProducer.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeAgentProducer.java 2010-09-27 15:28:45 UTC (rev 13782)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeAgentProducer.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -41,6 +41,7 @@
import org.jboss.seam.drools.configutil.DroolsConfigUtil;
import org.jboss.seam.drools.qualifiers.Scanned;
import org.jboss.weld.extensions.bean.generic.Generic;
+import org.jboss.weld.extensions.bean.generic.GenericBean;
import org.jboss.weld.extensions.bean.generic.GenericProduct;
import org.jboss.weld.extensions.core.Veto;
import org.jboss.weld.extensions.resourceLoader.ResourceProvider;
@@ -54,7 +55,7 @@
*/
@Veto
@Dependent
-(a)Generic(Drools.class)
+//(a)Generic(Drools.class)
public class KnowledgeAgentProducer implements Serializable
{
private static final Logger log = LoggerFactory.getLogger(KnowledgeAgentProducer.class);
@@ -69,11 +70,11 @@
Drools config;
@Inject
- @GenericProduct
+ //@GenericBean
DroolsConfigUtil configUtils;
@Inject
- @GenericProduct
+ //@GenericProduct
RuleResources ruleResources;
@Produces
Modified: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeBaseProducer.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeBaseProducer.java 2010-09-27 15:28:45 UTC (rev 13782)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeBaseProducer.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -85,6 +85,7 @@
DroolsExtension droolsExtension;
@Inject
+ @GenericBean
Drools drools;
@Inject
Modified: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeLoggerProducer.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeLoggerProducer.java 2010-09-27 15:28:45 UTC (rev 13782)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeLoggerProducer.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -37,7 +37,9 @@
import org.jboss.seam.drools.configutil.DroolsConfigUtil;
import org.jboss.seam.drools.qualifiers.Scanned;
import org.jboss.weld.extensions.bean.generic.Generic;
+import org.jboss.weld.extensions.bean.generic.GenericBean;
import org.jboss.weld.extensions.bean.generic.GenericProduct;
+import org.jboss.weld.extensions.core.Veto;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -46,8 +48,9 @@
*
* @author Tihomir Surdilovic
*/
+@Veto
@Dependent
-(a)Generic(Drools.class)
+//(a)Generic(Drools.class)
public class KnowledgeLoggerProducer implements Serializable
{
private static final Logger log = LoggerFactory.getLogger(KnowledgeLoggerProducer.class);
@@ -56,19 +59,20 @@
Drools config;
@Inject
+ //@GenericBean
DroolsConfigUtil configUtils;
@Inject
- @GenericProduct
+ //@GenericProduct
StatefulKnowledgeSession statefullKsession;
@Inject
@Scanned
- @GenericProduct
+ //@GenericBean
StatefulKnowledgeSession scannedStatefullKsession;
@Inject
- @GenericProduct
+ @GenericBean
StatelessKnowledgeSession statelessKsession;
@Inject
Modified: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeSessionProducer.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeSessionProducer.java 2010-09-27 15:28:45 UTC (rev 13782)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/KnowledgeSessionProducer.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -44,10 +44,12 @@
import org.jboss.seam.drools.bootstrap.DroolsExtension;
import org.jboss.seam.drools.config.Drools;
import org.jboss.seam.drools.configutil.DroolsConfigUtil;
+import org.jboss.seam.drools.qualifiers.Persisted;
import org.jboss.seam.drools.qualifiers.Scanned;
import org.jboss.weld.extensions.bean.generic.Generic;
import org.jboss.weld.extensions.bean.generic.GenericBean;
import org.jboss.weld.extensions.bean.generic.GenericProduct;
+import org.jboss.weld.extensions.core.Veto;
import org.jboss.weld.extensions.resourceLoader.ResourceProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -56,8 +58,9 @@
*
* @author Tihomir Surdilovic
*/
+@Veto
@Dependent
-(a)Generic(Drools.class)
+//(a)Generic(Drools.class)
public class KnowledgeSessionProducer implements Serializable
{
private static final Logger log = LoggerFactory.getLogger(KnowledgeSessionProducer.class);
@@ -75,27 +78,28 @@
SeamDelegate delegate;
@Inject
- Drools config;
+ Drools drools;
@Inject
+ //@GenericBean
DroolsConfigUtil configUtils;
@Inject
- @GenericBean
+ //@GenericBean
KnowledgeBase kbase;
@Inject
@Scanned
- @GenericBean
+ //@GenericBean
KnowledgeBase scannedKbase;
@Produces
@Default
- @RequestScoped
+ @SessionScoped
public StatefulKnowledgeSession produceStatefulSession() throws Exception
{
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession(configUtils.getKnowledgeSessionConfiguration(), null);
- if (!config.disableSeamDelegate())
+ if (!drools.disableSeamDelegate())
{
addSeamDelegate(ksession);
}
@@ -106,15 +110,24 @@
return ksession;
}
+
+ @Produces
+ @Persisted
+ @SessionScoped
+ public StatefulKnowledgeSession producePersistedStatefulKnowledgeSession() throws Exception
+ {
+ // TODO finish this
+ return null;
+ }
@Produces
@Scanned
- @RequestScoped
+ @SessionScoped
public StatefulKnowledgeSession produceScannedStatefulSession() throws Exception
{
StatefulKnowledgeSession ksession = scannedKbase.newStatefulKnowledgeSession(configUtils.getKnowledgeSessionConfiguration(), null);
- if (!config.disableSeamDelegate())
+ if (!drools.disableSeamDelegate())
{
addSeamDelegate(ksession);
}
@@ -132,7 +145,7 @@
public StatelessKnowledgeSession produceScannedStatelessSession() throws Exception
{
StatelessKnowledgeSession ksession = scannedKbase.newStatelessKnowledgeSession(configUtils.getKnowledgeSessionConfiguration());
- if (!config.disableSeamDelegate())
+ if (!drools.disableSeamDelegate())
{
addSeamDelegate(ksession);
}
@@ -147,7 +160,7 @@
public StatelessKnowledgeSession produceStatelessSession() throws Exception
{
StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession(configUtils.getKnowledgeSessionConfiguration());
- if (!config.disableSeamDelegate())
+ if (!drools.disableSeamDelegate())
{
addSeamDelegate(ksession);
}
@@ -155,6 +168,8 @@
return ksession;
}
+
+
public void disposeStatefulSession( /** @Disposes @Default **/ StatefulKnowledgeSession session)
{
Modified: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/QueryResultsProducer.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/QueryResultsProducer.java 2010-09-27 15:28:45 UTC (rev 13782)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/QueryResultsProducer.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -37,6 +37,7 @@
import org.jboss.seam.drools.qualifiers.Scanned;
import org.jboss.weld.extensions.bean.generic.Generic;
import org.jboss.weld.extensions.bean.generic.GenericProduct;
+import org.jboss.weld.extensions.core.Veto;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -44,19 +45,20 @@
*
* @author Tihomir Surdilovic
*/
+@Veto
@Dependent
-(a)Generic(Drools.class)
+//(a)Generic(Drools.class)
public class QueryResultsProducer implements Serializable
{
private static final Logger log = LoggerFactory.getLogger(QueryResultsProducer.class);
@Inject
- @GenericProduct
+ //@GenericProduct
StatefulKnowledgeSession statefullKsession;
@Inject
@Scanned
- @GenericProduct
+ //@GenericProduct
StatefulKnowledgeSession scannedStatefullKsession;
@Produces
Modified: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/SessionReportProducer.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/SessionReportProducer.java 2010-09-27 15:28:45 UTC (rev 13782)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/SessionReportProducer.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -42,24 +42,26 @@
import org.jboss.seam.drools.qualifiers.SessionReport;
import org.jboss.weld.extensions.bean.generic.Generic;
import org.jboss.weld.extensions.bean.generic.GenericProduct;
+import org.jboss.weld.extensions.core.Veto;
/**
*
* @author Tihomir Surdilovic
*/
+@Veto
@Dependent
-(a)Generic(Drools.class)
+//(a)Generic(Drools.class)
public class SessionReportProducer implements Serializable
{
private static final Logger log = LoggerFactory.getLogger(SessionReportProducer.class);
@Inject
- @GenericProduct
+ //@GenericProduct
StatefulKnowledgeSession statefullKsession;
@Inject
@Scanned
- @GenericProduct
+ //@GenericProduct
StatefulKnowledgeSession scannedStatefullKsession;
@Produces
Added: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/After.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/After.java (rev 0)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/After.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,50 @@
+/*
+ * 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.annotations.cep;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.Nonbinding;
+import javax.interceptor.InterceptorBinding;
+
+/**
+ *
+ * @author Tihomir Surdilovic
+ */
+@InterceptorBinding
+@Target( { TYPE, METHOD })
+@Documented
+@Retention(RUNTIME)
+public @interface After
+{
+ @Nonbinding
+ String value() default "";
+
+ @Nonbinding
+ String event() default "";
+}
Property changes on: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/After.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Before.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Before.java (rev 0)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Before.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,50 @@
+/*
+ * 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.annotations.cep;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.Nonbinding;
+import javax.interceptor.InterceptorBinding;
+
+/**
+ *
+ * @author Tihomir Surdilovic
+ */
+@InterceptorBinding
+@Target( { TYPE, METHOD })
+@Documented
+@Retention(RUNTIME)
+public @interface Before
+{
+ @Nonbinding
+ String value() default "";
+
+ @Nonbinding
+ String event() default "";
+}
Property changes on: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Before.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Coincides.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Coincides.java (rev 0)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Coincides.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,50 @@
+/*
+ * 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.annotations.cep;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.Nonbinding;
+import javax.interceptor.InterceptorBinding;
+
+/**
+ *
+ * @author Tihomir Surdilovic
+ */
+@InterceptorBinding
+@Target( { TYPE, METHOD })
+@Documented
+@Retention(RUNTIME)
+public @interface Coincides
+{
+ @Nonbinding
+ String value() default "";
+
+ @Nonbinding
+ String event() default "";
+}
Property changes on: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Coincides.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/During.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/During.java (rev 0)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/During.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,50 @@
+/*
+ * 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.annotations.cep;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.Nonbinding;
+import javax.interceptor.InterceptorBinding;
+
+/**
+ *
+ * @author Tihomir Surdilovic
+ */
+@InterceptorBinding
+@Target( { TYPE, METHOD })
+@Documented
+@Retention(RUNTIME)
+public @interface During
+{
+ @Nonbinding
+ String value() default "";
+
+ @Nonbinding
+ String event() default "";
+}
Property changes on: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/During.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Event.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Event.java (rev 0)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Event.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,48 @@
+/*
+ * 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.annotations.cep;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.Nonbinding;
+import javax.interceptor.InterceptorBinding;
+
+/**
+ *
+ * @author Tihomir Surdilovic
+ */
+@InterceptorBinding
+@Target( { TYPE, METHOD })
+@Documented
+@Retention(RUNTIME)
+public @interface Event
+{
+ @Nonbinding
+ String value() default "";
+
+}
Property changes on: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Event.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/EventProducer.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/EventProducer.java (rev 0)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/EventProducer.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,48 @@
+/*
+ * 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.annotations.cep;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.Nonbinding;
+import javax.interceptor.InterceptorBinding;
+
+/**
+ *
+ * @author Tihomir Surdilovic
+ */
+@InterceptorBinding
+@Target( { TYPE, METHOD })
+@Documented
+@Retention(RUNTIME)
+public @interface EventProducer
+{
+ @Nonbinding
+ String value() default "";
+
+}
Property changes on: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/EventProducer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/FinishedBy.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/FinishedBy.java (rev 0)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/FinishedBy.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,50 @@
+/*
+ * 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.annotations.cep;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.Nonbinding;
+import javax.interceptor.InterceptorBinding;
+
+/**
+ *
+ * @author Tihomir Surdilovic
+ */
+@InterceptorBinding
+@Target( { TYPE, METHOD })
+@Documented
+@Retention(RUNTIME)
+public @interface FinishedBy
+{
+ @Nonbinding
+ String value() default "";
+
+ @Nonbinding
+ String event() default "";
+}
Property changes on: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/FinishedBy.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Finishes.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Finishes.java (rev 0)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Finishes.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,50 @@
+/*
+ * 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.annotations.cep;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.Nonbinding;
+import javax.interceptor.InterceptorBinding;
+
+/**
+ *
+ * @author Tihomir Surdilovic
+ */
+@InterceptorBinding
+@Target( { TYPE, METHOD })
+@Documented
+@Retention(RUNTIME)
+public @interface Finishes
+{
+ @Nonbinding
+ String value() default "";
+
+ @Nonbinding
+ String event() default "";
+}
Property changes on: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Finishes.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Includes.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Includes.java (rev 0)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Includes.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,50 @@
+/*
+ * 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.annotations.cep;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.Nonbinding;
+import javax.interceptor.InterceptorBinding;
+
+/**
+ *
+ * @author Tihomir Surdilovic
+ */
+@InterceptorBinding
+@Target( { TYPE, METHOD })
+@Documented
+@Retention(RUNTIME)
+public @interface Includes
+{
+ @Nonbinding
+ String value() default "";
+
+ @Nonbinding
+ String event() default "";
+}
Property changes on: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Includes.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Max.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Max.java (rev 0)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Max.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,50 @@
+/*
+ * 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.annotations.cep;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.Nonbinding;
+import javax.interceptor.InterceptorBinding;
+
+/**
+ *
+ * @author Tihomir Surdilovic
+ */
+@InterceptorBinding
+@Target( { TYPE, METHOD })
+@Documented
+@Retention(RUNTIME)
+public @interface Max
+{
+ @Nonbinding
+ int value();
+
+ @Nonbinding
+ String event() default "";
+}
Property changes on: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Max.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Meets.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Meets.java (rev 0)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Meets.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,50 @@
+/*
+ * 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.annotations.cep;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.Nonbinding;
+import javax.interceptor.InterceptorBinding;
+
+/**
+ *
+ * @author Tihomir Surdilovic
+ */
+@InterceptorBinding
+@Target( { TYPE, METHOD })
+@Documented
+@Retention(RUNTIME)
+public @interface Meets
+{
+ @Nonbinding
+ String value() default "";
+
+ @Nonbinding
+ String event() default "";
+}
Property changes on: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Meets.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/MetBy.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/MetBy.java (rev 0)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/MetBy.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,50 @@
+/*
+ * 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.annotations.cep;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.Nonbinding;
+import javax.interceptor.InterceptorBinding;
+
+/**
+ *
+ * @author Tihomir Surdilovic
+ */
+@InterceptorBinding
+@Target( { TYPE, METHOD })
+@Documented
+@Retention(RUNTIME)
+public @interface MetBy
+{
+ @Nonbinding
+ String value() default "";
+
+ @Nonbinding
+ String event() default "";
+}
Property changes on: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/MetBy.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Min.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Min.java (rev 0)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Min.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,50 @@
+/*
+ * 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.annotations.cep;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.Nonbinding;
+import javax.interceptor.InterceptorBinding;
+
+/**
+ *
+ * @author Tihomir Surdilovic
+ */
+@InterceptorBinding
+@Target( { TYPE, METHOD })
+@Documented
+@Retention(RUNTIME)
+public @interface Min
+{
+ @Nonbinding
+ int value();
+
+ @Nonbinding
+ String event() default "";
+}
Property changes on: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Min.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/OverWindowLength.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/OverWindowLength.java (rev 0)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/OverWindowLength.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,48 @@
+/*
+ * 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.annotations.cep;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.Nonbinding;
+import javax.interceptor.InterceptorBinding;
+
+/**
+ *
+ * @author Tihomir Surdilovic
+ */
+@InterceptorBinding
+@Target( { TYPE, METHOD })
+@Documented
+@Retention(RUNTIME)
+public @interface OverWindowLength
+{
+ @Nonbinding
+ String value() default "";
+
+}
Property changes on: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/OverWindowLength.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/OverWindowTime.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/OverWindowTime.java (rev 0)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/OverWindowTime.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,48 @@
+/*
+ * 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.annotations.cep;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.Nonbinding;
+import javax.interceptor.InterceptorBinding;
+
+/**
+ *
+ * @author Tihomir Surdilovic
+ */
+@InterceptorBinding
+@Target( { TYPE, METHOD })
+@Documented
+@Retention(RUNTIME)
+public @interface OverWindowTime
+{
+ @Nonbinding
+ String value() default "";
+
+}
Property changes on: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/OverWindowTime.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/OverlappedBy.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/OverlappedBy.java (rev 0)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/OverlappedBy.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,50 @@
+/*
+ * 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.annotations.cep;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.Nonbinding;
+import javax.interceptor.InterceptorBinding;
+
+/**
+ *
+ * @author Tihomir Surdilovic
+ */
+@InterceptorBinding
+@Target( { TYPE, METHOD })
+@Documented
+@Retention(RUNTIME)
+public @interface OverlappedBy
+{
+ @Nonbinding
+ String value() default "";
+
+ @Nonbinding
+ String event() default "";
+}
Property changes on: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/OverlappedBy.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Overlaps.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Overlaps.java (rev 0)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Overlaps.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,50 @@
+/*
+ * 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.annotations.cep;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.Nonbinding;
+import javax.interceptor.InterceptorBinding;
+
+/**
+ *
+ * @author Tihomir Surdilovic
+ */
+@InterceptorBinding
+@Target( { TYPE, METHOD })
+@Documented
+@Retention(RUNTIME)
+public @interface Overlaps
+{
+ @Nonbinding
+ String value() default "";
+
+ @Nonbinding
+ String event() default "";
+}
Property changes on: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Overlaps.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/StartedBy.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/StartedBy.java (rev 0)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/StartedBy.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,50 @@
+/*
+ * 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.annotations.cep;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.Nonbinding;
+import javax.interceptor.InterceptorBinding;
+
+/**
+ *
+ * @author Tihomir Surdilovic
+ */
+@InterceptorBinding
+@Target( { TYPE, METHOD })
+@Documented
+@Retention(RUNTIME)
+public @interface StartedBy
+{
+ @Nonbinding
+ String value() default "";
+
+ @Nonbinding
+ String event() default "";
+}
Property changes on: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/StartedBy.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Starts.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Starts.java (rev 0)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Starts.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,50 @@
+/*
+ * 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.annotations.cep;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.util.Nonbinding;
+import javax.interceptor.InterceptorBinding;
+
+/**
+ *
+ * @author Tihomir Surdilovic
+ */
+@InterceptorBinding
+@Target( { TYPE, METHOD })
+@Documented
+@Retention(RUNTIME)
+public @interface Starts
+{
+ @Nonbinding
+ String value() default "";
+
+ @Nonbinding
+ String event() default "";
+}
Property changes on: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/annotations/cep/Starts.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/DroolsExtension.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/DroolsExtension.java 2010-09-27 15:28:45 UTC (rev 13782)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/DroolsExtension.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -21,27 +21,49 @@
*/
package org.jboss.seam.drools.bootstrap;
+import java.io.StringReader;
+import java.lang.annotation.Annotation;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
+import javax.annotation.PostConstruct;
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.event.Observes;
import javax.enterprise.inject.Any;
import javax.enterprise.inject.spi.AfterBeanDiscovery;
+import javax.enterprise.inject.spi.AnnotatedMethod;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.inject.spi.Extension;
+import javax.enterprise.inject.spi.ProcessAnnotatedType;
import javax.enterprise.util.AnnotationLiteral;
+import org.drools.KnowledgeBase;
+import org.drools.KnowledgeBaseConfiguration;
+import org.drools.KnowledgeBaseFactory;
import org.drools.runtime.Channel;
+import org.drools.runtime.Environment;
+import org.drools.runtime.KnowledgeSessionConfiguration;
+import org.drools.runtime.StatefulKnowledgeSession;
import org.drools.base.evaluators.EvaluatorDefinition;
+import org.drools.builder.KnowledgeBuilder;
+import org.drools.builder.KnowledgeBuilderError;
+import org.drools.builder.KnowledgeBuilderErrors;
+import org.drools.builder.KnowledgeBuilderFactory;
+import org.drools.builder.ResourceType;
+import org.drools.conf.EventProcessingOption;
import org.drools.event.knowledgebase.KnowledgeBaseEventListener;
+import org.drools.io.ResourceFactory;
+import org.drools.runtime.conf.ClockTypeOption;
import org.drools.runtime.process.WorkItemHandler;
import org.jboss.seam.drools.FactProvider;
import org.jboss.seam.drools.TemplateDataProvider;
+import org.jboss.seam.drools.annotations.cep.Event;
+import org.jboss.seam.drools.annotations.cep.Max;
+import org.jboss.seam.drools.bootstrap.util.RuleBuilder;
import org.jboss.seam.drools.qualifiers.EvaluatorDef;
import org.jboss.seam.drools.qualifiers.KBaseEventListener;
import org.jboss.seam.drools.qualifiers.KSessionEventListener;
@@ -53,6 +75,7 @@
public class DroolsExtension implements Extension
{
private static final Logger log = LoggerFactory.getLogger(DroolsExtension.class);
+
private Set<KnowledgeBaseEventListener> kbaseEventListenerSet = new HashSet<KnowledgeBaseEventListener>();
private Set<Object> ksessionEventListenerSet = new HashSet<Object>();
private Map<String, WorkItemHandler> workItemHandlers = new HashMap<String, WorkItemHandler>();
@@ -60,9 +83,23 @@
private Set<FactProvider> factProviderSet = new HashSet<FactProvider>();
private Map<String, EvaluatorDefinition> evaluatorDefinitions = new HashMap<String, EvaluatorDefinition>();
private Map<String, Channel> channels = new HashMap<String, Channel>();
+ private Set<AnnotatedMethod<?>> cepAlertingRegistry = new HashSet<AnnotatedMethod<?>>();
+ private KnowledgeBase cepAlertingKbase;
+ private StatefulKnowledgeSession cepAlertingKSession;
+ private RuleBuilder ruleBuilder = new RuleBuilder();
+ @PostConstruct
+ public void init() {
+
+ }
+
@SuppressWarnings("serial")
void afterBeanDiscovery(@Observes AfterBeanDiscovery abd, BeanManager bm) {
+
+ if(isEnabledCepAlerting()) {
+ initCEPAlerting();
+ }
+
//KnowledgeBase event listeners
log.info("Start creating knowledgebase event listeners");
Set<Bean<?>> allKBaseEventListeners = bm.getBeans(KnowledgeBaseEventListener.class, new AnnotationLiteral<KBaseEventListener>() {});
@@ -189,7 +226,54 @@
log.info("End creating [" + (allFactProviders == null ? 0 : allFactProviders.size())+ "] fact providers");
}
+
+ <X> void processAnnotatedType(@Observes ProcessAnnotatedType<X> pat, BeanManager manager) {
+ for(AnnotatedMethod<?> m : pat.getAnnotatedType().getMethods()) {
+ if(m.isAnnotationPresent(Event.class)) {
+ cepAlertingRegistry.add(m);
+ System.out.println("*** - " + pat.toString());
+ System.out.println("*** Found Event: " + m.getClass().getName() + " - " + m.toString());
+ Iterator<Annotation> iter = m.getAnnotations().iterator();
+ while(iter.hasNext()) {
+ Annotation a = iter.next();
+ if(a instanceof Max) {
+ System.out.println("Max value: " + ((Max) a).value());
+ }
+ System.out.println("*** annotation class: " + a.getClass().getName());
+ }
+ }
+ }
+ }
+
+ private void initCEPAlerting() {
+ KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
+ kbuilder.add(ResourceFactory.newReaderResource(new StringReader(ruleBuilder.getRuleDrl())), ResourceType.DRL);
+ KnowledgeBuilderErrors errors = kbuilder.getErrors();
+ if (errors.size() > 0) {
+ for (KnowledgeBuilderError error: errors) {
+ log.error(error.getMessage());
+ }
+ throw new IllegalArgumentException("Could not parse cepalerting knowledge.");
+ }
+ KnowledgeBaseConfiguration kbaseConfig = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
+ kbaseConfig.setOption( EventProcessingOption.STREAM );
+
+ cepAlertingKbase = KnowledgeBaseFactory.newKnowledgeBase(kbaseConfig);
+ cepAlertingKbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
+
+ KnowledgeSessionConfiguration ksessionConfig = KnowledgeBaseFactory.newKnowledgeSessionConfiguration();
+ if(usePseudoClock()) {
+ ksessionConfig.setOption( ClockTypeOption.get("pseudo") );
+ } else {
+ ksessionConfig.setOption( ClockTypeOption.get("realtime") );
+ }
+
+ Environment env = KnowledgeBaseFactory.newEnvironment();
+ cepAlertingKSession = cepAlertingKbase.newStatefulKnowledgeSession(ksessionConfig, env);
+ cepAlertingKSession.fireUntilHalt();
+ }
+
public Set<KnowledgeBaseEventListener> getKbaseEventListenerSet()
{
return kbaseEventListenerSet;
@@ -227,5 +311,39 @@
public Map<String, Channel> getChannels()
{
return channels;
- }
+ }
+
+ public Set<AnnotatedMethod<?>> getCepAlertingRegistry()
+ {
+ return cepAlertingRegistry;
+ }
+
+ public KnowledgeBase getCepAlertingKbase()
+ {
+ return cepAlertingKbase;
+ }
+
+ public StatefulKnowledgeSession getCepAlertingKSession()
+ {
+ return cepAlertingKSession;
+ }
+
+ private boolean isEnabledCepAlerting() {
+ String enabled = System.getProperty("seam.drools.cepalerting.enabled");
+ if(enabled != null && enabled.equals("false")) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+
+ private boolean usePseudoClock() {
+ String pseudoClock = System.getProperty("seam.drools.cepalertingn.clock");
+ if(pseudoClock != null && pseudoClock.equals("pseudo")) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
}
Added: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/util/DeclaredType.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/util/DeclaredType.java (rev 0)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/util/DeclaredType.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,55 @@
+/*
+ * 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.bootstrap.util;
+
+public class DeclaredType
+{
+ private String name;
+ private Role role = Role.EVENT;
+ private String expires;
+ public String getName()
+ {
+ return name;
+ }
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+ public Role getRole()
+ {
+ return role;
+ }
+ public void setRole(Role role)
+ {
+ this.role = role;
+ }
+ public String getExpires()
+ {
+ return expires;
+ }
+ public void setExpires(String expires)
+ {
+ this.expires = expires;
+ }
+
+
+}
Property changes on: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/util/DeclaredType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/util/DroolsExtensionUtils.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/util/DroolsExtensionUtils.java (rev 0)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/util/DroolsExtensionUtils.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,27 @@
+/*
+ * 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.bootstrap.util;
+
+public class DroolsExtensionUtils
+{
+
+}
Property changes on: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/util/DroolsExtensionUtils.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/util/LHSTemplates.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/util/LHSTemplates.java (rev 0)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/util/LHSTemplates.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,41 @@
+package org.jboss.seam.drools.bootstrap.util;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.ApplicationScoped;
+
+@ApplicationScoped
+public class LHSTemplates
+{
+ //Number( intValue >= 3) from accumulate( X() from entry-point Y over window:time( 10m ), count(1) )
+ public static final String MIN = "min";
+ public static final String MAX = "max";
+ public static final String AFTER = "after";
+ public static final String BEFORE = "before";
+ public static final String COINCIDES = "coincides";
+ public static final String DURING = "during";
+ public static final String FINISHED_BY = "finishedby";
+ public static final String FINISHES = "finishes";
+ public static final String INCLUDES = "includes";
+ public static final String MEETS = "meets";
+ public static final String MET_BY = "metby";
+ public static final String OVERLAPPED_BY = "overlappedby";
+ public static final String OVERLAPS = "overlaps";
+ public static final String OVER_WINDOW_LENGTH = "overwindowlength";
+ public static final String OVER_WINDOW_TIME = "overwindowtime";
+ public static final String STARTED_BY = "startedby";
+ public static final String STARTS = "starts";
+
+ private Map<String, String> patterns;
+
+ @PostConstruct
+ public void init() {
+ patterns = new HashMap<String, String>();
+
+
+ }
+
+
+}
Property changes on: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/util/LHSTemplates.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/util/Role.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/util/Role.java (rev 0)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/util/Role.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,27 @@
+/*
+ * 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.bootstrap.util;
+
+public enum Role
+{
+ FACT, EVENT;
+}
Property changes on: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/util/Role.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/util/Rule.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/util/Rule.java (rev 0)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/util/Rule.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,27 @@
+/*
+ * 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.bootstrap.util;
+
+public class Rule
+{
+
+}
Property changes on: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/util/Rule.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/util/RuleBuilder.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/util/RuleBuilder.java (rev 0)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/util/RuleBuilder.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,72 @@
+package org.jboss.seam.drools.bootstrap.util;
+
+import java.util.List;
+
+import javax.enterprise.context.ApplicationScoped;
+
+/*
+ * 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.
+ */
+public class RuleBuilder
+{
+ private static final String rulePackage = "org.jboss.seam.drools.cepvalidation";
+
+ private List<String> imports;
+ private List<DeclaredType> declaredTypes;
+ private List<Rule> rules;
+
+
+ public List<String> getImports()
+ {
+ return imports;
+ }
+ public void setImports(List<String> imports)
+ {
+ this.imports = imports;
+ }
+ public List<DeclaredType> getDeclaredTypes()
+ {
+ return declaredTypes;
+ }
+ public void setDeclaredTypes(List<DeclaredType> declaredTypes)
+ {
+ this.declaredTypes = declaredTypes;
+ }
+ public List<Rule> getRules()
+ {
+ return rules;
+ }
+ public void setRules(List<Rule> rules)
+ {
+ this.rules = rules;
+ }
+ public static String getRulepackage()
+ {
+ return rulePackage;
+ }
+
+
+ public String getRuleDrl() {
+ return null; // for now
+ }
+
+
+}
Property changes on: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/bootstrap/util/RuleBuilder.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/configutil/DroolsConfigUtil.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/configutil/DroolsConfigUtil.java 2010-09-27 15:28:45 UTC (rev 13782)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/configutil/DroolsConfigUtil.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -45,7 +45,7 @@
private final Map<String, String> kbasePropertiesMap = new HashMap<String, String>();
private final Map<String, String> ksessionPropertiesMap = new HashMap<String, String>();
private final Map<String, String> kagentPropertiestMap = new HashMap<String, String>();
- private final Map<String, String> envPropertiestMap = new HashMap<String, String>();
+ private final Map<String, String> serializationSigningPropertiesMap = new HashMap<String, String>();
@PostConstruct
public void setup()
@@ -54,7 +54,7 @@
readProperties(kbasePropertiesMap, config.kbaseProperties(), config.kbaseConfigFile());
readProperties(ksessionPropertiesMap, config.ksessionProperties(), config.ksessionConfigFile());
readProperties(kagentPropertiestMap, config.kagentPropertiest(), config.kagentConfigFile());
- readProperties(envPropertiestMap, config.envProperties(), config.envConfigFile());
+ readProperties(serializationSigningPropertiesMap, config.serializationSigningProperties(), config.serializationSigningConfigFile());
}
public ResourceChangeScannerConfiguration getResourceChangeScannerConfiguration()
Deleted: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/AbortProcessInterceptor.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/AbortProcessInterceptor.java 2010-09-27 15:28:45 UTC (rev 13782)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/AbortProcessInterceptor.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -1,101 +0,0 @@
-/*
- * 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.interceptor;
-
-import java.lang.annotation.Annotation;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.enterprise.inject.Any;
-import javax.enterprise.inject.Instance;
-import javax.enterprise.inject.spi.BeanManager;
-import javax.inject.Inject;
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.Interceptor;
-import javax.interceptor.InvocationContext;
-
-import org.drools.runtime.StatefulKnowledgeSession;
-import org.drools.runtime.process.ProcessInstance;
-import org.jboss.seam.drools.annotations.flow.AbortProcess;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@AbortProcess
-@Interceptor
-public class AbortProcessInterceptor
-{
- @Inject
- BeanManager manager;
-
- @Inject
- @Any
- Instance<StatefulKnowledgeSession> ksessionSource;
-
- private static final Logger log = LoggerFactory.getLogger(AbortProcessInterceptor.class);
-
- @AroundInvoke
- public Object abortProcess(InvocationContext ctx) throws Exception
- {
-
- String processName = null;
-
- Annotation[] methodAnnotations = ctx.getMethod().getAnnotations();
- List<Annotation> annotationTypeList = new ArrayList<Annotation>();
-
- for (Annotation nextAnnotation : methodAnnotations)
- {
- if (manager.isQualifier(nextAnnotation.annotationType()))
- {
- annotationTypeList.add(nextAnnotation);
- }
- if (manager.isInterceptorBinding(nextAnnotation.annotationType()))
- {
- if (nextAnnotation instanceof AbortProcess)
- {
- processName = ((AbortProcess) nextAnnotation).value();
- }
- }
- }
-
- StatefulKnowledgeSession ksession = ksessionSource.select((Annotation[])annotationTypeList.toArray(new Annotation[annotationTypeList.size()])).get();
- if(ksession != null) {
- Object retObj = ctx.proceed();
- if(processName != null && processName.length() > 0 ) {
- Iterator<ProcessInstance> iter = ksession.getProcessInstances().iterator();
- while(iter.hasNext()) {
- ProcessInstance pi = iter.next();
- if(pi.getProcessName().equals(processName)) {
- ksession.abortProcessInstance(pi.getId());
- }
- }
- } else {
- log.info("Invalid process name: " + processName);
- }
- return retObj;
- } else {
- log.info("Could not obtain StatefulKnowledgeSession.");
- return ctx.proceed();
- }
- }
-
-}
Deleted: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/SignalEventInterceptor.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/SignalEventInterceptor.java 2010-09-27 15:28:45 UTC (rev 13782)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/SignalEventInterceptor.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -1,146 +0,0 @@
-/*
- * 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.interceptor;
-
-import java.lang.annotation.Annotation;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.enterprise.inject.Any;
-import javax.enterprise.inject.Instance;
-import javax.enterprise.inject.spi.BeanManager;
-import javax.inject.Inject;
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.Interceptor;
-import javax.interceptor.InvocationContext;
-
-import org.drools.runtime.StatefulKnowledgeSession;
-import org.drools.runtime.process.ProcessInstance;
-import org.jboss.seam.drools.annotations.flow.SignalEvent;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- *
- * @author Tihomir Surdilovic
- */
-@SignalEvent
-@Interceptor
-public class SignalEventInterceptor
-{
- @Inject
- BeanManager manager;
-
- @Inject
- @Any
- Instance<StatefulKnowledgeSession> ksessionSource;
-
- private static final Logger log = LoggerFactory.getLogger(SignalEventInterceptor.class);
-
- @AroundInvoke
- public Object signalEvent(InvocationContext ctx) throws Exception
- {
- String processName = null;
- String processId = null;
- String type = null;
- String event = null;
-
- Annotation[] methodAnnotations = ctx.getMethod().getAnnotations();
- List<Annotation> annotationTypeList = new ArrayList<Annotation>();
-
- for (Annotation nextAnnotation : methodAnnotations)
- {
- if (manager.isQualifier(nextAnnotation.annotationType()))
- {
- annotationTypeList.add(nextAnnotation);
- }
- if (manager.isInterceptorBinding(nextAnnotation.annotationType()))
- {
- if (nextAnnotation instanceof SignalEvent)
- {
- processName = ((SignalEvent) nextAnnotation).processName();
- processId = ((SignalEvent) nextAnnotation).processId();
- type = ((SignalEvent) nextAnnotation).type();
- event = ((SignalEvent) nextAnnotation).event();
- }
- }
- }
-
- StatefulKnowledgeSession ksession = ksessionSource.select((Annotation[]) annotationTypeList.toArray(new Annotation[annotationTypeList.size()])).get();
- if (ksession != null)
- {
- Object retObj = ctx.proceed();
- if (type != null)
- {
- if (processName != null && processName.length() > 0)
- {
- Iterator<ProcessInstance> iter = ksession.getProcessInstances().iterator();
- while (iter.hasNext())
- {
- ProcessInstance pi = iter.next();
- if (pi.getProcessName().equals(processName))
- {
- if (event != null && event.length() > 0)
- {
- pi.signalEvent(type, event);
- }
- else
- {
- pi.signalEvent(type, retObj);
- }
- }
- }
- }
- else if(processId != null && processId.length() > 0) {
- ProcessInstance pi = ksession.getProcessInstance(Long.parseLong(processId));
- if(pi != null) {
- pi.signalEvent(type, event);
- }
- }
- else
- {
- if (event != null && event.length() > 0)
- {
- ksession.signalEvent(type, event);
- }
- else
- {
- ksession.signalEvent(type, retObj);
- }
-
- }
- }
- else
- {
- log.error("Invalid type specified: " + type);
- }
- return retObj;
- }
- else
- {
- log.info("Could not obtain StatefulKnowledgeSession.");
- return ctx.proceed();
- }
-
- }
-}
Deleted: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/StartProcessInterceptor.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/StartProcessInterceptor.java 2010-09-27 15:28:45 UTC (rev 13782)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/StartProcessInterceptor.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -1,96 +0,0 @@
-/*
- * 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.interceptor;
-
-import java.lang.annotation.Annotation;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.enterprise.inject.Any;
-import javax.enterprise.inject.Instance;
-import javax.enterprise.inject.spi.BeanManager;
-import javax.inject.Inject;
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.Interceptor;
-import javax.interceptor.InvocationContext;
-
-import org.drools.runtime.StatefulKnowledgeSession;
-import org.jboss.seam.drools.annotations.flow.StartProcess;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@StartProcess
-@Interceptor
-public class StartProcessInterceptor
-{
- @Inject
- BeanManager manager;
-
- @Inject @Any Instance<StatefulKnowledgeSession> ksessionSource;
-
- private static final Logger log = LoggerFactory.getLogger(StartProcessInterceptor.class);
-
- @AroundInvoke
- public Object startProcess(InvocationContext ctx) throws Exception
- {
- String processName = null;
- boolean fire = false;
- boolean untilHalt = false;
-
- Annotation[] methodAnnotations = ctx.getMethod().getAnnotations();
- List<Annotation> annotationTypeList = new ArrayList<Annotation>();
-
- for(Annotation nextAnnotation : methodAnnotations) {
- if(manager.isQualifier(nextAnnotation.annotationType())) {
- annotationTypeList.add(nextAnnotation);
- }
- if(manager.isInterceptorBinding(nextAnnotation.annotationType())) {
- if(nextAnnotation instanceof StartProcess) {
- processName = ((StartProcess) nextAnnotation).processName();
- fire = ((StartProcess) nextAnnotation).fire();
- untilHalt = ((StartProcess) nextAnnotation).untilHalt();
- }
- }
- }
-
- final StatefulKnowledgeSession ksession = ksessionSource.select((Annotation[])annotationTypeList.toArray(new Annotation[annotationTypeList.size()])).get();
- if(ksession != null) {
- Object retObj = ctx.proceed();
- if(processName != null && processName.length() > 0 ) {
- ksession.startProcess(processName);
- if(fire) {
- if(untilHalt) {
- ksession.fireUntilHalt();
- } else {
- ksession.fireAllRules();
- }
- }
- } else {
- log.info("Invalid process name: " + processName);
- }
- return retObj;
- } else {
- log.info("Could not obtain StatefulKnowledgeSession.");
- return ctx.proceed();
- }
- }
-}
Added: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/cep/EventInterceptor.java
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/cep/EventInterceptor.java (rev 0)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/cep/EventInterceptor.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,33 @@
+/*
+ * 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.interceptor.cep;
+
+import javax.interceptor.Interceptor;
+
+import org.jboss.seam.drools.annotations.cep.Event;
+
+@Event
+@Interceptor
+public class EventInterceptor
+{
+
+}
Property changes on: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/cep/EventInterceptor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/flow/AbortProcessInterceptor.java (from rev 13764, modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/AbortProcessInterceptor.java)
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/flow/AbortProcessInterceptor.java (rev 0)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/flow/AbortProcessInterceptor.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,101 @@
+/*
+ * 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.interceptor.flow;
+
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.enterprise.inject.Any;
+import javax.enterprise.inject.Instance;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.inject.Inject;
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+
+import org.drools.runtime.StatefulKnowledgeSession;
+import org.drools.runtime.process.ProcessInstance;
+import org.jboss.seam.drools.annotations.flow.AbortProcess;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@AbortProcess
+@Interceptor
+public class AbortProcessInterceptor
+{
+ @Inject
+ BeanManager manager;
+
+ @Inject
+ @Any
+ Instance<StatefulKnowledgeSession> ksessionSource;
+
+ private static final Logger log = LoggerFactory.getLogger(AbortProcessInterceptor.class);
+
+ @AroundInvoke
+ public Object abortProcess(InvocationContext ctx) throws Exception
+ {
+
+ String processName = null;
+
+ Annotation[] methodAnnotations = ctx.getMethod().getAnnotations();
+ List<Annotation> annotationTypeList = new ArrayList<Annotation>();
+
+ for (Annotation nextAnnotation : methodAnnotations)
+ {
+ if (manager.isQualifier(nextAnnotation.annotationType()))
+ {
+ annotationTypeList.add(nextAnnotation);
+ }
+ if (manager.isInterceptorBinding(nextAnnotation.annotationType()))
+ {
+ if (nextAnnotation instanceof AbortProcess)
+ {
+ processName = ((AbortProcess) nextAnnotation).value();
+ }
+ }
+ }
+
+ StatefulKnowledgeSession ksession = ksessionSource.select((Annotation[])annotationTypeList.toArray(new Annotation[annotationTypeList.size()])).get();
+ if(ksession != null) {
+ Object retObj = ctx.proceed();
+ if(processName != null && processName.length() > 0 ) {
+ Iterator<ProcessInstance> iter = ksession.getProcessInstances().iterator();
+ while(iter.hasNext()) {
+ ProcessInstance pi = iter.next();
+ if(pi.getProcessName().equals(processName)) {
+ ksession.abortProcessInstance(pi.getId());
+ }
+ }
+ } else {
+ log.info("Invalid process name: " + processName);
+ }
+ return retObj;
+ } else {
+ log.info("Could not obtain StatefulKnowledgeSession.");
+ return ctx.proceed();
+ }
+ }
+
+}
Copied: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/flow/SignalEventInterceptor.java (from rev 13764, modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/SignalEventInterceptor.java)
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/flow/SignalEventInterceptor.java (rev 0)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/flow/SignalEventInterceptor.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,146 @@
+/*
+ * 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.interceptor.flow;
+
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.enterprise.inject.Any;
+import javax.enterprise.inject.Instance;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.inject.Inject;
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+
+import org.drools.runtime.StatefulKnowledgeSession;
+import org.drools.runtime.process.ProcessInstance;
+import org.jboss.seam.drools.annotations.flow.SignalEvent;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ *
+ * @author Tihomir Surdilovic
+ */
+@SignalEvent
+@Interceptor
+public class SignalEventInterceptor
+{
+ @Inject
+ BeanManager manager;
+
+ @Inject
+ @Any
+ Instance<StatefulKnowledgeSession> ksessionSource;
+
+ private static final Logger log = LoggerFactory.getLogger(SignalEventInterceptor.class);
+
+ @AroundInvoke
+ public Object signalEvent(InvocationContext ctx) throws Exception
+ {
+ String processName = null;
+ String processId = null;
+ String type = null;
+ String event = null;
+
+ Annotation[] methodAnnotations = ctx.getMethod().getAnnotations();
+ List<Annotation> annotationTypeList = new ArrayList<Annotation>();
+
+ for (Annotation nextAnnotation : methodAnnotations)
+ {
+ if (manager.isQualifier(nextAnnotation.annotationType()))
+ {
+ annotationTypeList.add(nextAnnotation);
+ }
+ if (manager.isInterceptorBinding(nextAnnotation.annotationType()))
+ {
+ if (nextAnnotation instanceof SignalEvent)
+ {
+ processName = ((SignalEvent) nextAnnotation).processName();
+ processId = ((SignalEvent) nextAnnotation).processId();
+ type = ((SignalEvent) nextAnnotation).type();
+ event = ((SignalEvent) nextAnnotation).event();
+ }
+ }
+ }
+
+ StatefulKnowledgeSession ksession = ksessionSource.select((Annotation[]) annotationTypeList.toArray(new Annotation[annotationTypeList.size()])).get();
+ if (ksession != null)
+ {
+ Object retObj = ctx.proceed();
+ if (type != null)
+ {
+ if (processName != null && processName.length() > 0)
+ {
+ Iterator<ProcessInstance> iter = ksession.getProcessInstances().iterator();
+ while (iter.hasNext())
+ {
+ ProcessInstance pi = iter.next();
+ if (pi.getProcessName().equals(processName))
+ {
+ if (event != null && event.length() > 0)
+ {
+ pi.signalEvent(type, event);
+ }
+ else
+ {
+ pi.signalEvent(type, retObj);
+ }
+ }
+ }
+ }
+ else if(processId != null && processId.length() > 0) {
+ ProcessInstance pi = ksession.getProcessInstance(Long.parseLong(processId));
+ if(pi != null) {
+ pi.signalEvent(type, event);
+ }
+ }
+ else
+ {
+ if (event != null && event.length() > 0)
+ {
+ ksession.signalEvent(type, event);
+ }
+ else
+ {
+ ksession.signalEvent(type, retObj);
+ }
+
+ }
+ }
+ else
+ {
+ log.error("Invalid type specified: " + type);
+ }
+ return retObj;
+ }
+ else
+ {
+ log.info("Could not obtain StatefulKnowledgeSession.");
+ return ctx.proceed();
+ }
+
+ }
+}
Copied: modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/flow/StartProcessInterceptor.java (from rev 13764, modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/StartProcessInterceptor.java)
===================================================================
--- modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/flow/StartProcessInterceptor.java (rev 0)
+++ modules/drools/trunk/impl/src/main/java/org/jboss/seam/drools/interceptor/flow/StartProcessInterceptor.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,96 @@
+/*
+ * 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.interceptor.flow;
+
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.enterprise.inject.Any;
+import javax.enterprise.inject.Instance;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.inject.Inject;
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+
+import org.drools.runtime.StatefulKnowledgeSession;
+import org.jboss.seam.drools.annotations.flow.StartProcess;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@StartProcess
+@Interceptor
+public class StartProcessInterceptor
+{
+ @Inject
+ BeanManager manager;
+
+ @Inject @Any Instance<StatefulKnowledgeSession> ksessionSource;
+
+ private static final Logger log = LoggerFactory.getLogger(StartProcessInterceptor.class);
+
+ @AroundInvoke
+ public Object startProcess(InvocationContext ctx) throws Exception
+ {
+ String processName = null;
+ boolean fire = false;
+ boolean untilHalt = false;
+
+ Annotation[] methodAnnotations = ctx.getMethod().getAnnotations();
+ List<Annotation> annotationTypeList = new ArrayList<Annotation>();
+
+ for(Annotation nextAnnotation : methodAnnotations) {
+ if(manager.isQualifier(nextAnnotation.annotationType())) {
+ annotationTypeList.add(nextAnnotation);
+ }
+ if(manager.isInterceptorBinding(nextAnnotation.annotationType())) {
+ if(nextAnnotation instanceof StartProcess) {
+ processName = ((StartProcess) nextAnnotation).processName();
+ fire = ((StartProcess) nextAnnotation).fire();
+ untilHalt = ((StartProcess) nextAnnotation).untilHalt();
+ }
+ }
+ }
+
+ final StatefulKnowledgeSession ksession = ksessionSource.select((Annotation[])annotationTypeList.toArray(new Annotation[annotationTypeList.size()])).get();
+ if(ksession != null) {
+ Object retObj = ctx.proceed();
+ if(processName != null && processName.length() > 0 ) {
+ ksession.startProcess(processName);
+ if(fire) {
+ if(untilHalt) {
+ ksession.fireUntilHalt();
+ } else {
+ ksession.fireAllRules();
+ }
+ }
+ } else {
+ log.info("Invalid process name: " + processName);
+ }
+ return retObj;
+ } else {
+ log.info("Could not obtain StatefulKnowledgeSession.");
+ return ctx.proceed();
+ }
+ }
+}
Added: modules/drools/trunk/impl/src/main/resources/org/jboss/seam/drools/cepvalidation/templates/declaredtypes.st
===================================================================
--- modules/drools/trunk/impl/src/main/resources/org/jboss/seam/drools/cepvalidation/templates/declaredtypes.st (rev 0)
+++ modules/drools/trunk/impl/src/main/resources/org/jboss/seam/drools/cepvalidation/templates/declaredtypes.st 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,7 @@
+$declaredtypes:{ declaredtype |
+
+declare $declaredtype.name$
+ @role( event )
+end
+
+}$
Added: modules/drools/trunk/impl/src/main/resources/org/jboss/seam/drools/cepvalidation/templates/drl.st
===================================================================
--- modules/drools/trunk/impl/src/main/resources/org/jboss/seam/drools/cepvalidation/templates/drl.st (rev 0)
+++ modules/drools/trunk/impl/src/main/resources/org/jboss/seam/drools/cepvalidation/templates/drl.st 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,7 @@
+package $packagename$
+
+$imports()$
+
+$declaredtypes()$
+
+$rules()$
Added: modules/drools/trunk/impl/src/main/resources/org/jboss/seam/drools/cepvalidation/templates/imports.st
===================================================================
--- modules/drools/trunk/impl/src/main/resources/org/jboss/seam/drools/cepvalidation/templates/imports.st (rev 0)
+++ modules/drools/trunk/impl/src/main/resources/org/jboss/seam/drools/cepvalidation/templates/imports.st 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,3 @@
+$imports:{ import |
+import $import$;
+}$
Added: modules/drools/trunk/impl/src/main/resources/org/jboss/seam/drools/cepvalidation/templates/pattern.st
===================================================================
Added: modules/drools/trunk/impl/src/main/resources/org/jboss/seam/drools/cepvalidation/templates/rules.st
===================================================================
--- modules/drools/trunk/impl/src/main/resources/org/jboss/seam/drools/cepvalidation/templates/rules.st (rev 0)
+++ modules/drools/trunk/impl/src/main/resources/org/jboss/seam/drools/cepvalidation/templates/rules.st 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,8 @@
+$rules:{ rule |
+rule "$rule.name$
+when
+ $rule.lhs$
+then
+ $rule.rhs$
+end
+}$
Modified: modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/cep/CEPTest.java
===================================================================
--- modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/cep/CEPTest.java 2010-09-27 15:28:45 UTC (rev 13782)
+++ modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/cep/CEPTest.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -53,7 +53,7 @@
public static JavaArchive createTestArchive()
{
String pkgPath = CEPTest.class.getPackage().getName().replaceAll("\\.", "/");
- JavaArchive archive = ShrinkWrap.create("test.jar", JavaArchive.class)
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class)
/**.addPackages(true, new DroolsModuleFilter("cep"), KnowledgeBaseProducer.class.getPackage())
.addPackages(true, ResourceProvider.class.getPackage())
.addClass(FireAlarm.class)
Added: modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/cepalerting/AlertingBean.java
===================================================================
--- modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/cepalerting/AlertingBean.java (rev 0)
+++ modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/cepalerting/AlertingBean.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,13 @@
+package org.jboss.seam.drools.test.cepalerting;
+
+import org.jboss.seam.drools.annotations.cep.Event;
+import org.jboss.seam.drools.annotations.cep.Max;
+import org.jboss.seam.drools.annotations.cep.OverWindowTime;
+
+public class AlertingBean
+{
+ @Event @Max(3) @OverWindowTime("10m")
+ public void doSomething(String something) {
+ // guess do nothing
+ }
+}
Property changes on: modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/cepalerting/AlertingBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/cepalerting/CepAlertingTest.java
===================================================================
--- modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/cepalerting/CepAlertingTest.java (rev 0)
+++ modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/cepalerting/CepAlertingTest.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,42 @@
+package org.jboss.seam.drools.test.cepalerting;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.drools.KnowledgeBaseProducer;
+import org.jboss.seam.drools.test.DroolsModuleFilter;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class CepAlertingTest
+{
+ @Deployment
+ public static JavaArchive createTestArchive()
+ {
+ String pkgPath = CepAlertingTest.class.getPackage().getName().replaceAll("\\.", "/");
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class)
+ .addPackages(true, new DroolsModuleFilter("cepvalidation"), KnowledgeBaseProducer.class.getPackage())
+ .addClass(AlertingBean.class)
+ .addManifestResource(pkgPath + "/CepAlertingTest-beans.xml", ArchivePaths.create("beans.xml"))
+ .addManifestResource("META-INF/services/javax.enterprise.inject.spi.Extension", ArchivePaths.create("services/javax.enterprise.inject.spi.Extension"));
+ //System.out.println(archive.toString(Formatters.VERBOSE));
+ return archive;
+ }
+
+ @Inject
+ AlertingBean ab;
+
+ @Test
+ public void checkAlertingBean() {
+ assertNotNull(ab);
+ ab.doSomething("something");
+ }
+}
Property changes on: modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/cepalerting/CepAlertingTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/channel/ChannelTest.java
===================================================================
--- modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/channel/ChannelTest.java 2010-09-27 15:28:45 UTC (rev 13782)
+++ modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/channel/ChannelTest.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -47,7 +47,7 @@
public static JavaArchive createTestArchive()
{
String pkgPath = ChannelTest.class.getPackage().getName().replaceAll("\\.", "/");
- JavaArchive archive = ShrinkWrap.create("test.jar", JavaArchive.class)
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class)
/**.addPackages(true, new DroolsModuleFilter("channel"), KnowledgeBaseProducer.class.getPackage())
.addPackages(true, ResourceProvider.class.getPackage())
.addClass(ChannelBean.class)
Modified: modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/customoperator/CustomOperatorTest.java
===================================================================
--- modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/customoperator/CustomOperatorTest.java 2010-09-27 15:28:45 UTC (rev 13782)
+++ modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/customoperator/CustomOperatorTest.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -47,7 +47,7 @@
public static JavaArchive createTestArchive()
{
String pkgPath = CustomOperatorTest.class.getPackage().getName().replaceAll("\\.", "/");
- JavaArchive archive = ShrinkWrap.create("test.jar", JavaArchive.class)
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class)
/**.addPackages(true, new DroolsModuleFilter("customoperator"), KnowledgeBaseProducer.class.getPackage())
.addPackages(true, ResourceProvider.class.getPackage())
.addClass(MessageBean.class)
Modified: modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/delegate/DelegateTest.java
===================================================================
--- modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/delegate/DelegateTest.java 2010-09-27 15:28:45 UTC (rev 13782)
+++ modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/delegate/DelegateTest.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -49,7 +49,7 @@
public static JavaArchive createTestArchive()
{
String pkgPath = DelegateTest.class.getPackage().getName().replaceAll("\\.", "/");
- JavaArchive archive = ShrinkWrap.create("test.jar", JavaArchive.class)
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class)
/**.addPackages(true, new DroolsModuleFilter("delegate"), KnowledgeBaseProducer.class.getPackage())
.addPackages(true, ResourceProvider.class.getPackage())
.addClass(DelegateBean.class)
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-09-27 15:28:45 UTC (rev 13782)
+++ modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/flow/FlowTest.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -51,7 +51,7 @@
public static JavaArchive createTestArchive()
{
String pkgPath = FlowTest.class.getPackage().getName().replaceAll("\\.", "/");
- JavaArchive archive = ShrinkWrap.create("test.jar", JavaArchive.class)
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class)
/**.addPackages(true, new DroolsModuleFilter("flow"), KnowledgeBaseProducer.class.getPackage())
.addPackages(true, ResourceProvider.class.getPackage())
.addClass(Person.class)
Modified: 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 2010-09-27 15:28:45 UTC (rev 13782)
+++ modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/interceptors/InterceptorsTest.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -52,7 +52,7 @@
public static JavaArchive createTestArchive()
{
String pkgPath = InterceptorsTest.class.getPackage().getName().replaceAll("\\.", "/");
- JavaArchive archive = ShrinkWrap.create("test.jar", JavaArchive.class)
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class)
/**.addPackages(true, new DroolsModuleFilter("interceptors"), KnowledgeBaseProducer.class.getPackage())
.addPackages(true, ResourceProvider.class.getPackage())
.addClass(Person.class).addClass(InterceptorsTestBean.class)
Modified: modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kagent/KAgentTest.java
===================================================================
--- modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kagent/KAgentTest.java 2010-09-27 15:28:45 UTC (rev 13782)
+++ modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kagent/KAgentTest.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -48,7 +48,7 @@
public static JavaArchive createTestArchive()
{
String pkgPath = KAgentTest.class.getPackage().getName().replaceAll("\\.", "/");
- JavaArchive archive = ShrinkWrap.create("test.jar", JavaArchive.class)
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class)
/**.addPackages(true, new DroolsModuleFilter("kagent"), KnowledgeBaseProducer.class.getPackage())
.addPackages(true, ResourceProvider.class.getPackage())
.addClass(Person.class)
Modified: modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kbase/KBaseTest.java
===================================================================
--- modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kbase/KBaseTest.java 2010-09-27 15:28:45 UTC (rev 13782)
+++ modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/kbase/KBaseTest.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -42,7 +42,7 @@
public static JavaArchive createTestArchive()
{
String pkgPath = KBaseTest.class.getPackage().getName().replaceAll("\\.", "/");
- JavaArchive archive = ShrinkWrap.create("test.jar", JavaArchive.class)
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class)
.addPackages(true, new DroolsModuleFilter("kbase"), KnowledgeBaseProducer.class.getPackage())
.addClass(CreditRules.class)
.addClass(DebitRules.class)
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-09-27 15:28:45 UTC (rev 13782)
+++ modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/ksession/KSessionTest.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -46,7 +46,7 @@
public static JavaArchive createTestArchive()
{
String pkgPath = KSessionTest.class.getPackage().getName().replaceAll("\\.", "/");
- JavaArchive archive = ShrinkWrap.create("test.jar", JavaArchive.class)
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class)
/**.addPackages(true, new DroolsModuleFilter("ksession"), KnowledgeBaseProducer.class.getPackage())
.addClass(KSessionTestRules.class)
.addClass(KSessionTestProducer.class)
Modified: modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/query/QueryTest.java
===================================================================
--- modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/query/QueryTest.java 2010-09-27 15:28:45 UTC (rev 13782)
+++ modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/query/QueryTest.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -52,7 +52,7 @@
public static JavaArchive createTestArchive()
{
String pkgPath = QueryTest.class.getPackage().getName().replaceAll("\\.", "/");
- JavaArchive archive = ShrinkWrap.create("test.jar", JavaArchive.class)
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class)
/**.addPackages(true, new DroolsModuleFilter("query"), KnowledgeBaseProducer.class.getPackage())
.addPackages(true, ResourceProvider.class.getPackage())
.addClass(Person.class)
Modified: modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/sessionreport/SessionReportTest.java
===================================================================
--- modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/sessionreport/SessionReportTest.java 2010-09-27 15:28:45 UTC (rev 13782)
+++ modules/drools/trunk/impl/src/test/java/org/jboss/seam/drools/test/sessionreport/SessionReportTest.java 2010-09-28 15:05:27 UTC (rev 13783)
@@ -53,7 +53,7 @@
public static JavaArchive createTestArchive()
{
String pkgPath = QueryTest.class.getPackage().getName().replaceAll("\\.", "/");
- JavaArchive archive = ShrinkWrap.create("test.jar", JavaArchive.class)
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class)
/**.addPackages(true, new DroolsModuleFilter("sessionreport"), KnowledgeBaseProducer.class.getPackage())
.addPackages(true, ResourceProvider.class.getPackage())
.addClass(Cheese.class)
Added: modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/cepalerting/CepAlertingTest-beans.xml
===================================================================
--- modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/cepalerting/CepAlertingTest-beans.xml (rev 0)
+++ modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/cepalerting/CepAlertingTest-beans.xml 2010-09-28 15:05:27 UTC (rev 13783)
@@ -0,0 +1,29 @@
+<!--
+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:ee"
+ xmlns:d="urn:java:org.jboss.seam.drools:org.jboss.seam.drools.config"
+ xmlns:test="urn:java:org.jboss.seam.drools.test.ksession">
+
+
+
+</beans>
Property changes on: modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/cepalerting/CepAlertingTest-beans.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: 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 2010-09-27 15:28:45 UTC (rev 13782)
+++ modules/drools/trunk/impl/src/test/resources/org/jboss/seam/drools/test/interceptors/InterceptorsTest-beans.xml 2010-09-28 15:05:27 UTC (rev 13783)
@@ -27,9 +27,9 @@
<interceptors>
<class>org.jboss.seam.drools.interceptor.InsertFactInterceptor</class>
<class>org.jboss.seam.drools.interceptor.FireRulesInterceptor</class>
- <class>org.jboss.seam.drools.interceptor.StartProcessInterceptor</class>
- <class>org.jboss.seam.drools.interceptor.SignalEventInterceptor</class>
- <class>org.jboss.seam.drools.interceptor.AbortProcessInterceptor</class>
+ <class>org.jboss.seam.drools.interceptor.flow.StartProcessInterceptor</class>
+ <class>org.jboss.seam.drools.interceptor.flow.SignalEventInterceptor</class>
+ <class>org.jboss.seam.drools.interceptor.flow.AbortProcessInterceptor</class>
</interceptors>
<!--<d:DefaultRuleResources>
Modified: modules/drools/trunk/pom.xml
===================================================================
--- modules/drools/trunk/pom.xml 2010-09-27 15:28:45 UTC (rev 13782)
+++ modules/drools/trunk/pom.xml 2010-09-28 15:05:27 UTC (rev 13783)
@@ -50,6 +50,10 @@
<drools.version>5.1.1</drools.version>
<seam.version>3.0.0.b01</seam.version>
<weld-extensions.version>1.0.0-SNAPSHOT</weld-extensions.version>
+ <stringtemplate.version>3.0</stringtemplate.version>
+ <antlr.version>2.7.6-brew</antlr.version>
+ <weld.version>1.1.0.Beta1</weld.version>
+ <arquillian.version>1.0.0.Alpha4</arquillian.version>
</properties>
<dependencyManagement>
14 years, 3 months
[pmuir/ticket-monster] 35ce97: implemented seat allocation algorithm, lots of min...
by noreply@github.com
Branch: refs/heads/master
Home: http://github.com/pmuir/ticket-monster
Commit: 35ce9747782c55ad63fc5686ecd99315831a3152
http://github.com/pmuir/ticket-monster/commit/35ce9747782c55ad63fc5686ecd...
Author: Shane Bryzak <shane.bryzak(a)jboss.com>
Date: 2010-09-28 (Tue, 28 Sep 2010)
Changed paths:
M core/src/main/java/org/jboss/seam/example/ticketmonster/action/BookingManager.java
M core/src/main/java/org/jboss/seam/example/ticketmonster/action/CacheConfig.java
A core/src/main/java/org/jboss/seam/example/ticketmonster/action/EventBooking.java
M core/src/main/java/org/jboss/seam/example/ticketmonster/action/EventDetail.java
M core/src/main/java/org/jboss/seam/example/ticketmonster/dto/RowAllocation.java
M core/src/main/java/org/jboss/seam/example/ticketmonster/model/Allocation.java
A core/src/main/java/org/jboss/seam/example/ticketmonster/qualifier/SectionRowCache.java
M jsf-ui/src/main/webapp/viewevent.xhtml
M pom.xml
Log Message:
-----------
implemented seat allocation algorithm, lots of minor stuff
14 years, 3 months
Seam SVN: r13782 - modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-09-27 11:28:45 -0400 (Mon, 27 Sep 2010)
New Revision: 13782
Modified:
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextBeanLifecycle.java
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextProxyHandler.java
Log:
work around lack of conversation context
Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextBeanLifecycle.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextBeanLifecycle.java 2010-09-26 22:25:36 UTC (rev 13781)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextBeanLifecycle.java 2010-09-27 15:28:45 UTC (rev 13782)
@@ -110,10 +110,19 @@
EntityManagerFactory emf = getEntityManagerFactory();
EntityManager entityManager = emf.createEntityManager();
entityManager = getPersistenceProvider(entityManager).proxyEntityManager(entityManager);
- ManagedPersistenceContextProxyHandler handler = new ManagedPersistenceContextProxyHandler(entityManager, manager, bean.getQualifiers(), getPersistenceContexts(), getPersistenceProvider(entityManager));
+ PersistenceContexts persistenceContexts = null;
+ try
+ {
+ persistenceContexts = getPersistenceContexts();
+ }
+ catch (ContextNotActiveException e)
+ {
+ // it's null already
+ }
+ ManagedPersistenceContextProxyHandler handler = new ManagedPersistenceContextProxyHandler(entityManager, manager, bean.getQualifiers(), persistenceContexts, getPersistenceProvider(entityManager));
EntityManager proxy = (EntityManager) proxyConstructor.newInstance(handler);
arg0.push(proxy);
- getPersistenceProvider(entityManager).setFlushMode(proxy, getPersistenceContexts().getFlushMode());
+ getPersistenceProvider(entityManager).setFlushMode(proxy, getFlushMode());
manager.fireEvent(new SeamManagedPersistenceContextCreated(proxy), qualifiers);
return proxy;
@@ -123,6 +132,19 @@
throw new RuntimeException(e);
}
}
+
+ private FlushModeType getFlushMode()
+ {
+ try
+ {
+ return getPersistenceContexts().getFlushMode();
+ }
+ catch (ContextNotActiveException e)
+ {
+ // TODO Set the default flush mode for the app
+ return FlushModeType.AUTO;
+ }
+ }
public void destroy(Bean<EntityManager> bean, EntityManager em, CreationalContext<EntityManager> arg1)
{
Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextProxyHandler.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextProxyHandler.java 2010-09-26 22:25:36 UTC (rev 13781)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextProxyHandler.java 2010-09-27 15:28:45 UTC (rev 13782)
@@ -173,7 +173,10 @@
{
// we need to do this first to prevent an infinite loop
persistenceContextsTouched = true;
- persistenceContexts.touch(delegate);
+ if (persistenceContexts != null)
+ {
+ persistenceContexts.touch(delegate);
+ }
}
catch (ContextNotActiveException e)
{
14 years, 3 months