You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by je...@apache.org on 2010/07/01 06:18:40 UTC
svn commit: r959497 - in /ode/trunk: ./
bpel-epr/src/main/java/org/apache/ode/il/ bpel-runtime/
bpel-runtime/src/main/java/org/apache/ode/bpel/engine/replayer/
bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/
bpel-runtime/src/test/java/...
Author: jeffyu
Date: Thu Jul 1 04:18:39 2010
New Revision: 959497
URL: http://svn.apache.org/viewvc?rev=959497&view=rev
Log:
*ODE-808, Added back the @ChannelType annotation, and the jacob-ap module.
*Added all profile for re-generating ChannelListener classes etc.
Added:
ode/trunk/jacob/src/main/java/org/apache/ode/jacob/ap/
ode/trunk/jacob/src/main/java/org/apache/ode/jacob/ap/ChannelType.java
Removed:
ode/trunk/jacob-ap/src/main/java/org/apache/ode/jacob/ap/ChannelType.java
Modified:
ode/trunk/bpel-epr/src/main/java/org/apache/ode/il/MockScheduler.java
ode/trunk/bpel-runtime/pom.xml
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/replayer/ReplayerScheduler.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/ActivityRecovery.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/Compensation.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/EventHandlerControl.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/InvokeResponse.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/LinkStatus.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/ParentScope.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/PickResponse.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/ReadWriteLock.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/Termination.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/TimerResponse.java
ode/trunk/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/MockBpelServer.java
ode/trunk/jacob-ap/pom.xml
ode/trunk/jacob-ap/src/main/java/org/apache/ode/jacob/ap/ChannelTypeAnnotationProcessor.java
ode/trunk/jacob-ap/src/main/java/org/apache/ode/jacob/ap/JacobAnnotationProcessorFactory.java
ode/trunk/jacob/pom.xml
ode/trunk/jacob/src/main/java/org/apache/ode/jacob/Synch.java
ode/trunk/jacob/src/main/java/org/apache/ode/jacob/Val.java
ode/trunk/jacob/src/main/java/org/apache/ode/jacob/examples/cell/Cell.java
ode/trunk/jacob/src/main/java/org/apache/ode/jacob/examples/eratosthenes/NaturalNumberStream.java
ode/trunk/jacob/src/main/java/org/apache/ode/jacob/examples/synch/SynchPrint.java
ode/trunk/pom.xml
Modified: ode/trunk/bpel-epr/src/main/java/org/apache/ode/il/MockScheduler.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-epr/src/main/java/org/apache/ode/il/MockScheduler.java?rev=959497&r1=959496&r2=959497&view=diff
==============================================================================
--- ode/trunk/bpel-epr/src/main/java/org/apache/ode/il/MockScheduler.java (original)
+++ ode/trunk/bpel-epr/src/main/java/org/apache/ode/il/MockScheduler.java Thu Jul 1 04:18:39 2010
@@ -322,7 +322,7 @@ public class MockScheduler implements Sc
return true;
}
- @Override
+
public void acquireTransactionLocks() {
// TODO Auto-generated method stub
Modified: ode/trunk/bpel-runtime/pom.xml
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/pom.xml?rev=959497&r1=959496&r2=959497&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/pom.xml (original)
+++ ode/trunk/bpel-runtime/pom.xml Thu Jul 1 04:18:39 2010
@@ -204,5 +204,35 @@
<scope>test</scope>
</dependency>
</dependencies>
+
+ <build>
+ <plugins>
+ <!-- uncomment it for @ChannelType classes regeneration -->
+ <!--plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>apt-maven-plugin</artifactId>
+ <version>1.0-alpha-3</version>
+ <configuration>
+ <factory>org.apache.ode.jacob.ap.JacobAnnotationProcessorFactory</factory>
+ <outputDirectory>src/main/java</outputDirectory>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>process</goal>
+ <goal>test-process</goal>
+ </goals>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.ode</groupId>
+ <artifactId>ode-jacob-ap</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+ </plugin-->
+ </plugins>
+ </build>
</project>
Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/replayer/ReplayerScheduler.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/replayer/ReplayerScheduler.java?rev=959497&r1=959496&r2=959497&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/replayer/ReplayerScheduler.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/replayer/ReplayerScheduler.java Thu Jul 1 04:18:39 2010
@@ -157,7 +157,6 @@ public class ReplayerScheduler implement
return null;
}
- @Override
public void acquireTransactionLocks() {
// TODO Auto-generated method stub
Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/ActivityRecovery.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/ActivityRecovery.java?rev=959497&r1=959496&r2=959497&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/ActivityRecovery.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/ActivityRecovery.java Thu Jul 1 04:18:39 2010
@@ -18,10 +18,9 @@
*/
package org.apache.ode.bpel.runtime.channels;
+import org.apache.ode.jacob.ap.ChannelType;
-
-/**
- */
+@ChannelType
public interface ActivityRecovery {
/**
Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/Compensation.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/Compensation.java?rev=959497&r1=959496&r2=959497&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/Compensation.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/Compensation.java Thu Jul 1 04:18:39 2010
@@ -19,9 +19,9 @@
package org.apache.ode.bpel.runtime.channels;
import org.apache.ode.jacob.SynchChannel;
+import org.apache.ode.jacob.ap.ChannelType;
-/**
- */
+@ChannelType
public interface Compensation {
public void forget();
Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/EventHandlerControl.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/EventHandlerControl.java?rev=959497&r1=959496&r2=959497&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/EventHandlerControl.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/EventHandlerControl.java Thu Jul 1 04:18:39 2010
@@ -18,10 +18,12 @@
*/
package org.apache.ode.bpel.runtime.channels;
+import org.apache.ode.jacob.ap.ChannelType;
/**
* Channel used to control processing of event handler activities.
*/
+@ChannelType
public interface EventHandlerControl {
/**
Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/InvokeResponse.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/InvokeResponse.java?rev=959497&r1=959496&r2=959497&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/InvokeResponse.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/InvokeResponse.java Thu Jul 1 04:18:39 2010
@@ -18,10 +18,12 @@
*/
package org.apache.ode.bpel.runtime.channels;
+import org.apache.ode.jacob.ap.ChannelType;
/**
* Response channel for pick requests.
*/
+@ChannelType
public interface InvokeResponse {
public void onResponse();
Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/LinkStatus.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/LinkStatus.java?rev=959497&r1=959496&r2=959497&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/LinkStatus.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/LinkStatus.java Thu Jul 1 04:18:39 2010
@@ -18,9 +18,11 @@
*/
package org.apache.ode.bpel.runtime.channels;
+import org.apache.ode.jacob.ap.ChannelType;
/**
*/
+@ChannelType
public interface LinkStatus {
void linkStatus(boolean value);
Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/ParentScope.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/ParentScope.java?rev=959497&r1=959496&r2=959497&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/ParentScope.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/ParentScope.java Thu Jul 1 04:18:39 2010
@@ -24,10 +24,13 @@ import org.apache.ode.bpel.o.OScope;
import org.apache.ode.bpel.runtime.CompensationHandler;
import org.apache.ode.jacob.SynchChannel;
import org.w3c.dom.Element;
+import org.apache.ode.jacob.ap.ChannelType;
+
/**
* Channel used for child-to-parent scope communication.
*/
+@ChannelType
public interface ParentScope {
void compensate(OScope scope, SynchChannel ret);
Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/PickResponse.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/PickResponse.java?rev=959497&r1=959496&r2=959497&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/PickResponse.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/PickResponse.java Thu Jul 1 04:18:39 2010
@@ -18,12 +18,15 @@
*/
package org.apache.ode.bpel.runtime.channels;
+import org.apache.ode.jacob.ap.ChannelType;
+
/**
* Response channel for pick requests.
* @jacob.kind
* @jacob.parent TimerResponseChannel
*/
+@ChannelType
public interface PickResponse extends TimerResponse {
public void onRequestRcvd(int selectorIdx, String mexId);
Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/ReadWriteLock.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/ReadWriteLock.java?rev=959497&r1=959496&r2=959497&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/ReadWriteLock.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/ReadWriteLock.java Thu Jul 1 04:18:39 2010
@@ -19,7 +19,9 @@
package org.apache.ode.bpel.runtime.channels;
import org.apache.ode.jacob.SynchChannel;
+import org.apache.ode.jacob.ap.ChannelType;
+@ChannelType
public interface ReadWriteLock {
public void readLock(SynchChannel s);
Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/Termination.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/Termination.java?rev=959497&r1=959496&r2=959497&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/Termination.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/Termination.java Thu Jul 1 04:18:39 2010
@@ -18,11 +18,14 @@
*/
package org.apache.ode.bpel.runtime.channels;
+import org.apache.ode.jacob.ap.ChannelType;
+
/**
* Channel used for parent-to-child scope communication.
*/
+@ChannelType
public interface Termination {
/**
Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/TimerResponse.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/TimerResponse.java?rev=959497&r1=959496&r2=959497&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/TimerResponse.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/TimerResponse.java Thu Jul 1 04:18:39 2010
@@ -18,10 +18,13 @@
*/
package org.apache.ode.bpel.runtime.channels;
+import org.apache.ode.jacob.ap.ChannelType;
+
/**
* Channel for timer notification.
*/
+@ChannelType
public interface TimerResponse {
/** timer event has occurred */
public void onTimeout();
Modified: ode/trunk/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/MockBpelServer.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/MockBpelServer.java?rev=959497&r1=959496&r2=959497&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/MockBpelServer.java (original)
+++ ode/trunk/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/MockBpelServer.java Thu Jul 1 04:18:39 2010
@@ -421,7 +421,7 @@ class MockBpelServer {
return true;
}
- @Override
+
public void acquireTransactionLocks() {
// TODO Auto-generated method stub
Modified: ode/trunk/jacob-ap/pom.xml
URL: http://svn.apache.org/viewvc/ode/trunk/jacob-ap/pom.xml?rev=959497&r1=959496&r2=959497&view=diff
==============================================================================
--- ode/trunk/jacob-ap/pom.xml (original)
+++ ode/trunk/jacob-ap/pom.xml Thu Jul 1 04:18:39 2010
@@ -0,0 +1,45 @@
+<?xml version="1.0"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<project>
+ <groupId>org.apache.ode</groupId>
+ <artifactId>ode-jacob-ap</artifactId>
+ <packaging>jar</packaging>
+ <name>ODE :: Java Concurrent Objects (JACOB) - APT</name>
+
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.ode</groupId>
+ <artifactId>ode</artifactId>
+ <version>1.3.5-SNAPSHOT</version>
+ </parent>
+
+ <dependencies>
+ <dependency>
+ <groupId>sun.jdk</groupId>
+ <artifactId>tools</artifactId>
+ <version>1.5.0</version>
+ <scope>system</scope>
+ <systemPath>${java.home}/../lib/tools.jar</systemPath>
+ </dependency>
+ </dependencies>
+
+
+</project>
Modified: ode/trunk/jacob-ap/src/main/java/org/apache/ode/jacob/ap/ChannelTypeAnnotationProcessor.java
URL: http://svn.apache.org/viewvc/ode/trunk/jacob-ap/src/main/java/org/apache/ode/jacob/ap/ChannelTypeAnnotationProcessor.java?rev=959497&r1=959496&r2=959497&view=diff
==============================================================================
--- ode/trunk/jacob-ap/src/main/java/org/apache/ode/jacob/ap/ChannelTypeAnnotationProcessor.java (original)
+++ ode/trunk/jacob-ap/src/main/java/org/apache/ode/jacob/ap/ChannelTypeAnnotationProcessor.java Thu Jul 1 04:18:39 2010
@@ -0,0 +1,144 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.jacob.ap;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Collection;
+import java.util.Date;
+
+import com.sun.mirror.apt.AnnotationProcessor;
+import com.sun.mirror.apt.AnnotationProcessorEnvironment;
+import com.sun.mirror.declaration.AnnotationTypeDeclaration;
+import com.sun.mirror.declaration.InterfaceDeclaration;
+import com.sun.mirror.type.InterfaceType;
+import com.sun.mirror.util.DeclarationFilter;
+
+class ChannelTypeAnnotationProcessor implements AnnotationProcessor {
+
+ AnnotationProcessorEnvironment _env;
+ AnnotationTypeDeclaration _atd;
+
+ ChannelTypeAnnotationProcessor(AnnotationTypeDeclaration atd, AnnotationProcessorEnvironment env) {
+ _atd = atd;
+ _env = env;
+ }
+
+ public void process() {
+ Collection<InterfaceDeclaration> channels = DeclarationFilter.getFilter(InterfaceDeclaration.class).filter(_env.getDeclarationsAnnotatedWith(_atd),InterfaceDeclaration.class);
+ for (InterfaceDeclaration c : channels) {
+ PrintWriter pw = null;
+ try {
+ pw = _env.getFiler().createSourceFile(c.getQualifiedName() + "Channel");
+ writeChannelClass(pw, c);
+ } catch (IOException e) {
+ _env.getMessager().printError(c.getPosition(), "IO Error: " + e.getMessage());
+ } finally {
+ if (pw != null) pw.close();
+ pw = null;
+ }
+
+ try {
+ pw = _env.getFiler().createSourceFile(c.getQualifiedName() + "ChannelListener");
+ writeChannelListenerClass(pw, c);
+ } catch (IOException e) {
+ _env.getMessager().printError(c.getPosition(), "IO Error: " + e.getMessage());
+ } finally {
+ if (pw != null) pw.close();
+ pw = null;
+ }
+
+ }
+ }
+
+
+ private void writeChannelClass(PrintWriter pw, InterfaceDeclaration c) {
+ pw.println("/*");
+ pw.println(" * SOURCE FILE GENERATATED BY JACOB CHANNEL CLASS GENERATOR");
+ pw.println(" * ");
+ pw.println(" * !!! DO NOT EDIT !!!! ");
+ pw.println(" * ");
+ pw.println(" * Generated On : " + new Date());
+ pw.println(" * For Interface : " + c.getQualifiedName());
+ pw.println(" */");
+ pw.println();
+ pw.println("package " + c.getPackage().getQualifiedName() + ";");
+ pw.println();
+
+ pw.println("/**");
+ pw.println(" * An auto-generated channel interface for the channel type");
+ pw.println(" * {@link " + c.getQualifiedName() + "}.");
+ pw.println(" * @see " + c.getQualifiedName() );
+ pw.println(" * @see " + c.getQualifiedName() + "ChannelListener");
+ pw.println(" */");
+ pw.println("public interface " + c.getSimpleName() + "Channel");
+
+ Collection<InterfaceType> supers = c.getSuperinterfaces();
+ if (supers.isEmpty()) {
+ pw.println(" extends org.apache.ode.jacob.Channel, ");
+ } else {
+ pw.print(" extends ");
+ for (InterfaceType s : supers)
+ pw.println(" "+ s.getDeclaration().getQualifiedName() + "Channel, ");
+ pw.println (" org.apache.ode.jacob.Channel, ");
+ }
+
+ pw.println(" " + c.getQualifiedName());
+ pw.println("{}");
+ pw.flush();
+ }
+
+ private void writeChannelListenerClass(PrintWriter pw, InterfaceDeclaration c) {
+ pw.println("/*");
+ pw.println(" * SOURCE FILE GENERATATED BY JACOB CHANNEL CLASS GENERATOR");
+ pw.println(" * ");
+ pw.println(" * !!! DO NOT EDIT !!!! ");
+ pw.println(" * ");
+ pw.println(" * Generated On : " + new Date());
+ pw.println(" * For Interface : " + c.getQualifiedName());
+ pw.println(" */");
+ pw.println();
+ pw.println("package " + c.getPackage().getQualifiedName() + ";");
+ pw.println();
+ pw.println("import org.apache.commons.logging.LogFactory;");
+ pw.println("import org.apache.commons.logging.Log;");
+ pw.println();
+ pw.println("/**");
+ pw.println(" * An auto-generated channel listener abstract class for the ");
+ pw.println(" * {@link " + c.getQualifiedName() + "} channel type. ");
+ pw.println(" * @see " + c.getQualifiedName() );
+ pw.println(" * @see " + c.getQualifiedName() + "Channel");
+ pw.println(" */");
+ pw.println("public abstract class " + c.getSimpleName() + "ChannelListener");
+ pw.println(" extends org.apache.ode.jacob.ChannelListener<" + c.getQualifiedName() + "Channel>" );
+ pw.println(" implements " + c.getQualifiedName());
+ pw.println("{");
+ pw.println();
+ pw.println(" private static final Log __log = LogFactory.getLog(" + c.getQualifiedName() + ".class);");
+ pw.println();
+ pw.println(" protected Log log() { return __log; } " );
+ pw.println();
+ pw.println(" protected " + c.getSimpleName() + "ChannelListener(" + c.getQualifiedName() + "Channel channel) {");
+ pw.println(" super(channel);");
+ pw.println(" }");
+ pw.println("}");
+ pw.flush();
+ }
+
+}
Modified: ode/trunk/jacob-ap/src/main/java/org/apache/ode/jacob/ap/JacobAnnotationProcessorFactory.java
URL: http://svn.apache.org/viewvc/ode/trunk/jacob-ap/src/main/java/org/apache/ode/jacob/ap/JacobAnnotationProcessorFactory.java?rev=959497&r1=959496&r2=959497&view=diff
==============================================================================
--- ode/trunk/jacob-ap/src/main/java/org/apache/ode/jacob/ap/JacobAnnotationProcessorFactory.java (original)
+++ ode/trunk/jacob-ap/src/main/java/org/apache/ode/jacob/ap/JacobAnnotationProcessorFactory.java Thu Jul 1 04:18:39 2010
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.jacob.ap;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+import com.sun.mirror.apt.AnnotationProcessor;
+import com.sun.mirror.apt.AnnotationProcessorEnvironment;
+import com.sun.mirror.apt.AnnotationProcessorFactory;
+import com.sun.mirror.apt.AnnotationProcessors;
+import com.sun.mirror.declaration.AnnotationTypeDeclaration;
+
+public class JacobAnnotationProcessorFactory implements AnnotationProcessorFactory {
+
+ private static final List<String> __supported = Arrays.asList(
+ new String[] { "org.apache.ode.jacob.ap.ChannelType" });
+
+ public Collection<String> supportedOptions() {
+ return Collections.emptyList();
+ }
+
+ public Collection<String> supportedAnnotationTypes() {
+ return __supported;
+ }
+
+ public AnnotationProcessor getProcessorFor(Set<AnnotationTypeDeclaration> atd, AnnotationProcessorEnvironment ape) {
+
+ if (atd.isEmpty())
+ return AnnotationProcessors.NO_OP;
+
+ for (AnnotationTypeDeclaration a: atd) {
+ if (a.getQualifiedName().equals("org.apache.ode.jacob.ap.ChannelType"))
+ return new ChannelTypeAnnotationProcessor(a,ape);
+ }
+ return AnnotationProcessors.NO_OP;
+ }
+
+}
Modified: ode/trunk/jacob/pom.xml
URL: http://svn.apache.org/viewvc/ode/trunk/jacob/pom.xml?rev=959497&r1=959496&r2=959497&view=diff
==============================================================================
--- ode/trunk/jacob/pom.xml (original)
+++ ode/trunk/jacob/pom.xml Thu Jul 1 04:18:39 2010
@@ -45,4 +45,34 @@
<scope>test</scope>
</dependency>
</dependencies>
+
+ <build>
+ <plugins>
+ <!-- uncomment it for @ChannelType classes regeneration -->
+ <!--plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>apt-maven-plugin</artifactId>
+ <version>1.0-alpha-3</version>
+ <configuration>
+ <factory>org.apache.ode.jacob.ap.JacobAnnotationProcessorFactory</factory>
+ <outputDirectory>src/main/java</outputDirectory>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>process</goal>
+ <goal>test-process</goal>
+ </goals>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.ode</groupId>
+ <artifactId>ode-jacob-ap</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+ </plugin-->
+ </plugins>
+ </build>
</project>
Modified: ode/trunk/jacob/src/main/java/org/apache/ode/jacob/Synch.java
URL: http://svn.apache.org/viewvc/ode/trunk/jacob/src/main/java/org/apache/ode/jacob/Synch.java?rev=959497&r1=959496&r2=959497&view=diff
==============================================================================
--- ode/trunk/jacob/src/main/java/org/apache/ode/jacob/Synch.java (original)
+++ ode/trunk/jacob/src/main/java/org/apache/ode/jacob/Synch.java Thu Jul 1 04:18:39 2010
@@ -18,6 +18,7 @@
*/
package org.apache.ode.jacob;
+import org.apache.ode.jacob.ap.ChannelType;
/**
* Synch represents a synchronous invocation callback notification.
@@ -26,6 +27,8 @@ package org.apache.ode.jacob;
*
* @author Maciej Szefler <a href="mailto:mbs@fivesight.com">mbs</a>
*/
+
+@ChannelType
public interface Synch {
public void ret();
}
Modified: ode/trunk/jacob/src/main/java/org/apache/ode/jacob/Val.java
URL: http://svn.apache.org/viewvc/ode/trunk/jacob/src/main/java/org/apache/ode/jacob/Val.java?rev=959497&r1=959496&r2=959497&view=diff
==============================================================================
--- ode/trunk/jacob/src/main/java/org/apache/ode/jacob/Val.java (original)
+++ ode/trunk/jacob/src/main/java/org/apache/ode/jacob/Val.java Thu Jul 1 04:18:39 2010
@@ -18,9 +18,12 @@
*/
package org.apache.ode.jacob;
+import org.apache.ode.jacob.ap.ChannelType;
+
/**
* Generic return-value channel type.
*/
+@ChannelType
public interface Val {
public void val(Object retVal);
}
Added: ode/trunk/jacob/src/main/java/org/apache/ode/jacob/ap/ChannelType.java
URL: http://svn.apache.org/viewvc/ode/trunk/jacob/src/main/java/org/apache/ode/jacob/ap/ChannelType.java?rev=959497&view=auto
==============================================================================
--- ode/trunk/jacob/src/main/java/org/apache/ode/jacob/ap/ChannelType.java (added)
+++ ode/trunk/jacob/src/main/java/org/apache/ode/jacob/ap/ChannelType.java Thu Jul 1 04:18:39 2010
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.jacob.ap;
+
+/**
+ * Annotation used to indicate that an interface is a JACOB channel interface.
+ * @author Maciej Szefler <mszefler at gmail dot com>
+ */
+public @interface ChannelType {
+
+}
Modified: ode/trunk/jacob/src/main/java/org/apache/ode/jacob/examples/cell/Cell.java
URL: http://svn.apache.org/viewvc/ode/trunk/jacob/src/main/java/org/apache/ode/jacob/examples/cell/Cell.java?rev=959497&r1=959496&r2=959497&view=diff
==============================================================================
--- ode/trunk/jacob/src/main/java/org/apache/ode/jacob/examples/cell/Cell.java (original)
+++ ode/trunk/jacob/src/main/java/org/apache/ode/jacob/examples/cell/Cell.java Thu Jul 1 04:18:39 2010
@@ -19,12 +19,15 @@
package org.apache.ode.jacob.examples.cell;
import org.apache.ode.jacob.Val;
+import org.apache.ode.jacob.ap.ChannelType;
+
/**
* Channel type for a cell. The channel allows reading of and setting the values of a cell.
*
* @jacob.kind
*/
+@ChannelType
public interface Cell {
/**
Modified: ode/trunk/jacob/src/main/java/org/apache/ode/jacob/examples/eratosthenes/NaturalNumberStream.java
URL: http://svn.apache.org/viewvc/ode/trunk/jacob/src/main/java/org/apache/ode/jacob/examples/eratosthenes/NaturalNumberStream.java?rev=959497&r1=959496&r2=959497&view=diff
==============================================================================
--- ode/trunk/jacob/src/main/java/org/apache/ode/jacob/examples/eratosthenes/NaturalNumberStream.java (original)
+++ ode/trunk/jacob/src/main/java/org/apache/ode/jacob/examples/eratosthenes/NaturalNumberStream.java Thu Jul 1 04:18:39 2010
@@ -19,6 +19,7 @@
package org.apache.ode.jacob.examples.eratosthenes;
import org.apache.ode.jacob.SynchChannel;
+import org.apache.ode.jacob.ap.ChannelType;
/**
* DOCUMENTME.
@@ -27,6 +28,7 @@ import org.apache.ode.jacob.SynchChannel
* @jacob.kind
* @author Maciej Szefler <a href="mailto:mbs@fivesight.com">mbs</a>
*/
+@ChannelType
public interface NaturalNumberStream {
public void val(int n, SynchChannel ret);
}
Modified: ode/trunk/jacob/src/main/java/org/apache/ode/jacob/examples/synch/SynchPrint.java
URL: http://svn.apache.org/viewvc/ode/trunk/jacob/src/main/java/org/apache/ode/jacob/examples/synch/SynchPrint.java?rev=959497&r1=959496&r2=959497&view=diff
==============================================================================
--- ode/trunk/jacob/src/main/java/org/apache/ode/jacob/examples/synch/SynchPrint.java (original)
+++ ode/trunk/jacob/src/main/java/org/apache/ode/jacob/examples/synch/SynchPrint.java Thu Jul 1 04:18:39 2010
@@ -19,6 +19,7 @@
package org.apache.ode.jacob.examples.synch;
import org.apache.ode.jacob.SynchChannel;
+import org.apache.ode.jacob.ap.ChannelType;
/**
* DOCUMENTME.
@@ -26,7 +27,7 @@ import org.apache.ode.jacob.SynchChannel
*
* @author Maciej Szefler <a href="mailto:mbs@fivesight.com">mbs</a>
*/
-
+@ChannelType
public interface SynchPrint {
public SynchChannel print(String msg);
}
Modified: ode/trunk/pom.xml
URL: http://svn.apache.org/viewvc/ode/trunk/pom.xml?rev=959497&r1=959496&r2=959497&view=diff
==============================================================================
--- ode/trunk/pom.xml (original)
+++ ode/trunk/pom.xml Thu Jul 1 04:18:39 2010
@@ -159,9 +159,6 @@
<module>jbi-karaf</module>
<module>distro/src/examples-jbi/maven2/ping-pong-osgi</module>
<module>axis2-war</module>
- <!--
- <module>distro</module>
- -->
</modules>
<build>
@@ -992,5 +989,51 @@
</plugins>
</build>
</profile>
+
+ <profile>
+ <id>distro</id>
+ <modules>
+ <module>distro</module>
+ </modules>
+ </profile>
+ <profile>
+ <!-- To run this profile, you need to uncomment the apt plugin in jacob and bpel-runtime module first.
+ And then run this profile, those classes with @ChannelType will be regenerated. -->
+ <id>all</id>
+ <modules>
+ <module>agents</module>
+ <module>utils</module>
+ <module>jacob-ap</module>
+ <module>jacob</module>
+ <module>bpel-schemas</module>
+ <module>bpel-scripts</module>
+ <module>bpel-api</module>
+ <module>bpel-api-jca</module>
+ <module>bpel-dao</module>
+ <module>bpel-obj</module>
+ <module>dao-jpa</module>
+ <module>jca-ra</module>
+ <module>jca-server</module>
+ <module>scheduler-simple</module>
+ <module>bpel-compiler</module>
+ <module>bpel-epr</module>
+ <module>bpel-ql</module>
+ <module>dao-hibernate</module>
+ <module>tools</module>
+ <module>bpel-store</module>
+ <module>dao-jpa-ojpa-derby</module>
+ <module>dao-hibernate-db</module>
+ <module>bpel-runtime</module>
+ <module>bpel-connector</module>
+ <module>bpel-test</module>
+ <module>axis2</module>
+ <module>jbi</module>
+ <module>jbi-bundle</module>
+ <module>jbi-karaf</module>
+ <module>distro/src/examples-jbi/maven2/ping-pong-osgi</module>
+ <module>axis2-war</module>
+ <module>distro</module>
+ </modules>
+ </profile>
</profiles>
</project>