[seam-commits] Seam SVN: r12661 - in branches/enterprise/JBPAPP_5_0: build and 2 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Wed Apr 28 09:07:26 EDT 2010


Author: manaRH
Date: 2010-04-28 09:07:24 -0400 (Wed, 28 Apr 2010)
New Revision: 12661

Added:
   branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/cache/JbossCache3Provider.java
Removed:
   branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/cache/JbossCacheProvider.java
   branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/cache/JbossPojoCacheProvider.java
Modified:
   branches/enterprise/JBPAPP_5_0/build.xml
   branches/enterprise/JBPAPP_5_0/build/core.pom.xml
   branches/enterprise/JBPAPP_5_0/build/root.pom.xml
   branches/enterprise/JBPAPP_5_0/build/ui.pom.xml
   branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/cache-2.2.xsd
   branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/cache/JbossCache2Provider.java
Log:
JBPAPP-4111 -removing unsupported jboss-cache version

Modified: branches/enterprise/JBPAPP_5_0/build/core.pom.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/build/core.pom.xml	2010-04-28 12:02:04 UTC (rev 12660)
+++ branches/enterprise/JBPAPP_5_0/build/core.pom.xml	2010-04-28 13:07:24 UTC (rev 12661)
@@ -196,14 +196,6 @@
       <artifactId>ehcache</artifactId>
       <optional>true</optional>
     </dependency>
-
-    <!-- Order matters of jboss:jboss-cache and org.jboss.cache:jbosscache-core -->
-
-    <dependency>
-      <groupId>jboss</groupId>
-      <artifactId>jboss-cache</artifactId>
-      <optional>true</optional>
-    </dependency>
         
     <dependency>
       <groupId>org.jboss.cache</groupId>
@@ -211,30 +203,7 @@
       <optional>true</optional>
     </dependency>
     
-
-    
-    <!-- This is actually a dep of jboss-cache, but it doesn't declare it -->
     <dependency>
-      <groupId>jboss</groupId>
-      <artifactId>jboss-system</artifactId>
-      <optional>true</optional>
-    </dependency>
-    
-    <!-- This is actually a dep of jboss-cache, but it doesn't declare it -->
-    <dependency>
-      <groupId>jboss</groupId>
-      <artifactId>jboss-jmx</artifactId>
-      <optional>true</optional>
-    </dependency>
-    
-    <!-- This is actually a dep of jboss-cache, but it doesn't declare it -->
-    <dependency>
-      <groupId>jgroups</groupId>
-      <artifactId>jgroups</artifactId>
-      <optional>true</optional>
-    </dependency>
-
-    <dependency>
       <groupId>org.drools</groupId>
       <artifactId>drools-core</artifactId>
       <optional>true</optional>

Modified: branches/enterprise/JBPAPP_5_0/build/root.pom.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/build/root.pom.xml	2010-04-28 12:02:04 UTC (rev 12660)
+++ branches/enterprise/JBPAPP_5_0/build/root.pom.xml	2010-04-28 13:07:24 UTC (rev 12661)
@@ -277,12 +277,6 @@
         	</exclusion>
         </exclusions>
       </dependency>
-
-      <dependency>
-        <groupId>jboss</groupId>
-        <artifactId>jboss-cache</artifactId>
-        <version>1.4.1.SP13</version>
-      </dependency>
       
       <dependency>
         <groupId>net.sf.ehcache</groupId>
@@ -300,7 +294,6 @@
         </exclusions>
       </dependency>
     
-      <!-- You should adjust this in the initcore task in build.xml as well -->
       <dependency>
         <groupId>org.jboss.cache</groupId>
         <artifactId>jbosscache-core</artifactId>

Modified: branches/enterprise/JBPAPP_5_0/build/ui.pom.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/build/ui.pom.xml	2010-04-28 12:02:04 UTC (rev 12660)
+++ branches/enterprise/JBPAPP_5_0/build/ui.pom.xml	2010-04-28 13:07:24 UTC (rev 12661)
@@ -127,21 +127,7 @@
       </exclusions>
     </dependency>
     
-    <!-- This is actually a dep of jboss-cache, but it doesn't declare it -->
     <dependency>
-      <groupId>jboss</groupId>
-      <artifactId>jboss-system</artifactId>
-      <optional>true</optional>
-    </dependency>
-    
-    <!-- This is actually a dep of jboss-cache, but it doesn't declare it -->
-    <dependency>
-      <groupId>jboss</groupId>
-      <artifactId>jboss-jmx</artifactId>
-      <optional>true</optional>
-    </dependency>
-
-    <dependency>
       <groupId>org.hibernate</groupId>
       <artifactId>hibernate-core</artifactId>
       <optional>true</optional>

Modified: branches/enterprise/JBPAPP_5_0/build.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/build.xml	2010-04-28 12:02:04 UTC (rev 12660)
+++ branches/enterprise/JBPAPP_5_0/build.xml	2010-04-28 13:07:24 UTC (rev 12661)
@@ -185,9 +185,6 @@
 
 	<target name="initcore" depends="init">
 		<init classesdir="${classes.core.dir}" srcdir="${src.core.dir}" modulename="core" pom="${core.pom}" />
-		<!-- <inlineDependencies id="jbosscache2" scope="compile">
-			<dependency groupId="org.jboss.cache" artifactId="jbosscache-core" version="2.2.0.CR6" />
-		</inlineDependencies> -->
 	</target>
 
 	<target name="antlr" depends="initcore" description="Generate ANTLR parser">

Modified: branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/cache/JbossCache2Provider.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/cache/JbossCache2Provider.java	2010-04-28 12:02:04 UTC (rev 12660)
+++ branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/cache/JbossCache2Provider.java	2010-04-28 13:07:24 UTC (rev 12661)
@@ -24,10 +24,13 @@
  * Implementation of CacheProvider backed by JBoss Cache 2.x. for simple
  * objects.
  * 
+ * @deprecated  As of version 2.2.2.EAP, replaced by JbossCache3Provider
+ * @see org.jboss.seam.cache.JbossCache3Provider
  * @author Sebastian Hennebrueder
  * @author Pete Muir
  */
 
+ at Deprecated
 @Name("org.jboss.seam.cache.cacheProvider")
 @Scope(APPLICATION)
 @BypassInterceptors

Added: branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/cache/JbossCache3Provider.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/cache/JbossCache3Provider.java	                        (rev 0)
+++ branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/cache/JbossCache3Provider.java	2010-04-28 13:07:24 UTC (rev 12661)
@@ -0,0 +1,113 @@
+package org.jboss.seam.cache;
+
+import static org.jboss.seam.ScopeType.APPLICATION;
+import static org.jboss.seam.annotations.Install.BUILT_IN;
+
+import java.lang.reflect.Method;
+
+import org.jboss.cache.Cache;
+import org.jboss.cache.CacheFactory;
+import org.jboss.cache.DefaultCacheFactory;
+import org.jboss.cache.Fqn;
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.Install;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.intercept.BypassInterceptors;
+import org.jboss.seam.log.LogProvider;
+import org.jboss.seam.log.Logging;
+import org.jboss.seam.util.Reflections;
+
+/**
+ * Implementation of CacheProvider backed by JBoss Cache 3.x. for simple
+ * objects.
+ * 
+ * @author Sebastian Hennebrueder
+ * @author Pete Muir
+ */
+
+ at Name("org.jboss.seam.cache.cacheProvider")
+ at Scope(APPLICATION)
+ at BypassInterceptors
+ at Install(value = false, precedence = BUILT_IN, classDependencies = {"org.jboss.cache.Cache", "org.jgroups.MembershipListener"})
+ at AutoCreate
+public class JbossCache3Provider 
+    extends AbstractJBossCacheProvider<Cache> 
+{
+
+    private org.jboss.cache.Cache cache;
+
+    private static final LogProvider log = Logging.getLogProvider(JbossCache3Provider.class);
+
+    private static Method GET;
+    private static Method PUT;
+    private static Method REMOVE;
+    private static Method REMOVE_NODE;
+
+    static {
+        try {
+            GET = Cache.class.getDeclaredMethod("get", Fqn.class, Object.class);
+            PUT = Cache.class.getDeclaredMethod("put", Fqn.class, Object.class, Object.class);
+            REMOVE = Cache.class.getDeclaredMethod("remove", Fqn.class, Object.class);
+            REMOVE_NODE = Cache.class.getDeclaredMethod("removeNode", Fqn.class);
+        } catch (Exception e) {
+            throw new IllegalStateException("Unable to use JBoss Cache 3", e);
+        }
+    }
+
+    @Create
+    public void create() {
+        log.debug("Starting JBoss Cache");
+
+        try {
+            CacheFactory factory = new DefaultCacheFactory();
+            cache = factory.createCache(getConfigurationAsStream());
+
+            cache.create();
+            cache.start();
+        } catch (Exception e) {
+            //log.error(e, e);
+            throw new IllegalStateException("Error starting JBoss Cache", e);
+        }
+    }
+
+    @Destroy
+    public void destroy() {
+        log.debug("Stopping JBoss Cache");
+        try {
+            cache.stop();
+            cache.destroy();
+            cache = null;
+        } catch (Exception e) {
+            throw new IllegalStateException("Error stopping JBoss Cache", e);
+        }
+    }
+
+    @Override
+    public Object get(String region, String key) {
+        return Reflections.invokeAndWrap(GET, cache, getFqn(region), key);
+    }
+
+    @Override
+    public void put(String region, String key, Object object) {
+        Reflections.invokeAndWrap(PUT, cache, getFqn(region), key, object);
+    }
+
+    @Override
+    public void remove(String region, String key) {
+        Reflections.invokeAndWrap(REMOVE, cache, getFqn(region), key);
+    }
+
+    @Override
+    public void clear() {
+        Reflections.invokeAndWrap(REMOVE_NODE, cache, getFqn(null));
+    }
+
+    @Override
+    public Cache getDelegate() {
+        return cache;
+    }
+
+}
\ No newline at end of file

Deleted: branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/cache/JbossCacheProvider.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/cache/JbossCacheProvider.java	2010-04-28 12:02:04 UTC (rev 12660)
+++ branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/cache/JbossCacheProvider.java	2010-04-28 13:07:24 UTC (rev 12661)
@@ -1,142 +0,0 @@
-package org.jboss.seam.cache;
-
-import static org.jboss.seam.ScopeType.APPLICATION;
-import static org.jboss.seam.annotations.Install.BUILT_IN;
-
-import org.jboss.cache.CacheException;
-import org.jboss.cache.Node;
-import org.jboss.cache.PropertyConfigurator;
-import org.jboss.cache.TreeCache;
-import org.jboss.seam.annotations.AutoCreate;
-import org.jboss.seam.annotations.Create;
-import org.jboss.seam.annotations.Destroy;
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.intercept.BypassInterceptors;
-import org.jboss.seam.log.LogProvider;
-import org.jboss.seam.log.Logging;
-
-/**
- * Implementation of CacheProvider backed by JBoss Cache 1.x
- * 
- * @author Sebastian Hennebrueder
- * @author Pete Muir
- */
-
- at Name("org.jboss.seam.cache.cacheProvider")
- at Scope(APPLICATION)
- at BypassInterceptors
- at Install(precedence = BUILT_IN, classDependencies={"org.jboss.cache.TreeCache", "org.jgroups.MembershipListener"})
- at AutoCreate
-public class JbossCacheProvider extends AbstractJBossCacheProvider<TreeCache>
-{
-
-   private TreeCache cache;
-
-   private static final LogProvider log = Logging.getLogProvider(JbossCacheProvider.class);
-
-   @Create
-   public void create()
-   {
-      log.debug("Starting JBoss Treecache 1.x");
-
-      try
-      {
-         cache = new TreeCache();
-         new PropertyConfigurator().configure(cache, getConfigurationAsStream());
-         cache.createService();
-         cache.startService();
-
-      }
-      catch (Exception e)
-      {
-         throw new IllegalStateException("Error starting JBoss Treecache 1.x", e);
-      }
-   }
-
-   @Destroy
-   public void destroy()
-   {
-      log.debug("Stopping JBoss Treecache 1.x");
-
-      try
-      {
-         cache.stopService();
-         cache.destroyService();
-      }
-      catch (RuntimeException e)
-      {
-         throw new IllegalStateException("Error stopping JBoss Treecache 1.x", e);
-      }
-      cache = null;
-   }
-
-   @Override
-   public Object get(String region, String key)
-   {
-      try
-      {
-         Node node = cache.get(getFqn(region));
-         if (node != null)
-         {
-            return node.get(key);
-         }
-         else
-         {
-            return null;
-         }
-      }
-      catch (CacheException e)
-      {
-         throw new IllegalStateException(String.format("Cache throw exception when trying to get %s from region %s.", key, region), e);
-      }
-   }
-
-   @Override
-   public void put(String region, String key, Object object)
-   {
-      try
-      {
-         cache.put(getFqn(region), key, object);
-      }
-      catch (CacheException e)
-      {
-         throw new IllegalStateException(String.format("JBoss Cache throw exception when adding object for key %s to region %s", key, region), e);
-      }
-   }
-
-   @Override
-   public void remove(String region, String key)
-   {
-      try
-      {
-         cache.remove(getFqn(region), key);
-      }
-      catch (CacheException e)
-      {
-         throw new IllegalStateException(String.format("JBoss Cache throw exception when removing object for key %s in region %s", key, region), e);
-      }
-
-   }
-
-   @Override
-   public TreeCache getDelegate()
-   {
-      return cache;
-   }
-
-   @Override
-   public void clear()
-   {
-      try
-      {
-         cache.remove(getFqn(null));
-      }
-      catch (CacheException e)
-      {
-         throw new IllegalStateException(String.format("JBoss Cache throw exception when clearing default cache."), e);
-      }
-   }
-
-}
\ No newline at end of file

Deleted: branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/cache/JbossPojoCacheProvider.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/cache/JbossPojoCacheProvider.java	2010-04-28 12:02:04 UTC (rev 12660)
+++ branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/cache/JbossPojoCacheProvider.java	2010-04-28 13:07:24 UTC (rev 12661)
@@ -1,135 +0,0 @@
-package org.jboss.seam.cache;
-
-import static org.jboss.seam.ScopeType.APPLICATION;
-import static org.jboss.seam.annotations.Install.BUILT_IN;
-
-import org.jboss.cache.CacheException;
-import org.jboss.cache.Node;
-import org.jboss.cache.aop.PojoCache;
-import org.jboss.seam.annotations.AutoCreate;
-import org.jboss.seam.annotations.Create;
-import org.jboss.seam.annotations.Destroy;
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.intercept.BypassInterceptors;
-import org.jboss.seam.log.LogProvider;
-import org.jboss.seam.log.Logging;
-
-/**
- * Implementation of CacheProvider backed by JBoss POJO Cache 1.x
- * 
- * @author Sebastian Hennebrueder
- * @author Pete Muir
- */
-
- at Name("org.jboss.seam.cache.cacheProvider")
- at Scope(APPLICATION)
- at BypassInterceptors
- at Install(value = false, precedence = BUILT_IN, classDependencies={"org.jboss.cache.aop.PojoCache", "org.jgroups.MembershipListener", "org.jboss.aop.Dispatcher"})
- at AutoCreate
-public class JbossPojoCacheProvider extends AbstractJBossCacheProvider<PojoCache>
-{
-
-   private PojoCache cache;
-
-   private static final LogProvider log = Logging.getLogProvider(JbossPojoCacheProvider.class);
-
-   @Create
-   public void create()
-   {
-      log.debug("Starting JBoss POJO Cache 1.x");
-
-      try
-      {
-         cache = new PojoCache();
-         new org.jboss.cache.PropertyConfigurator().configure(cache, getConfigurationAsStream());
-         cache.createService();
-         cache.startService();
-
-      }
-      catch (Exception e)
-      {
-         throw new IllegalStateException("Error starting JBoss POJO Cache 1.x", e);
-      }
-   }
-
-   @Destroy
-   public void destroy()
-   {
-      log.debug("Stopping JBoss Treecache 1.x");
-
-      try
-      {
-         cache.stopService();
-         cache.destroyService();
-      }
-      catch (RuntimeException e)
-      {
-         throw new IllegalStateException("Error stopping JBoss Treecache 1.x", e);
-      }
-      cache = null;
-   }
-
-    @Override
-    public Object get(String region, String key) {
-        try {
-            Node node = cache.get(getFqn(region));
-            if (node != null) {
-                return node.get(key);
-            } else {
-                return null;
-            }
-        } catch (CacheException e) {
-            throw new IllegalStateException(String.format("Cache throw exception when trying to get %s from region %s.",                                    key, region), e);
-        }
-    }
-
-
-   @Override
-   public void put(String region, String key, Object object)
-   {
-      try
-      {
-         cache.put(getFqn(region), key, object);
-      }
-      catch (CacheException e)
-      {
-         throw new IllegalStateException(String.format("JBoss Cache throw exception when adding object for key %s to region %s", key, region), e);
-      }
-   }
-
-   @Override
-   public void remove(String region, String key)
-   {
-      try
-      {
-         cache.remove(getFqn(region), key);
-      }
-      catch (CacheException e)
-      {
-         throw new IllegalStateException(String.format("JBoss Cache throw exception when removing object for key %s in region %s", key, region), e);
-      }
-
-   }
-
-   @Override
-   public PojoCache getDelegate()
-   {
-      return cache;
-   }
-
-   @Override
-   public void clear()
-   {
-      try
-      {
-         cache.remove(getFqn(null));
-      }
-      catch (CacheException e)
-      {
-         throw new IllegalStateException(String.format("JBoss Cache throw exception when clearing default cache."), e);
-      }
-   }
-
-}
\ No newline at end of file

Modified: branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/cache-2.2.xsd
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/cache-2.2.xsd	2010-04-28 12:02:04 UTC (rev 12660)
+++ branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/cache-2.2.xsd	2010-04-28 13:07:24 UTC (rev 12661)
@@ -18,9 +18,9 @@
       </xs:complexType>
    </xs:element>
    
-   <xs:element name="jboss-cache-provider">
+   <xs:element name="jboss-cache3-provider">
       <xs:annotation>
-         <xs:documentation>The JBoss 1.x Cache provider</xs:documentation>
+         <xs:documentation>The JBoss 3.x Cache provider</xs:documentation>
       </xs:annotation>
       <xs:complexType mixed="true">
          <xs:attributeGroup ref="components:attlist.component" />
@@ -38,16 +38,6 @@
       </xs:complexType>
    </xs:element>
 
-   <xs:element name="jboss-pojo-cache-provider">
-      <xs:annotation>
-         <xs:documentation>The JBoss 1.x POJOCache provider</xs:documentation>
-      </xs:annotation>
-      <xs:complexType mixed="true">
-         <xs:attributeGroup ref="components:attlist.component" />
-         <xs:attributeGroup ref="cache:attlist.cacheProvider" />
-      </xs:complexType>
-   </xs:element>
-
    <xs:attributeGroup name="attlist.cacheProvider">
       <xs:attribute name="default-region" type="components:string" />
       <xs:attribute name="configuration" type="components:string" />



More information about the seam-commits mailing list