Permalink
Browse files

migrate module to DevKit 3.3.2-SNAPSHOT. Added commong parent pom for…

… cloud connectors and removed duplicated config
  • Loading branch information...
1 parent e57addc commit cf8bce3936bca673c34c17dd07190200260bd228 Federico Recio committed Oct 25, 2012
Showing with 28 additions and 241 deletions.
  1. +4 −4 doc/Esper-connector.xml.sample
  2. +5 −230 pom.xml
  3. +19 −7 src/main/java/org/mule/module/esper/EsperModule.java
@@ -1,13 +1,13 @@
<!-- BEGIN_INCLUDE(esper:send-event) -->
- <esper:send event="#[payload:]" />
+ <esper:send eventPayload-ref="#[payload:]" />
<!-- END_INCLUDE(esper:send-event) -->
<!-- BEGIN_INCLUDE(esper:listen) -->
- <esper:listen statement="select count(*) from org.mule.api.MuleMessage.win:time_batch(10, 'FORCE_UPDATE, START_EAGER') having count(*) < 5" />
+ <esper:listen statement="select count(*) from org.mule.api.MuleMessage.win:time_batch(10, &#39;FORCE_UPDATE, START_EAGER&#39;) having count(*) &lt; 5" />
<!-- END_INCLUDE(esper:listen) -->
<!-- BEGIN_INCLUDE(esper:filter) -->
<esper:filter eventPayload-ref="#[payload:]"
- statement="select case when count(*) > 3 then false else true end from TestEvent.win:time(5 min)"
- key="case when count(*)>3 then false else true end"/>
+ statement="select case when count(*) &gt; 3 then false else true end from TestEvent.win:time(5 min)"
+ key="case when count(*)&gt;3 then false else true end"/>
<!-- END_INCLUDE(esper:filter) -->
View
235 pom.xml
@@ -8,205 +8,23 @@
<packaging>mule-module</packaging>
<name>Mule Esper Module</name>
- <properties>
- <mule.version>3.3.0</mule.version>
- <spring.version>3.1.1.RELEASE</spring.version>
- <mule.devkit.version>3.3.0</mule.devkit.version>
- <junit.version>4.9</junit.version>
- <mockito.version>1.8.2</mockito.version>
- <jdk.version>1.6</jdk.version>
- </properties>
-
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.mule.tools.devkit</groupId>
- <artifactId>mule-devkit-maven-plugin</artifactId>
- <version>${mule.devkit.version}</version>
- <extensions>true</extensions>
- </plugin>
- <plugin>
- <groupId>org.eclipse.m2e</groupId>
- <artifactId>lifecycle-mapping</artifactId>
- <version>1.0.0</version>
- <configuration>
- <lifecycleMappingMetadata>
- <pluginExecutions>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>org.mule.tools.devkit</groupId>
- <artifactId>mule-devkit-maven-plugin</artifactId>
- <versionRange>[2.0,)</versionRange>
- <goals>
- <goal>attach-test-resources</goal>
- <goal>filter-resources</goal>
- <goal>generate-sources</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <ignore/>
- </action>
- </pluginExecution>
- </pluginExecutions>
- </lifecycleMappingMetadata>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.3.2</version>
- <executions>
- <execution>
- <id>default-compile</id>
- <configuration>
- <compilerArgument>-proc:none</compilerArgument>
- <source>${jdk.version}</source>
- <target>${jdk.version}</target>
- </configuration>
- </execution>
- <execution>
- <id>default-testCompile</id>
- <configuration>
- <compilerArgument>-proc:none</compilerArgument>
- <source>${jdk.version}</source>
- <target>${jdk.version}</target>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.mule.tools.devkit</groupId>
- <artifactId>mule-devkit-maven-plugin</artifactId>
- <version>${mule.devkit.version}</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <version>2.1.2</version>
- <executions>
- <execution>
- <id>attach-sources</id>
- <goals>
- <goal>jar-no-fork</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>2.8</version>
- <executions>
- <execution>
- <id>attach-javadocs</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <excludePackageNames>org.mule.tooling.ui.contribution:*</excludePackageNames>
- <docletArtifact>
- <groupId>org.mule.tools.devkit</groupId>
- <artifactId>mule-devkit-doclet</artifactId>
- <version>${mule.devkit.version}</version>
- </docletArtifact>
- <doclet>org.mule.devkit.doclet.Doclava</doclet>
- <bootclasspath>${sun.boot.class.path}</bootclasspath>
- <additionalparam>
- -quiet
- -federate JDK http://download.oracle.com/javase/6/docs/api/index.html?
- -federationxml JDK http://doclava.googlecode.com/svn/static/api/openjdk-6.xml
- -hdf project.artifactId "${project.artifactId}"
- -hdf project.groupId "${project.groupId}"
- -hdf project.version "${project.version}"
- -hdf project.name "${project.name}"
- -hdf project.repo.name "${project.distributionManagement.repository.name}"
- -hdf project.repo.id "${project.distributionManagement.repository.id}"
- -hdf project.repo.url "${project.distributionManagement.repository.url}"
- -hdf project.snapshotRepo.name "${project.distributionManagement.snapshotRepository.name}"
- -hdf project.snapshotRepo.id "${project.distributionManagement.snapshotRepository.id}"
- -hdf project.snapshotRepo.url "${project.distributionManagement.snapshotRepository.url}"
- -d ${project.build.directory}/apidocs
- </additionalparam>
- <useStandardDocletOptions>false</useStandardDocletOptions>
- <additionalJOption>-J-Xmx1024m</additionalJOption>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-enforcer-plugin</artifactId>
- <version>1.0-alpha-4</version>
- <executions>
- <execution>
- <id>enforce-maven-version</id>
- <goals>
- <goal>enforce</goal>
- </goals>
- <configuration>
- <rules>
- <requireMavenVersion>
- <version>[3.0.0,)</version>
- </requireMavenVersion>
- <requireJavaVersion>
- <version>[1.6.0,)</version>
- </requireJavaVersion>
- </rules>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- <resources>
- <resource>
- <filtering>false</filtering>
- <directory>src/main/resources</directory>
- </resource>
- <resource>
- <filtering>true</filtering>
- <directory>src/test/resources</directory>
- </resource>
- </resources>
- </build>
+ <parent>
+ <groupId>org.mule.tools.devkit</groupId>
+ <artifactId>mule-devkit-parent</artifactId>
+ <version>3.3.2-SNAPSHOT</version>
+ </parent>
<dependencies>
- <dependency>
- <groupId>org.mule</groupId>
- <artifactId>mule-core</artifactId>
- <version>${mule.version}</version>
- <scope>provided</scope>
- </dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-spring-config</artifactId>
<version>${mule.version}</version>
</dependency>
- <dependency>
- <groupId>org.mule.tools.devkit</groupId>
- <artifactId>mule-devkit-annotations</artifactId>
- <version>${mule.devkit.version}</version>
- </dependency>
<dependency>
<groupId>oauth.signpost</groupId>
<artifactId>signpost-core</artifactId>
<version>1.2.1.1</version>
</dependency>
- <dependency>
- <groupId>org.eclipse</groupId>
- <artifactId>eclipse-workbench</artifactId>
- <version>3.6.1.M20100826-1330</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse</groupId>
- <artifactId>eclipse-runtime</artifactId>
- <version>3.6.0.v20100505</version>
- <scope>provided</scope>
- </dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>core</artifactId>
@@ -218,12 +36,6 @@
<artifactId>esper</artifactId>
<version>4.4.0</version>
</dependency>
- <dependency>
- <groupId>org.mule.tests</groupId>
- <artifactId>mule-tests-functional</artifactId>
- <version>${mule.version}</version>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-vm</artifactId>
@@ -236,24 +48,12 @@
<version>${mule.version}</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${junit.version}</version>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.mule.tests</groupId>
- <artifactId>mule-tests-functional</artifactId>
- <version>${mule.version}</version>
- <scope>test</scope>
- </dependency>
</dependencies>
<repositories>
@@ -276,31 +76,6 @@
</repository>
</repositories>
- <pluginRepositories>
- <pluginRepository>
- <id>mulesoft-plugin-releases</id>
- <name>MuleSoft Release Repository</name>
- <url>http://repository.mulesoft.org/releases/</url>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </pluginRepository>
- <pluginRepository>
- <id>mulesoft-plugin-snapshots</id>
- <name>MuleSoft Snapshot Repository</name>
- <url>http://repository.mulesoft.org/snapshots/</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </pluginRepository>
- </pluginRepositories>
-
<scm>
<connection>scm:git:git://github.com:mulesoft/mule-module-esper.git
</connection>
@@ -773,10 +773,6 @@
*/
package org.mule.module.esper;
-import com.espertech.esper.client.*;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.mule.api.ConnectionException;
import org.mule.api.MuleContext;
import org.mule.api.annotations.Configurable;
@@ -786,14 +782,26 @@
import org.mule.api.annotations.param.Optional;
import org.mule.api.callback.SourceCallback;
import org.mule.api.context.MuleContextAware;
-import org.w3c.dom.Node;
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
+import com.espertech.esper.client.Configuration;
+import com.espertech.esper.client.EPServiceProvider;
+import com.espertech.esper.client.EPServiceProviderManager;
+import com.espertech.esper.client.EPStatement;
+import com.espertech.esper.client.EventBean;
+import com.espertech.esper.client.SafeIterator;
+
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.w3c.dom.Node;
+
/**
* A Mule Module for <a href="http://esper.codehaus.org/">Esper</a>, a GPL licensed complex event processing
* engine.
@@ -948,4 +956,8 @@ public synchronized void filter(@Optional Object eventPayload, String statement,
}
}
+
+ public String getConfiguration() {
+ return configuration;
+ }
}

0 comments on commit cf8bce3

Please sign in to comment.