[gatein-commits] gatein SVN: r6923 - portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content.

do-not-reply at jboss.org do-not-reply at jboss.org
Sat Jul 23 17:39:25 EDT 2011


Author: chris.laprun at jboss.com
Date: 2011-07-23 17:39:24 -0400 (Sat, 23 Jul 2011)
New Revision: 6923

Modified:
   portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ContentRegistryImpl.java
Log:
- Added missing calls to GateInImpl.begin() and end().

Modified: portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ContentRegistryImpl.java
===================================================================
--- portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ContentRegistryImpl.java	2011-07-23 18:45:44 UTC (rev 6922)
+++ portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/content/ContentRegistryImpl.java	2011-07-23 21:39:24 UTC (rev 6923)
@@ -65,6 +65,7 @@
    {
       try
       {
+         gateIn.begin();
          final List<ApplicationCategory> categories = gateIn.getRegistryService().getApplicationCategories();
          return new AdaptedIterableCollection<ApplicationCategory, String>(categories.size(), categories.iterator())
          {
@@ -83,12 +84,17 @@
       {
          throw new RuntimeException(e);
       }
+      finally
+      {
+         gateIn.end();
+      }
    }
 
    public IterableIdentifiableCollection<Category> getAllCategories()
    {
       try
       {
+         gateIn.begin();
          final List<ApplicationCategory> categories = gateIn.getRegistryService().getApplicationCategories();
          return new AdaptedIterableIdentifiableCollection<ApplicationCategory, Category>(categories.size(), categories.iterator())
          {
@@ -107,12 +113,17 @@
       {
          throw new RuntimeException(e);
       }
+      finally
+      {
+         gateIn.end();
+      }
    }
 
    private Category getOrCreateCategory(String name, boolean forceCreate)
    {
       try
       {
+         gateIn.begin();
          ApplicationRegistryService registryService = gateIn.getRegistryService();
          ApplicationCategory applicationCategory = registryService.getApplicationCategory(name);
          if (applicationCategory == null)
@@ -135,18 +146,27 @@
       {
          throw new RuntimeException(e);
       }
+      finally
+      {
+         gateIn.end();
+      }
    }
 
    private boolean doesCategoryExist(String name)
    {
       try
       {
+         gateIn.begin();
          return gateIn.getRegistryService().getApplicationCategory(name) != null;
       }
       catch (Exception e)
       {
          throw new RuntimeException(e);
       }
+      finally
+      {
+         gateIn.end();
+      }
    }
 
    public <T extends Content> T get(Id<T> id)
@@ -157,23 +177,33 @@
       {
          try
          {
+            gateIn.begin();
             result = new ApplicationImpl(gateIn.getRegistryService().getApplication(id.toString()), gateIn);
          }
          catch (Exception e)
          {
             throw new RuntimeException(e);
          }
+         finally
+         {
+            gateIn.end();
+         }
       }
       else if (Gadget.class.equals(type))
       {
          try
          {
+            gateIn.begin();
             result = new GadgetImpl(gateIn.getGadgetService().getGadget(id.toString()), gateIn);
          }
          catch (Exception e)
          {
             throw new RuntimeException(e);
          }
+         finally
+         {
+            gateIn.end();
+         }
       }
       else
       {



More information about the gatein-commits mailing list