openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject [openwebbeans] branch master updated: OWB-1304 remove EE unused resource passivation
Date Tue, 10 Dec 2019 17:25:11 GMT
This is an automated email from the ASF dual-hosted git repository.

struberg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwebbeans.git


The following commit(s) were added to refs/heads/master by this push:
     new faf84b7  OWB-1304 remove EE unused resource passivation
faf84b7 is described below

commit faf84b78eedd3a06dd9c47281709095ab3ed58f1
Author: Mark Struberg <struberg@apache.org>
AuthorDate: Tue Dec 10 18:23:12 2019 +0100

    OWB-1304 remove EE unused resource passivation
    
    That way we'll also get rid of CORBA references which got dropped
    in Java11.
---
 pom.xml                                            |  4 +-
 webbeans-resource/pom.xml                          | 11 +++++
 .../spi/se/StandaloneResourceInjectionService.java | 51 ----------------------
 .../webbeans/spi/ResourceInjectionService.java     | 14 ++++--
 4 files changed, 24 insertions(+), 56 deletions(-)

diff --git a/pom.xml b/pom.xml
index 3ca245c..6b21cca 100644
--- a/pom.xml
+++ b/pom.xml
@@ -58,7 +58,7 @@
     </issueManagement>
 
     <properties>
-        <geronimo_jaxws.version>1.0</geronimo_jaxws.version>
+        <geronimo_jaxws.version>1.2</geronimo_jaxws.version>
         <geronimo_servlet.version>1.0</geronimo_servlet.version>
         <geronimo_ejb.version>1.0.2</geronimo_ejb.version>
         <geronimo_el.version>1.0.4</geronimo_el.version>
@@ -570,7 +570,7 @@
 
             <dependency>
                 <groupId>org.apache.geronimo.specs</groupId>
-                <artifactId>geronimo-jaxws_2.1_spec</artifactId>
+                <artifactId>geronimo-jaxws_2.2_spec</artifactId>
                 <version>${geronimo_jaxws.version}</version>
             </dependency>
 
diff --git a/webbeans-resource/pom.xml b/webbeans-resource/pom.xml
index 40491fe..2d91a26 100644
--- a/webbeans-resource/pom.xml
+++ b/webbeans-resource/pom.xml
@@ -52,6 +52,17 @@
             <optional>true</optional>
         </dependency>
         <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-annotation_1.3_spec</artifactId>
+            <optional>true</optional>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jaxws_2.2_spec</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
             <groupId>org.apache.openwebbeans</groupId>
             <artifactId>openwebbeans-spi</artifactId>
             <optional>true</optional>
diff --git a/webbeans-resource/src/main/java/org/apache/webbeans/resource/spi/se/StandaloneResourceInjectionService.java
b/webbeans-resource/src/main/java/org/apache/webbeans/resource/spi/se/StandaloneResourceInjectionService.java
index 69d0099..46d4224 100644
--- a/webbeans-resource/src/main/java/org/apache/webbeans/resource/spi/se/StandaloneResourceInjectionService.java
+++ b/webbeans-resource/src/main/java/org/apache/webbeans/resource/spi/se/StandaloneResourceInjectionService.java
@@ -18,10 +18,6 @@
  */
 package org.apache.webbeans.resource.spi.se;
 
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.io.Serializable;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Field;
 import java.lang.reflect.Modifier;
@@ -33,12 +29,10 @@ import java.util.logging.Logger;
 
 import javax.annotation.Resource;
 import javax.enterprise.inject.Produces;
-import javax.enterprise.inject.spi.Bean;
 import javax.persistence.PersistenceContext;
 import javax.persistence.PersistenceUnit;
 import javax.xml.ws.WebServiceRef;
 
-import org.apache.webbeans.component.ResourceBean;
 import org.apache.webbeans.config.OWBLogConst;
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.exception.WebBeansException;
@@ -175,50 +169,5 @@ public class StandaloneResourceInjectionService implements ResourceInjectionServ
     {
         processor.clear();       
     }
-    
-    /**
-     * delegation of serialization behavior
-     */
-    @Override
-    public <T> void writeExternal(Bean<T> bean, T actualResource, ObjectOutput
out) throws IOException
-    {
-        // default behavior
-        if (actualResource instanceof Serializable)
-        {
-            // for remote ejb stub and other serializable resources
-            out.writeObject(actualResource);
-        }
-        else
-        {
-            // otherwise, write a dummy string.
-            out.writeObject(DUMMY_STRING);
-        }
-
-    }
-
-    /**
-     * delegation of serialization behavior
-     */
-    @Override
-    public <T> T readExternal(Bean<T> bean, ObjectInput in) throws IOException,
-            ClassNotFoundException
-    {
-        T actualResource = null;
-
-        // default behavior
-        actualResource = (T) in.readObject();
-        if (actualResource instanceof javax.rmi.CORBA.Stub)
-        {
-            // for remote ejb stub, reconnect after deserialization.
-            org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(new String[0], null);
-            ((javax.rmi.CORBA.Stub)actualResource).connect(orb);
-        }
-        else if (actualResource.equals(DUMMY_STRING))
-        {
-            actualResource = (T) ((ResourceBean)bean).getActualInstance();
-        }
-        return actualResource;
-    }
-
 
 }
diff --git a/webbeans-spi/src/main/java/org/apache/webbeans/spi/ResourceInjectionService.java
b/webbeans-spi/src/main/java/org/apache/webbeans/spi/ResourceInjectionService.java
index d73256c..a50dc93 100644
--- a/webbeans-spi/src/main/java/org/apache/webbeans/spi/ResourceInjectionService.java
+++ b/webbeans-spi/src/main/java/org/apache/webbeans/spi/ResourceInjectionService.java
@@ -83,13 +83,21 @@ public interface ResourceInjectionService
 
     /**
      * delegation of serialization behavior
+     * @deprecated has not been used since 1.1.x. We can finally remove it some day
      */
-    <T> void writeExternal(Bean<T> bean, T actualResource, ObjectOutput out)
throws IOException;
+    default <T> void writeExternal(Bean<T> bean, T actualResource, ObjectOutput
out) throws IOException
+    {
+        // do nothing
+    }
 
     /**
      * delegation of serialization behavior
+     * @deprecated has not been used since 1.1.x. We can finally remove it some day
      */
-    <T> T readExternal(Bean<T> bean, ObjectInput out) throws IOException,
-            ClassNotFoundException;
+    default <T> T readExternal(Bean<T> bean, ObjectInput out) throws IOException,
ClassNotFoundException
+    {
+        // do nothing
+        return null;
+    }
         
 }


Mime
View raw message