You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by ha...@apache.org on 2013/01/16 21:52:15 UTC

svn commit: r1434384 - in /ode/trunk/jacob/src/main/java/org/apache/ode/jacob: JacobObject.java JacobThread.java vpu/ChannelFactory.java vpu/ExecutionQueueImpl.java vpu/JacobVPU.java

Author: hadrian
Date: Wed Jan 16 20:52:14 2013
New Revision: 1434384

URL: http://svn.apache.org/viewvc?rev=1434384&view=rev
Log:
ODE-987. Eliminate more dependencies on ExportableChannel

Modified:
    ode/trunk/jacob/src/main/java/org/apache/ode/jacob/JacobObject.java
    ode/trunk/jacob/src/main/java/org/apache/ode/jacob/JacobThread.java
    ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/ChannelFactory.java
    ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/ExecutionQueueImpl.java
    ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/JacobVPU.java

Modified: ode/trunk/jacob/src/main/java/org/apache/ode/jacob/JacobObject.java
URL: http://svn.apache.org/viewvc/ode/trunk/jacob/src/main/java/org/apache/ode/jacob/JacobObject.java?rev=1434384&r1=1434383&r2=1434384&view=diff
==============================================================================
--- ode/trunk/jacob/src/main/java/org/apache/ode/jacob/JacobObject.java (original)
+++ ode/trunk/jacob/src/main/java/org/apache/ode/jacob/JacobObject.java Wed Jan 16 20:52:14 2013
@@ -44,7 +44,7 @@ public abstract class JacobObject implem
     }
 
     @SuppressWarnings("unchecked")
-    protected static <T extends ExportableChannel> T importChannel(String channelId, Class<T> channelClass) {
+    protected static <T extends Channel> T importChannel(String channelId, Class<T> channelClass) {
         return (T) JacobVPU.activeJacobThread().importChannel(channelId, channelClass);
     }
 
@@ -58,7 +58,7 @@ public abstract class JacobObject implem
         JacobVPU.activeJacobThread().instance(concretion);
     }
 
-    protected <T extends ExportableChannel> T newChannel(Class<T> channelType)
+    protected <T extends Channel> T newChannel(Class<T> channelType)
             throws IllegalArgumentException
     {
         return newChannel(channelType, null);
@@ -69,7 +69,7 @@ public abstract class JacobObject implem
      * is equivalent to <code>(new x) ... </code> in the process calculus.
      */
     @SuppressWarnings("unchecked")
-    protected <T extends ExportableChannel> T newChannel(Class<T> channelType, String description)
+    protected <T extends Channel> T newChannel(Class<T> channelType, String description)
         throws IllegalArgumentException
     {
         return (T) JacobVPU.activeJacobThread().newChannel(channelType, getClassName(), description);
@@ -82,9 +82,9 @@ public abstract class JacobObject implem
      * @param methodList method list for the communication reduction
      * @see JacobThread#object
      */
-    protected static ExportableChannel object(ChannelListener methodList) {
+    protected static Channel object(ChannelListener methodList) {
         JacobVPU.activeJacobThread().object(false, methodList);
-        return (ExportableChannel)methodList.getChannel();
+        return methodList.getChannel();
     }
 
     protected static void object(boolean replication, ChannelListener methodList) {
@@ -100,9 +100,9 @@ public abstract class JacobObject implem
                 methodLists.toArray(new ChannelListener[methodLists.size()]));
     }
 
-    protected static ExportableChannel replication(ChannelListener methodList) {
+    protected static Channel replication(ChannelListener methodList) {
         JacobVPU.activeJacobThread().object(true, methodList);
-        return (ExportableChannel)methodList.getChannel();
+        return methodList.getChannel();
     }
 
     /**
@@ -111,7 +111,7 @@ public abstract class JacobObject implem
      * @param channel target channel
      * @return replicated channel broadcaster
      */
-    protected static <T extends ExportableChannel> T replication(T channel) {
+    protected static <T extends Channel> T replication(T channel) {
         // TODO: we should create a replicated wrapper here.
         return channel;
     }

Modified: ode/trunk/jacob/src/main/java/org/apache/ode/jacob/JacobThread.java
URL: http://svn.apache.org/viewvc/ode/trunk/jacob/src/main/java/org/apache/ode/jacob/JacobThread.java?rev=1434384&r1=1434383&r2=1434384&view=diff
==============================================================================
--- ode/trunk/jacob/src/main/java/org/apache/ode/jacob/JacobThread.java (original)
+++ ode/trunk/jacob/src/main/java/org/apache/ode/jacob/JacobThread.java Wed Jan 16 20:52:14 2013
@@ -32,9 +32,9 @@ import java.lang.reflect.Method;
 public interface JacobThread {
     public Object getExtension(Class<?> extensionClass);
 
-    public String exportChannel(ExportableChannel channel);
+    public String exportChannel(Channel channel);
 
-    public ExportableChannel importChannel(String channelId, Class<?> channelClass);
+    public Channel importChannel(String channelId, Class<?> channelClass);
 
     /**
      * Create a process instance i.e. a concretion of a process abstraction.
@@ -43,7 +43,7 @@ public interface JacobThread {
 
     /**
      * Send a message (object invocation). This method shouldn't really be used
-     * as {@link ExportableChannel} objects may be used as proxies in this respect.
+     * as {@link Channel} objects may be used as proxies in this respect.
      *
      * @param channel
      *            channel on which to send the message
@@ -52,12 +52,12 @@ public interface JacobThread {
      * @param args
      *            arguments
      */
-    public ExportableChannel message(ExportableChannel channel, Method method, Object[] args);
+    public Channel message(Channel channel, Method method, Object[] args);
 
     /**
      * Create a new channel.
      */
-    public ExportableChannel newChannel(Class<?> channelType, String creator, String description);
+    public Channel newChannel(Class<?> channelType, String creator, String description);
 
     /**
      * <p>

Modified: ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/ChannelFactory.java
URL: http://svn.apache.org/viewvc/ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/ChannelFactory.java?rev=1434384&r1=1434383&r2=1434384&view=diff
==============================================================================
--- ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/ChannelFactory.java (original)
+++ ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/ChannelFactory.java Wed Jan 16 20:52:14 2013
@@ -50,11 +50,11 @@ public class ChannelFactory {
         return cih._backend;
     }
 
-    public static ExportableChannel createChannel(CommChannel backend, Class<?> type) {
+    public static Channel createChannel(CommChannel backend, Class<?> type) {
         InvocationHandler h = new ChannelInvocationHandler(backend);
         Class<?>[] ifaces = new Class[] { ExportableChannel.class, type };
         Object proxy = Proxy.newProxyInstance(ExportableChannel.class.getClassLoader(), ifaces, h);
-        return (ExportableChannel) proxy;
+        return (Channel) proxy;
     }
 
     public static final class ChannelInvocationHandler implements InvocationHandler {
@@ -84,9 +84,9 @@ public class ChannelFactory {
                 return method.invoke(this, args);
             }
             if (method.equals(METHOD_CHANNEL_EXPORT)) {
-                return JacobVPU.activeJacobThread().exportChannel((ExportableChannel) proxy);
+                return JacobVPU.activeJacobThread().exportChannel((Channel)proxy);
             }
-            return JacobVPU.activeJacobThread().message((ExportableChannel) proxy, method, args);
+            return JacobVPU.activeJacobThread().message((Channel)proxy, method, args);
         }
     } // class ChannelInvocationHandler
 

Modified: ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/ExecutionQueueImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/ExecutionQueueImpl.java?rev=1434384&r1=1434383&r2=1434384&view=diff
==============================================================================
--- ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/ExecutionQueueImpl.java (original)
+++ ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/ExecutionQueueImpl.java Wed Jan 16 20:52:14 2013
@@ -41,7 +41,6 @@ import java.util.zip.GZIPInputStream;
 import java.util.zip.GZIPOutputStream;
 
 import org.apache.ode.jacob.Channel;
-import org.apache.ode.jacob.ExportableChannel;
 import org.apache.ode.jacob.ChannelListener;
 import org.apache.ode.jacob.IndexedObject;
 import org.apache.ode.jacob.JacobObject;

Modified: ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/JacobVPU.java
URL: http://svn.apache.org/viewvc/ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/JacobVPU.java?rev=1434384&r1=1434383&r2=1434384&view=diff
==============================================================================
--- ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/JacobVPU.java (original)
+++ ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/JacobVPU.java Wed Jan 16 20:52:14 2013
@@ -25,7 +25,6 @@ import java.util.Map;
 import java.util.Stack;
 
 import org.apache.ode.jacob.Channel;
-import org.apache.ode.jacob.ExportableChannel;
 import org.apache.ode.jacob.ChannelListener;
 import org.apache.ode.jacob.JacobObject;
 import org.apache.ode.jacob.JacobRunnable;
@@ -38,7 +37,6 @@ import org.apache.ode.jacob.soup.CommRec
 import org.apache.ode.jacob.soup.CommSend;
 import org.apache.ode.jacob.soup.Continuation;
 import org.apache.ode.jacob.soup.ExecutionQueue;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -275,7 +273,7 @@ public final class JacobVPU {
                 LOG.isInfoEnabled() ? template.toString() : null);
         }
 
-        public ExportableChannel message(ExportableChannel channel, Method method, Object[] args) {
+        public Channel message(Channel channel, Method method, Object[] args) {
             LOG.trace(">> [{}] : {} ! {} ({})", _cycle, channel, method.getName(),
                 LOG.isTraceEnabled() ? stringify(args) : null);
 
@@ -302,26 +300,26 @@ public final class JacobVPU {
             return replyChannel;
         }
 
-        public ExportableChannel newChannel(Class<?> channelType, String creator, String description) {
+        public Channel newChannel(Class<?> channelType, String creator, String description) {
             CommChannel chnl = new CommChannel(channelType);
             chnl.setDescription(description);
             _executionQueue.add(chnl);
 
-            ExportableChannel ret = ChannelFactory.createChannel(chnl, channelType);
+            Channel ret = ChannelFactory.createChannel(chnl, channelType);
             LOG.trace(">> [{}] : new {}", _cycle, ret);
 
             _statistics.channelsCreated++;
             return ret;
         }
 
-        public String exportChannel(ExportableChannel channel) {
+        public String exportChannel(Channel channel) {
             LOG.trace(">> [{}] : export<{}>", _cycle, channel);
 
             CommChannel chnl = (CommChannel)ChannelFactory.getBackend((Channel)channel);
             return _executionQueue.createExport(chnl);
         }
 
-        public ExportableChannel importChannel(String channelId, Class<?> channelType) {
+        public Channel importChannel(String channelId, Class<?> channelType) {
             CommChannel cframe = _executionQueue.consumeExport(channelId);
             return ChannelFactory.createChannel(cframe, channelType);
         }