svn commit: r742243 - in /lenya/trunk: org.apache.lenya.core.impl/ org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/repository/ org.apache.lenya.core.impl/src/main/resources/META-INF/cocoon/spring/ org.apache.lenya.module.notification/ org...

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: froethenbacher
Date: Mon Feb  9 03:38:58 2009
New Revision: 742243

URL: http://svn.apache.org/viewvc?rev=742243&view=rev
Log:
Refactored Lenya UUID generation using Java provided UUID generator.
Removed then obsolete dependencies on Axis.

Added:
    lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/repository/LenyaUUIDGenerator.java   (contents, props changed)
      - copied, changed from r742153, lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/repository/AxisUUIDGenerator.java
Removed:
    lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/repository/AxisUUIDGenerator.java
Modified:
    lenya/trunk/org.apache.lenya.core.impl/pom.xml
    lenya/trunk/org.apache.lenya.core.impl/src/main/resources/META-INF/cocoon/spring/lenya-core-impl-components.xml
    lenya/trunk/org.apache.lenya.module.notification/pom.xml
    lenya/trunk/org.apache.lenya.module.notification/src/main/java/org/apache/lenya/inbox/xml/XmlSourceInbox.java
    lenya/trunk/org.apache.lenya.parent/pom.xml

Modified: lenya/trunk/org.apache.lenya.core.impl/pom.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/pom.xml?rev=742243&r1=742242&r2=742243&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/pom.xml (original)
+++ lenya/trunk/org.apache.lenya.core.impl/pom.xml Mon Feb  9 03:38:58 2009
@@ -24,10 +24,6 @@
       <artifactId>lenya-core-api</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.axis</groupId>
-      <artifactId>axis</artifactId>
-    </dependency>
-    <dependency>
       <groupId>javax.servlet</groupId>
       <artifactId>servlet-api</artifactId>
     </dependency>

Copied: lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/repository/LenyaUUIDGenerator.java (from r742153, lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/repository/AxisUUIDGenerator.java)
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/repository/LenyaUUIDGenerator.java?p2=lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/repository/LenyaUUIDGenerator.java&p1=lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/repository/AxisUUIDGenerator.java&r1=742153&r2=742243&rev=742243&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/repository/AxisUUIDGenerator.java (original)
+++ lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/repository/LenyaUUIDGenerator.java Mon Feb  9 03:38:58 2009
@@ -17,27 +17,17 @@
  */
 package org.apache.lenya.cms.repository;
 
-import org.apache.axis.components.uuid.UUIDGen;
-import org.apache.axis.components.uuid.UUIDGenFactory;
+import java.util.UUID;
+
 import org.apache.cocoon.util.AbstractLogEnabled;
 
 /**
- * UUID generator based on Apache Axis.
+ * Lenya UUID generator.
  */
-public class AxisUUIDGenerator extends AbstractLogEnabled implements UUIDGenerator {
-
-	// FIXME Get rid of this absurd dependency on Axis!! - fr
-    private UUIDGen delegate;
-
-    protected UUIDGen getDelegate() {
-        if (this.delegate == null) {
-            this.delegate = UUIDGenFactory.getUUIDGen();
-        }
-        return this.delegate;
-    }
+public class LenyaUUIDGenerator extends AbstractLogEnabled implements UUIDGenerator {
 
     public String nextUUID() {
-        return getDelegate().nextUUID();
+    	return UUID.randomUUID().toString();
     }
 
 }

Propchange: lenya/trunk/org.apache.lenya.core.impl/src/main/java/org/apache/lenya/cms/repository/LenyaUUIDGenerator.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Modified: lenya/trunk/org.apache.lenya.core.impl/src/main/resources/META-INF/cocoon/spring/lenya-core-impl-components.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.core.impl/src/main/resources/META-INF/cocoon/spring/lenya-core-impl-components.xml?rev=742243&r1=742242&r2=742243&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.core.impl/src/main/resources/META-INF/cocoon/spring/lenya-core-impl-components.xml (original)
+++ lenya/trunk/org.apache.lenya.core.impl/src/main/resources/META-INF/cocoon/spring/lenya-core-impl-components.xml Mon Feb  9 03:38:58 2009
@@ -56,5 +56,5 @@
     <property name="repositoryManager" ref="org.apache.lenya.cms.repository.RepositoryManager"/>
   </bean>
   <bean name="org.apache.lenya.cms.repository.UUIDGenerator"
-    class="org.apache.lenya.cms.repository.AxisUUIDGenerator"/>
+    class="org.apache.lenya.cms.repository.LenyaUUIDGenerator"/>
 </beans>

Modified: lenya/trunk/org.apache.lenya.module.notification/pom.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.module.notification/pom.xml?rev=742243&r1=742242&r2=742243&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.module.notification/pom.xml (original)
+++ lenya/trunk/org.apache.lenya.module.notification/pom.xml Mon Feb  9 03:38:58 2009
@@ -34,10 +34,6 @@
       <artifactId>lenya-core-usecase</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.axis</groupId>
-      <artifactId>axis</artifactId>
-    </dependency>
-    <dependency>
       <groupId>javax.mail</groupId>
       <artifactId>mail</artifactId>
       <version>${javax.mail.version}</version>

Modified: lenya/trunk/org.apache.lenya.module.notification/src/main/java/org/apache/lenya/inbox/xml/XmlSourceInbox.java
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.module.notification/src/main/java/org/apache/lenya/inbox/xml/XmlSourceInbox.java?rev=742243&r1=742242&r2=742243&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.module.notification/src/main/java/org/apache/lenya/inbox/xml/XmlSourceInbox.java (original)
+++ lenya/trunk/org.apache.lenya.module.notification/src/main/java/org/apache/lenya/inbox/xml/XmlSourceInbox.java Mon Feb  9 03:38:58 2009
@@ -19,17 +19,18 @@
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.UUID;
 
 import javax.xml.parsers.ParserConfigurationException;
 
+import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
-import org.apache.axis.components.uuid.UUIDGen;
-import org.apache.axis.components.uuid.UUIDGenFactory;
 import org.apache.lenya.ac.AccessControlException;
 import org.apache.lenya.ac.Group;
 import org.apache.lenya.ac.Identifiable;
 import org.apache.lenya.ac.User;
 import org.apache.lenya.cms.cocoon.source.SourceUtil;
+import org.apache.lenya.cms.repository.UUIDGenerator;
 import org.apache.lenya.inbox.Inbox;
 import org.apache.lenya.inbox.InboxMessage;
 import org.apache.lenya.notification.Message;
@@ -65,11 +66,13 @@
     }
 
     protected String generateId() {
-    	// FIXME Get rid of this absurd dependency on Axis
-    	//       Move code into Lenya to resolve this.
-        UUIDGen generator = UUIDGenFactory.getUUIDGen();
-        String id = generator.nextUUID();
-        return id;
+    	UUIDGenerator uuidGenerator;
+		try {
+			uuidGenerator = (UUIDGenerator) manager.lookup(UUIDGenerator.ROLE);
+		} catch (ServiceException e) {
+			throw new RuntimeException("Error looking up UUID generator", e);
+		}
+    	return uuidGenerator.nextUUID();
     }
 
     public synchronized void remove(InboxMessage message) {

Modified: lenya/trunk/org.apache.lenya.parent/pom.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/org.apache.lenya.parent/pom.xml?rev=742243&r1=742242&r2=742243&view=diff
==============================================================================
--- lenya/trunk/org.apache.lenya.parent/pom.xml (original)
+++ lenya/trunk/org.apache.lenya.parent/pom.xml Mon Feb  9 03:38:58 2009
@@ -20,6 +20,39 @@
   <url>http://lenya.apache.org</url>
   <inceptionYear>2003</inceptionYear>
 
+  <mailingLists>
+    <mailingList>
+      <name>Lenya User List</name>
+      <subscribe>[email protected]</subscribe>
+      <unsubscribe>[email protected]</unsubscribe>
+      <post>[email protected]</post>
+      <archive>http://mail-archives.apache.org/mod_mbox/lenya-user/</archive>
+      <otherArchives>
+        <otherArchive>http://markmail.org/search/list:org.apache.lenya.user</otherArchive>
+      </otherArchives>
+    </mailingList>
+    <mailingList>
+      <name>Lenya Developer List</name>
+      <subscribe>[email protected]</subscribe>
+      <unsubscribe>[email protected]</unsubscribe>
+      <post>[email protected]</post>
+      <archive>http://mail-archives.apache.org/mod_mbox/lenya-dev/</archive>
+      <otherArchives>
+        <otherArchive>http://markmail.org/search/list:org.apache.lenya.dev/</otherArchive>
+      </otherArchives>
+    </mailingList>
+    <mailingList>
+      <name>Lenya Commits List</name>
+      <subscribe>[email protected]</subscribe>
+      <unsubscribe>[email protected]</unsubscribe>
+      <post>[email protected]</post>
+      <archive>http://mail-archives.apache.org/mod_mbox/lenya-commits/</archive>
+      <otherArchives>
+        <otherArchive>http://markmail.org/search/list:org.apache.lenya.commits/</otherArchive>
+      </otherArchives>
+    </mailingList>
+  </mailingLists>
+
   <developers>
     <developer>
       <id>chestnut</id>
@@ -356,21 +389,6 @@
         <artifactId>spring-core</artifactId>
         <version>${spring.version}</version>
       </dependency>
-      <dependency>
-        <groupId>org.apache.axis</groupId>
-        <artifactId>axis</artifactId>
-        <version>1.4</version>
-        <exclusions>
-          <exclusion>
-            <groupId>javax.mail</groupId>
-            <artifactId>mail</artifactId>
-          </exclusion>
-          <exclusion>
-            <groupId>javax.activation</groupId>
-            <artifactId>activation</artifactId>
-          </exclusion>
-        </exclusions>
-      </dependency>
       
       <!-- Cocoon -->
       <dependency>
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.