svn commit: r617699 - /lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentFactoryImpl.java

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: andreas
Date: Fri Feb  1 15:16:28 2008
New Revision: 617699

URL: http://svn.apache.org/viewvc?rev=617699&view=rev
Log:
Store static reference to (thread safe) publication manager in DocumentFactory to improve performance.

Modified:
    lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentFactoryImpl.java

Modified: lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentFactoryImpl.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentFactoryImpl.java?rev=617699&r1=617698&r2=617699&view=diff
==============================================================================
--- lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentFactoryImpl.java (original)
+++ lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentFactoryImpl.java Fri Feb  1 15:16:28 2008
@@ -335,17 +335,17 @@
         return getPubManager().getPublications(this);
     }
 
-    private PublicationManager pubManager;
+    private static PublicationManager pubManager;
 
     protected PublicationManager getPubManager() {
-        if (this.pubManager == null) {
+        if (pubManager == null) {
             try {
-                this.pubManager = (PublicationManager) this.manager.lookup(PublicationManager.ROLE);
+                pubManager = (PublicationManager) this.manager.lookup(PublicationManager.ROLE);
             } catch (ServiceException e) {
                 throw new RuntimeException(e);
             }
         }
-        return this.pubManager;
+        return pubManager;
     }
 
     public boolean existsPublication(String id) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.