incubator-hise-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r.@apache.org
Subject svn commit: r961360 - in /incubator/hise/trunk: hise-services/src/main/java/org/apache/hise/api/ hise-services/src/main/java/org/apache/hise/engine/ hise-services/src/main/java/org/apache/hise/engine/store/ hise-test-example-osgi/src/main/resources/MET...
Date Wed, 07 Jul 2010 12:45:29 GMT
Author: rr
Date: Wed Jul  7 12:45:28 2010
New Revision: 961360

URL: http://svn.apache.org/viewvc?rev=961360&view=rev
Log:
HISE-28: Refreshing hise-bundle throws exception "service proxy has been destroyed" (fix thanks
to Michał Więcław)

Modified:
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/api/HISEEngine.java
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/HISEEngineImpl.java
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/HISEDeployer.java
    incubator/hise/trunk/hise-test-example-osgi/src/main/resources/META-INF/spring/beans.xml
    incubator/hise/trunk/hise-test-example/pom.xml
    incubator/hise/trunk/hise-web/pom.xml

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/api/HISEEngine.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/api/HISEEngine.java?rev=961360&r1=961359&r2=961360&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/api/HISEEngine.java (original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/api/HISEEngine.java Wed
Jul  7 12:45:28 2010
@@ -17,8 +17,10 @@ public interface HISEEngine {
         public TaskDD dd;
     }
     
-    void registerTask(TaskInfo ti);
+    QName registerTask(TaskInfo ti);
 
+    void removeTask(QName taks);
+    
     Node receive(Handler handler, QName portType, String operation, Element body, Node requestHeader);
 
     HISEDao getHiseDao();

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/HISEEngineImpl.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/HISEEngineImpl.java?rev=961360&r1=961359&r2=961360&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/HISEEngineImpl.java
(original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/HISEEngineImpl.java
Wed Jul  7 12:45:28 2010
@@ -87,7 +87,7 @@ public class HISEEngineImpl implements H
         return "" + System.identityHashCode(handler) + ";" + getCanonicalQName(portType)
+ ";" + operation; 
     }
 
-    public void registerTask(TaskInfo ti) {
+    public QName registerTask(TaskInfo ti) {
         TaskDefinition d = ti.taskDefinition;
         String taskKey = HISEEngineImpl.tasksKey(ti.dd.getHandler(), d.getTaskInterface().getPortType(),
d.getTaskInterface().getOperation());
         log.debug("registering route " + taskKey + " -> " + ti.taskDefinition.getTaskName());
@@ -101,6 +101,21 @@ public class HISEEngineImpl implements H
         tasks.put(ti.taskDefinition.getTaskName(), ti);
         
         log.debug("registered");
+        
+        return taskName;
+    }
+    
+    public void removeTask(QName task)
+    {
+    	TaskInfo taskInfo = tasks.get(task);
+    	TaskDefinition taskD = taskInfo.taskDefinition;
+    	
+    	String taskKey = HISEEngineImpl.tasksKey(taskInfo.dd.getHandler(), taskD.getTaskInterface().getPortType(),
taskD.getTaskInterface().getOperation());
+    	
+    	this.tasksMap.remove(taskKey);
+    	this.tasks.remove(task);
+    	
+    	log.debug("remove task -> "+taskInfo.taskDefinition.getTaskName());
     }
     
     public TaskDefinition getTaskDefinition(QName taskName) {

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/HISEDeployer.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/HISEDeployer.java?rev=961360&r1=961359&r2=961360&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/HISEDeployer.java
(original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/HISEDeployer.java
Wed Jul  7 12:45:28 2010
@@ -19,8 +19,14 @@
 
 package org.apache.hise.engine.store;
 
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.xml.namespace.QName;
 import org.apache.commons.lang.Validate;
 import org.apache.hise.api.HISEEngine;
+import org.apache.hise.api.HISEEngine.TaskInfo;
 import org.apache.hise.engine.HISEEngineImpl;
 import org.apache.hise.lang.HumanInteractions;
 import org.apache.hise.lang.TaskDefinition;
@@ -29,6 +35,9 @@ public class HISEDeployer {
     public HISEEngine hiseEngine;
     public HISEDD deploymentInfo;
     
+    /**list of tasks added to engine*/
+    private List<QName> newTasks; 
+    
     public void init() throws CompileException {
         deploy(deploymentInfo);
     }
@@ -36,6 +45,8 @@ public class HISEDeployer {
     public void deploy(HISEDD di) throws CompileException {
         HumanInteractions tasks = HumanInteractionsCompiler.compile(di.getHumanInteractionsResource());
         
+        newTasks = new ArrayList<QName>();
+        
         for (TaskDD t : di.getTasksDI()) {
             TaskDefinition d = tasks.getTaskDefinitions().get(t.getTaskName());
             Validate.notNull(d, "Can't find Task name specified in deployment descriptor
" + t.getTaskName());
@@ -43,10 +54,20 @@ public class HISEDeployer {
             ti.dd = t;
             ti.parent = di;
             ti.taskDefinition = d;
-            hiseEngine.registerTask(ti);
+            newTasks.add(hiseEngine.registerTask(ti));
         }
     }
 
+    public void destroy()
+    {
+    	org.apache.hise.api.HISEEngine.TaskInfo temp;
+    	
+    	for(QName i : newTasks)
+    	{
+    		hiseEngine.removeTask(i);
+    	}
+    }
+    
     public void setHiseEngine(HISEEngine hiseEngine) {
         this.hiseEngine = hiseEngine;
     }

Modified: incubator/hise/trunk/hise-test-example-osgi/src/main/resources/META-INF/spring/beans.xml
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-test-example-osgi/src/main/resources/META-INF/spring/beans.xml?rev=961360&r1=961359&r2=961360&view=diff
==============================================================================
--- incubator/hise/trunk/hise-test-example-osgi/src/main/resources/META-INF/spring/beans.xml
(original)
+++ incubator/hise/trunk/hise-test-example-osgi/src/main/resources/META-INF/spring/beans.xml
Wed Jul  7 12:45:28 2010
@@ -18,7 +18,7 @@ xsi:schemaLocation="
 <osgi:reference id="hiseEngine" interface="org.apache.hise.api.HISEEngine" bean-name="hiseEngine"/>
 <osgi:reference id="transactionManager" interface="org.springframework.transaction.PlatformTransactionManager"
bean-name="transactionManager"/>
 
-  <bean class="org.apache.hise.engine.store.HISEDeployer" init-method="init">
+  <bean class="org.apache.hise.engine.store.HISEDeployer" init-method="init" destroy-method="destroy">
     <property name="hiseEngine" ref="hiseEngine"/>
     <property name="deploymentInfo">
       <bean class="org.apache.hise.engine.store.HISEDD">

Modified: incubator/hise/trunk/hise-test-example/pom.xml
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-test-example/pom.xml?rev=961360&r1=961359&r2=961360&view=diff
==============================================================================
--- incubator/hise/trunk/hise-test-example/pom.xml (original)
+++ incubator/hise/trunk/hise-test-example/pom.xml Wed Jul  7 12:45:28 2010
@@ -26,7 +26,7 @@
     </parent>
     <artifactId>hise-test-example</artifactId>
     <packaging>jar</packaging>
-    <version>0.2.0-SNAPSHOT</version>
+    <version>0.3.0-SNAPSHOT</version>
     <dependencies>
     <!-- 
     <dependency>
@@ -44,7 +44,7 @@
         <dependency>
             <groupId>org.apache.hise</groupId>
             <artifactId>hise-test-example-osgi</artifactId>
-            <version>0.2.0-SNAPSHOT</version>
+            <version>0.3.0-SNAPSHOT</version>
         </dependency>
 
     </dependencies>

Modified: incubator/hise/trunk/hise-web/pom.xml
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-web/pom.xml?rev=961360&r1=961359&r2=961360&view=diff
==============================================================================
--- incubator/hise/trunk/hise-web/pom.xml (original)
+++ incubator/hise/trunk/hise-web/pom.xml Wed Jul  7 12:45:28 2010
@@ -17,7 +17,7 @@
 
     <artifactId>hise-web</artifactId>
     <packaging>war</packaging>
-    <version>0.2.0-SNAPSHOT</version>
+    <version>0.3.0-SNAPSHOT</version>
 
     <dependencies>
         <dependency>



Mime
View raw message