geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r1055346 - /geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/ThreadSingletonServiceAdapter.java
Date Wed, 05 Jan 2011 08:06:57 GMT
Author: xuhaihong
Date: Wed Jan  5 08:06:56 2011
New Revision: 1055346

URL: http://svn.apache.org/viewvc?rev=1055346&view=rev
Log:
GERONIMO-5748 ClassCastException in ThreadSingletonServiceAdapter (Patch from Fang Shenhao)

Modified:
    geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/ThreadSingletonServiceAdapter.java

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/ThreadSingletonServiceAdapter.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/ThreadSingletonServiceAdapter.java?rev=1055346&r1=1055345&r2=1055346&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/ThreadSingletonServiceAdapter.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/ThreadSingletonServiceAdapter.java
Wed Jan  5 08:06:56 2011
@@ -20,12 +20,9 @@
 
 package org.apache.geronimo.openejb;
 
-import java.util.Map;
-
 import org.apache.geronimo.openwebbeans.GeronimoSingletonService;
 import org.apache.geronimo.openwebbeans.OpenWebBeansWebInitializer;
 import org.apache.geronimo.openwebbeans.OsgiMetaDataScannerService;
-import org.apache.openejb.AppContext;
 import org.apache.openejb.cdi.CdiAppContextsService;
 import org.apache.openejb.cdi.CdiResourceInjectionService;
 import org.apache.openejb.cdi.OWBContext;
@@ -35,7 +32,6 @@ import org.apache.openejb.cdi.ThreadSing
 import org.apache.webbeans.config.OpenWebBeansConfiguration;
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.corespi.ServiceLoader;
-import org.apache.webbeans.lifecycle.StandaloneLifeCycle;
 import org.apache.webbeans.spi.ContainerLifecycle;
 import org.apache.webbeans.spi.ResourceInjectionService;
 
@@ -66,7 +62,7 @@ public class ThreadSingletonServiceAdapt
                 }
                 // an existing OWBConfiguration will have already been initialized
             } else {
-                startupObject.getAppContext().set(OWBContext.class, (OWBContext) old);
+                startupObject.getAppContext().set(OWBContext.class, new OWBContext((WebBeansContext)
old));
             }
         } finally {
             contextExited(old);
@@ -93,7 +89,7 @@ public class ThreadSingletonServiceAdapt
 
     @Override
     public void contextExited(Object oldContext) {
-        if (oldContext != null && !(oldContext instanceof Map)) throw new IllegalArgumentException("Expecting
a Map<String, Object> not " + oldContext.getClass().getName());
+        if (oldContext != null && !(oldContext instanceof WebBeansContext)) throw
new IllegalArgumentException("Expecting a WebBeansContext not " + oldContext.getClass().getName());
         GeronimoSingletonService.contextExited((WebBeansContext) oldContext);
     }
 }



Mime
View raw message