[jboss-svn-commits] JBL Code SVN: r5267 - in labs/shotoku/trunk: . app/META-INF shotoku-base/src/etc shotoku-base/src/java/org/jboss/shotoku shotoku-base/src/java/org/jboss/shotoku/service shotoku-feeds shotoku-feeds/src/java/org/jboss/shotoku/feeds shotoku-feeds/src/java/org/jboss/shotoku/feeds/data shotoku-feeds/src/java/org/jboss/shotoku/feeds/service shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag shotoku-feeds/src/java/org/jboss/shotoku/feeds/tools shotoku-feeds/src/java/org/jboss/shotoku/feeds/variables shotoku-files shotoku-jcr shotoku-svn shotoku-svn/src/java/org/jboss/shotoku/svn shotoku-svn/src/java/org/jboss/shotoku/svn/service shotoku-tags/src/java/org/jboss/shotoku/tags/service shotoku-tags/src/java/org/jboss/shotoku/tags/tools shotoku-user/src/java/org/jboss/shotoku/user shotoku-user/src/java/org/jboss/shotoku/user/service

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Jul 24 17:18:53 EDT 2006


Author: adamw
Date: 2006-07-24 17:18:42 -0400 (Mon, 24 Jul 2006)
New Revision: 5267

Added:
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsService.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/service/
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/service/FeedsServiceImpl.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/service/FeedsServiceLocal.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tools/FeedsConstants.java
Removed:
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsCache.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tools/Constants.java
Modified:
   labs/shotoku/trunk/app/META-INF/jboss-service.xml
   labs/shotoku/trunk/app/META-INF/login-config.xml
   labs/shotoku/trunk/project.properties
   labs/shotoku/trunk/shotoku-base/src/etc/shotoku.properties.sample
   labs/shotoku/trunk/shotoku-base/src/java/org/jboss/shotoku/ContentManager.java
   labs/shotoku/trunk/shotoku-base/src/java/org/jboss/shotoku/service/ShotokuServiceImpl.java
   labs/shotoku/trunk/shotoku-feeds/maven.xml
   labs/shotoku/trunk/shotoku-feeds/project.properties
   labs/shotoku/trunk/shotoku-feeds/project.xml
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsDescriptor.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsServlet.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/AtomFeed.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/RdfFeed.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/Rss2Feed.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/Rss2TagFeed.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/AggregatedFeedTagHandler.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/FeedTagHandler.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/FeedTagHandlerManager.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/RemoteFeedTagHandler.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/ShotokuFeedTagHandler.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/TagFeedTagHandler.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tools/FeedsTools.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/variables/VariableResolverManager.java
   labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/variables/XmlNodeTypeVariableResolver.java
   labs/shotoku/trunk/shotoku-files/maven.xml
   labs/shotoku/trunk/shotoku-jcr/maven.xml
   labs/shotoku/trunk/shotoku-svn/maven.xml
   labs/shotoku/trunk/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnContentManager.java
   labs/shotoku/trunk/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java
   labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/service/TagServiceImpl.java
   labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/tools/Constants.java
   labs/shotoku/trunk/shotoku-user/src/java/org/jboss/shotoku/user/UserService.java
   labs/shotoku/trunk/shotoku-user/src/java/org/jboss/shotoku/user/service/UserServiceImpl.java
Log:
http://jira.jboss.org/jira/browse/JBSHOTOKU-36 : Feeds migrated to an independent service

Shotoku build changes


Modified: labs/shotoku/trunk/app/META-INF/jboss-service.xml
===================================================================
--- labs/shotoku/trunk/app/META-INF/jboss-service.xml	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/app/META-INF/jboss-service.xml	2006-07-24 21:18:42 UTC (rev 5267)
@@ -1,10 +1,10 @@
 <server>
-    <mbean code="org.jboss.security.plugins.JaasSecurityDomain"
+    <!--<mbean code="org.jboss.security.plugins.JaasSecurityDomain"
            name="shotoku:service=SecurityDomain">
         <constructor>
             <arg type="java.lang.String" value="shotokuCert"/>
         </constructor>
         <attribute name="KeyStoreURL">resource:server.keystore</attribute>
         <attribute name="KeyStorePass">servercert</attribute>
-    </mbean>
+    </mbean>-->
 </server>

Modified: labs/shotoku/trunk/app/META-INF/login-config.xml
===================================================================
--- labs/shotoku/trunk/app/META-INF/login-config.xml	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/app/META-INF/login-config.xml	2006-07-24 21:18:42 UTC (rev 5267)
@@ -14,7 +14,7 @@
         </authentication>
     </application-policy>
 
-    <application-policy name="shotokuCert">
+    <!--<application-policy name="shotokuCert">
         <authentication>
             <login-module code="org.jboss.security.auth.spi.BaseCertLoginModule"
                           flag="sufficient">
@@ -28,5 +28,5 @@
                 <module-option name="rolesProperties">roles.properties</module-option>
             </login-module>
         </authentication>
-    </application-policy>
+    </application-policy>-->
 </policy>

Modified: labs/shotoku/trunk/project.properties
===================================================================
--- labs/shotoku/trunk/project.properties	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/project.properties	2006-07-24 21:18:42 UTC (rev 5267)
@@ -5,7 +5,7 @@
 
 shotoku.sar.dir=shotoku.sar
 shotoku.subprojects.cms=base,files,jcr,svn
-shotoku.subprojects=${shotoku.subprojects.cms},aop,test,user,web,admin,tags,feeds,portal,file-access
+shotoku.subprojects=${shotoku.subprojects.cms},aop,test,user,web,admin,tags,feeds,file-access
 
 maven.final.name=${pom.artifactId}
 

Modified: labs/shotoku/trunk/shotoku-base/src/etc/shotoku.properties.sample
===================================================================
--- labs/shotoku/trunk/shotoku-base/src/etc/shotoku.properties.sample	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-base/src/etc/shotoku.properties.sample	2006-07-24 21:18:42 UTC (rev 5267)
@@ -31,6 +31,7 @@
 # Content manager and directory in which feeds.properties is placed in shotoku
 shotoku.internal.feeds.configcmid =
 shotoku.internal.feeds.configdir =
+shotoku.internal.feeds.service.interval = 10000
 
 # Tags configuration
 # Content manager and base directory with which synchronization of Shotoku tags

Modified: labs/shotoku/trunk/shotoku-base/src/java/org/jboss/shotoku/ContentManager.java
===================================================================
--- labs/shotoku/trunk/shotoku-base/src/java/org/jboss/shotoku/ContentManager.java	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-base/src/java/org/jboss/shotoku/ContentManager.java	2006-07-24 21:18:42 UTC (rev 5267)
@@ -448,12 +448,17 @@
     private static int defaultServiceInterval;
 
     /**
-     * <code>contentManagers</code> - map (content manager id -> content
-     * manager constructor).
+     * Map (content manager impl class name -> content manager constructor).
      */
-    private static Map<String, Pair<Constructor, Configuration>> contentManagers;
+    private static Map<String, Constructor> contentManagers;
 
     /**
+     * Map (content manager id -> pair (content manager class name, content
+     * manager configuration)
+     */
+    public static Map<String, Pair<String, Configuration>> contentManagersImplementations;
+
+    /**
      * A set of content manager implementation classes names, which are
      * already initialized.
      */
@@ -531,10 +536,11 @@
         engines = Collections
                 .synchronizedMap(new HashMap<String, VelocityEngine>());
 
-        contentManagers = new HashMap<String, Pair<Constructor, Configuration>>();
+        contentManagers = new HashMap<String, Constructor>();
         initializedContentManagers = new HashSet<String>();
         initializedIds = new HashSet<String>();
         implementationsIds = new HashMap<String, Set<String>>();
+        contentManagersImplementations = new HashMap<String, Pair<String, Configuration>>();
 
         // Reading the default properties.
         defaultId = props.getString(Constants.PROPERTIES_ID_DEFAULT,
@@ -556,11 +562,9 @@
 
                 String implementation = conf
                         .getString(Constants.PROPERTIES_IMPL_SUFFIX);
-                Class implClass = Class.forName(implementation);
 
-                contentManagers.put(id, new Pair<Constructor, Configuration>(
-                        implClass.getConstructor(String.class, String.class,
-                                Configuration.class), conf));
+                contentManagersImplementations.put(id, Tools.createPair(
+                        implementation, conf));
 
                 Set<String> implIds = implementationsIds.get(implementation);
                 if (implIds == null) {
@@ -583,20 +587,23 @@
     private synchronized static void initializeId(String id) {
         if (!initializedIds.contains(id)) {
             try {
-                Pair<Constructor, Configuration> cc = contentManagers.get(id);
-                Class implClass = cc.getFirst().getDeclaringClass();
+                Pair<String, Configuration> ic =
+                        contentManagersImplementations.get(id);
 
                 // First initializing the whole implementation, if it hasn't
                 // been done yet.
-                initializeContentManager(implClass.getName());
+                initializeContentManager(ic.getFirst());
 
+                Constructor constr = contentManagers.get(ic.getFirst());
+                Class implClass = constr.getDeclaringClass();
+
                 // Executing the setup function.
                 try {
                     Method setupMethod = implClass.getMethod(
                             Constants.SETUP_FUNCTION, String.class,
                             Configuration.class);
 
-                    setupMethod.invoke(implClass, id, cc.getSecond());
+                    setupMethod.invoke(implClass, id, ic.getSecond());
                 } catch (NoSuchMethodException e) {
                     // No setup - doing nothing.
                 }
@@ -629,6 +636,10 @@
 
                 initializedContentManagers.add(implementation);
 
+                contentManagers.put(implementation,
+                        implClass.getConstructor(String.class,
+                                String.class, Configuration.class));
+
                 // Initializing all ids.
                 Set<String> implIds = implementationsIds.get(implementation);
                 if (implIds != null) {
@@ -684,22 +695,28 @@
             setup();
         }
 
-        if (id == null)
+        if (id == null) {
             id = defaultId;
-        if (prefix == null)
+        }
+
+        if (prefix == null) {
             prefix = "";
-        else
+        } else {
             prefix = Tools.normalizeSlashes(prefix, true);
+        }
 
-        Pair<Constructor, Configuration> cmData = contentManagers.get(id);
+        Pair<String, Configuration> cmData = contentManagersImplementations.get(id);
 
-        if (cmData == null)
+        if (cmData == null) {
             return null;
+        }
 
+        Constructor constr = contentManagers.get(cmData.getFirst());
+
         initializeId(id);
 
         try {
-            return (ContentManager) cmData.getFirst().newInstance(id, prefix,
+            return (ContentManager) constr.newInstance(id, prefix,
                     cmData.getSecond());
         } catch (Throwable e) {
             log.warn("Unable to get a content manager: (" + id + ", " + prefix

Modified: labs/shotoku/trunk/shotoku-base/src/java/org/jboss/shotoku/service/ShotokuServiceImpl.java
===================================================================
--- labs/shotoku/trunk/shotoku-base/src/java/org/jboss/shotoku/service/ShotokuServiceImpl.java	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-base/src/java/org/jboss/shotoku/service/ShotokuServiceImpl.java	2006-07-24 21:18:42 UTC (rev 5267)
@@ -60,7 +60,7 @@
          */
         ContentManager.setup();
 
-        log.info("Shotoku service created.");
+        super.afterCreate();
     }
 
     public void start() throws Exception {
@@ -74,7 +74,7 @@
 
         startUpdateThread();
 
-        log.info("Shotoku service started.");
+        super.afterStart();
     }
 
     public void destroy() {

Modified: labs/shotoku/trunk/shotoku-feeds/maven.xml
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/maven.xml	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-feeds/maven.xml	2006-07-24 21:18:42 UTC (rev 5267)
@@ -4,26 +4,55 @@
   See terms of license at gnu.org. 
  -->
 <project xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:u="jelly:util">
-	<!-- Default war-project goals -->
+    <!-- Default war-project goals -->
 
-	<goal name="build">
-		<attainGoal name="jar" />
-		<attainGoal name="war" />
-	</goal>
-    
-	<goal name="deploy">	
-       <ant:copy
+    <goal name="build">
+        <attainGoal name="java:compile" />
+        <attainGoal name="ejb" />
+        <attainGoal name="war" />
+    </goal>
+
+    <goal name="copy-from-maven-to-sar">
+        <ant:copy
+                file="${maven.repo.local}/${to.copy}"
+                todir="target/${feeds.sar.dir}" />
+    </goal>
+
+    <goal name="deploy">
+        <ant:copy
+                file="target/shotoku-feeds.jar"
+                tofile="${local.deploy.dir}/shotoku-feeds.ejb3" />
+        <ant:copy
                 file="target/shotoku-feeds.war"
                 todir="${local.deploy.dir}" />
-	</goal>
-	
-	<goal name="clean">
-		<attainGoal name="prj-clean" />
-	</goal>
-	
-	<goal name="all">
-		<attainGoal name="clean" />
-		<attainGoal name="build" />
-		<attainGoal name="deploy" />
-	</goal>
+
+        <ant:copy
+                todir="../target/${shotoku.sar.dir}" overwrite="true"
+                file="${maven.repo.local}/jdom/jars/jdom-1.0.jar" />
+        <ant:copy
+                todir="../target/${shotoku.sar.dir}" overwrite="true"
+                file="${maven.repo.local}/rome/jars/rome-0.7.jar" />
+        <ant:copy
+                todir="../target/${shotoku.sar.dir}" overwrite="true"
+                file="${maven.repo.local}/informa/jars/informa.jar" />
+        <ant:copy
+                todir="../target/${shotoku.sar.dir}" overwrite="true"
+                file="${maven.repo.local}/xerces/jars/xercesImpl-2.8.0.jar" />
+        <ant:copy
+                todir="../target/${shotoku.sar.dir}" overwrite="true"
+                file="${maven.repo.local}/xerces/jars/xmlParserAPIs-2.6.2.jar" />
+        <ant:copy
+                todir="../target/${shotoku.sar.dir}" overwrite="true"
+                file="${maven.repo.local}/xalan/jars/xalan-2.7.0.jar" />
+    </goal>
+
+    <goal name="clean">
+        <attainGoal name="prj-clean" />
+    </goal>
+
+    <goal name="all">
+        <attainGoal name="clean" />
+        <attainGoal name="build" />
+        <attainGoal name="deploy" />
+    </goal>
 </project>

Modified: labs/shotoku/trunk/shotoku-feeds/project.properties
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/project.properties	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-feeds/project.properties	2006-07-24 21:18:42 UTC (rev 5267)
@@ -7,3 +7,6 @@
 maven.jar.override=on
 maven.jar.informa=${shotoku.root.dir}/shotoku-feeds/lib/informa.jar
 
+maven.war.classes.includes=**/*Servlet*
+maven.ejb.excludes=**/*Servlet*
+

Modified: labs/shotoku/trunk/shotoku-feeds/project.xml
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/project.xml	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-feeds/project.xml	2006-07-24 21:18:42 UTC (rev 5267)
@@ -28,7 +28,7 @@
             <artifactId>shotoku-tags</artifactId>
             <jar>shotoku-tags.jar</jar>
         </dependency>
-	
+
         <dependency>
             <groupId>shotoku</groupId>
             <artifactId>shotoku-aop</artifactId>
@@ -45,18 +45,12 @@
             <groupId>jdom</groupId>
             <artifactId>jdom</artifactId>
             <version>1.0</version>
-            <properties>
-                <war.bundle>true</war.bundle>
-            </properties>
         </dependency>
 
         <dependency>
             <groupId>rome</groupId>
             <artifactId>rome</artifactId>
             <version>0.7</version>
-            <properties>
-                <war.bundle>true</war.bundle>
-            </properties>
         </dependency>
 
         <dependency>
@@ -64,48 +58,9 @@
             <artifactId>informa</artifactId>
             <version>0.6.5</version>
             <jar>informa.jar</jar>
-            <properties>
-                <war.bundle>true</war.bundle>
-            </properties>
         </dependency>
 
         <dependency>
-            <groupId>commons-collections</groupId>
-            <artifactId>commons-collections</artifactId>
-            <version>3.1</version>
-            <properties>
-                <war.bundle>true</war.bundle>
-            </properties>
-        </dependency>
-
-        <dependency>
-            <groupId>xerces</groupId>
-            <artifactId>xercesImpl</artifactId>
-            <version>2.8.0</version>
-            <properties>
-                <war.bundle>true</war.bundle>
-            </properties>
-        </dependency>
-
-        <dependency>
-            <groupId>xerces</groupId>
-            <artifactId>xmlParserAPIs</artifactId>
-            <version>2.6.2</version>
-            <properties>
-                <war.bundle>true</war.bundle>
-            </properties>
-        </dependency>
-
-        <dependency>
-            <groupId>xalan</groupId>
-            <artifactId>xalan</artifactId>
-            <version>2.7.0</version>
-            <properties>
-                <war.bundle>true</war.bundle>
-            </properties>
-        </dependency>
-	
-	<dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <version>3.8.1</version>

Deleted: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsCache.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsCache.java	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsCache.java	2006-07-24 21:18:42 UTC (rev 5267)
@@ -1,40 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.shotoku.feeds;
-
-import org.jboss.shotoku.tools.Pair;
-import org.jboss.shotoku.cache.ShotokuCacheItem;
-
-public class FeedsCache extends ShotokuCacheItem<Pair<String, String>, FeedsDescriptor> {
-    private FeedsDescriptor getDesc(String id, String baseServerAddress) {
-        return new FeedsDescriptor(id, baseServerAddress);
-    }
-
-    public void update(Pair<String, String> key, FeedsDescriptor currentObject) {
-        put(key, getDesc(key.getFirst(), key.getSecond()));
-        currentObject.release();
-    }
-
-    public FeedsDescriptor init(Pair<String, String> key) {
-        return getDesc(key.getFirst(), key.getSecond());
-    }
-}

Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsDescriptor.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsDescriptor.java	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsDescriptor.java	2006-07-24 21:18:42 UTC (rev 5267)
@@ -37,10 +37,9 @@
 import org.jboss.shotoku.feeds.variables.VariableResolverManager;
 import org.jboss.shotoku.feeds.tag.FeedTagHandler;
 import org.jboss.shotoku.feeds.tag.FeedTagHandlerManager;
-import org.jboss.shotoku.feeds.tools.Constants;
+import org.jboss.shotoku.feeds.tools.FeedsConstants;
 import org.jboss.shotoku.tools.Pair;
 import org.jboss.shotoku.tools.Tools;
-import org.jboss.shotoku.aop.CacheItem;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 import org.xml.sax.InputSource;
@@ -56,16 +55,8 @@
 public class FeedsDescriptor {
     private static final Logger log = Logger.getLogger(FeedsDescriptor.class);
 
-    @CacheItem
-    private static FeedsCache feedsCache;
+    private Pair<String, String> confKey;
 
-    @CacheItem
-    private static FeedsConfigurationWatcher conf;
-
-    static synchronized FeedsDescriptor getInstance(String id, String baseServerAddress) {
-        return feedsCache.get(new Pair<String, String>(id, baseServerAddress));
-    }
-
     /**
      * Ready feeds: feed name -> (feed type -> feed).
      */
@@ -90,23 +81,24 @@
      */
     private Set<String> duringGeneration;
 
-    private String baseServerAddress;
+    private FeedsConfigurationWatcher fcw;
 
-    public FeedsDescriptor(String id, String baseServerAddress) {
-        this.baseServerAddress = baseServerAddress;
+    public FeedsDescriptor(String id, FeedsConfigurationWatcher fcw) {
+        this.fcw = fcw;
 
+        confKey = Tools.createPair(
+                ContentManager.getProperty(FeedsConstants.CONFIGID, ""),
+                ContentManager.getProperty(FeedsConstants.CONFIGDIR, ""));
+
         // From the global Shotoku configuration, reading the config file
         // location in Shotoku repositories.
-        Properties props = conf.get(new Pair<String, String>(
-                ContentManager.getProperty(Constants.CONFIGID, ""),
-                ContentManager.getProperty(Constants.CONFIGDIR, "")
-        ));
+        Properties props = getProperties();
 
         // From properties read from Shotoku, getting the content manager
         // configuration for this feeds id.
         ContentManager cm = ContentManager.getContentManager(
-                props.getProperty(id + Constants.FEEDID),
-                props.getProperty(id + Constants.FEEDDIR)
+                props.getProperty(id + FeedsConstants.FEEDID),
+                props.getProperty(id + FeedsConstants.FEEDDIR)
         );
 
         vrm = new VariableResolverManager(id, props);
@@ -119,7 +111,7 @@
         // Looking for file containing feed definitons and filling the maps.
         for (org.jboss.shotoku.Node feedNode :
                 cm.getRootDirectory().getNodes().toList()) {
-            if (feedNode.getName().endsWith(Constants.NODE_ENDING)) {
+            if (feedNode.getName().endsWith(FeedsConstants.NODE_ENDING)) {
                 try {
                     addFeedDefinitions(feedNode);
                 } catch (Exception e) {
@@ -138,6 +130,10 @@
         }
     }
 
+    public Properties getProperties() {
+        return fcw.get(confKey);
+    }
+
     private void addFeedDefinitions(org.jboss.shotoku.Node node) throws SAXException, IOException {
         DOMParser parser = new DOMParser();
         // Parse the descriptor at the given Shotoku node.
@@ -275,10 +271,6 @@
         return ret;
     }
 
-    public String getBaseServerAddress() {
-        return baseServerAddress;
-    }
-
     public VariableResolverManager getVariableResolverManager() {
         return vrm;
     }

Added: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsService.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsService.java	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsService.java	2006-07-24 21:18:42 UTC (rev 5267)
@@ -0,0 +1,20 @@
+package org.jboss.shotoku.feeds;
+
+import org.jboss.shotoku.service.AdministratedService;
+import org.jboss.shotoku.feeds.data.Feed;
+
+/**
+ * @author Adam Warski (adamw at aster.pl)
+ */
+public interface FeedsService extends AdministratedService {
+    public Feed getFeed(String id, String name, String type);
+
+    /*
+     * SERVICE MANAGEMENT METHODS
+     */
+
+    public void create() throws Exception;
+    public void start() throws Exception;
+    public void stop();
+    public void destroy();
+}

Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsServlet.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsServlet.java	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/FeedsServlet.java	2006-07-24 21:18:42 UTC (rev 5267)
@@ -24,12 +24,12 @@
 import java.io.IOException;
 
 import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import org.jboss.shotoku.feeds.data.Feed;
+import org.jboss.shotoku.feeds.tools.FeedsTools;
 
 public class FeedsServlet extends HttpServlet {
     private void invalidRequest(HttpServletResponse response) throws IOException {
@@ -37,15 +37,6 @@
         response.getWriter().println("The feed you requested is not available.");
     }
 
-    private static String makeAddress(String scheme, String server, int port) {
-        return scheme + "://" + server + ":" + port;
-    }
-
-    public static String getBaseServerAddress(ServletRequest request) {
-        return makeAddress(request.getScheme(), request.getServerName(),
-                request.getServerPort());
-    }
-
     @Override
     protected void doGet(HttpServletRequest request, HttpServletResponse response)
     throws ServletException, IOException {
@@ -69,8 +60,7 @@
         String type = requestURI.substring(lastSlash+1);
         String name = requestURI.substring(0, lastSlash);
 
-        Feed feed = FeedsDescriptor.getInstance("default",
-                getBaseServerAddress(request)).getFeed(name, type);
+        Feed feed = FeedsTools.getService().getFeed("default", name, type);
 
         if (feed == null) {
             invalidRequest(response);

Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/AtomFeed.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/AtomFeed.java	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/AtomFeed.java	2006-07-24 21:18:42 UTC (rev 5267)
@@ -22,13 +22,12 @@
 package org.jboss.shotoku.feeds.data;
 
 import java.io.File;
-import java.io.IOException;
 
 import com.sun.syndication.feed.synd.SyndFeed;
-import org.jboss.shotoku.feeds.tools.Constants;
+import org.jboss.shotoku.feeds.tools.FeedsConstants;
 
 public class AtomFeed extends RomeBasedFeed {
-    public AtomFeed(String name, String displayName, String type, File file) throws IOException {
+    public AtomFeed(String name, String displayName, String type, File file) {
         super(name, displayName, type, file);
     }
 
@@ -39,6 +38,6 @@
 
     @Override
     protected String getContentType() {
-        return Constants.ATOM_CONTENT_TYPE;
+        return FeedsConstants.ATOM_CONTENT_TYPE;
     }
 }

Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/RdfFeed.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/RdfFeed.java	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/RdfFeed.java	2006-07-24 21:18:42 UTC (rev 5267)
@@ -26,7 +26,7 @@
 
 import de.nava.informa.core.ChannelExporterIF;
 import de.nava.informa.exporters.RSS_1_0_Exporter;
-import org.jboss.shotoku.feeds.tools.Constants;
+import org.jboss.shotoku.feeds.tools.FeedsConstants;
 
 public class RdfFeed extends InformaBasedFeed {
     public RdfFeed(String name, String displayName, String type, File file) {
@@ -39,6 +39,6 @@
 
     @Override
     protected String getContentType() {
-        return Constants.RDF_CONTENT_TYPE;
+        return FeedsConstants.RDF_CONTENT_TYPE;
     }
 }

Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/Rss2Feed.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/Rss2Feed.java	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/Rss2Feed.java	2006-07-24 21:18:42 UTC (rev 5267)
@@ -26,7 +26,7 @@
 
 import com.sun.syndication.feed.synd.SyndFeed;
 import org.jboss.shotoku.feeds.data.RomeBasedFeed;
-import org.jboss.shotoku.feeds.tools.Constants;
+import org.jboss.shotoku.feeds.tools.FeedsConstants;
 
 public class Rss2Feed extends RomeBasedFeed {
     public Rss2Feed(String name, String displayName, String type, File file) throws IOException {
@@ -40,6 +40,6 @@
 
     @Override
     protected String getContentType() {
-        return Constants.RSS_CONTENT_TYPE;
+        return FeedsConstants.RSS_CONTENT_TYPE;
     }
 }

Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/Rss2TagFeed.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/Rss2TagFeed.java	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/Rss2TagFeed.java	2006-07-24 21:18:42 UTC (rev 5267)
@@ -1,6 +1,6 @@
 package org.jboss.shotoku.feeds.data;
 
-import org.jboss.shotoku.feeds.tools.Constants;
+import org.jboss.shotoku.feeds.tools.FeedsConstants;
 import org.apache.velocity.VelocityContext;
 
 import java.util.Map;
@@ -15,6 +15,6 @@
     }
 
     public String getContentType() {
-        return Constants.RSS_CONTENT_TYPE;
+        return FeedsConstants.RSS_CONTENT_TYPE;
     }
 }

Added: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/service/FeedsServiceImpl.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/service/FeedsServiceImpl.java	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/service/FeedsServiceImpl.java	2006-07-24 21:18:42 UTC (rev 5267)
@@ -0,0 +1,114 @@
+package org.jboss.shotoku.feeds.service;
+
+import org.jboss.annotation.ejb.Service;
+import org.jboss.annotation.ejb.Management;
+import org.jboss.annotation.ejb.Depends;
+import org.jboss.shotoku.feeds.FeedsService;
+import org.jboss.shotoku.feeds.FeedsDescriptor;
+import org.jboss.shotoku.feeds.FeedsConfigurationWatcher;
+import org.jboss.shotoku.feeds.data.Feed;
+import org.jboss.shotoku.feeds.tools.FeedsConstants;
+import org.jboss.shotoku.feeds.tools.FeedsTools;
+import org.jboss.shotoku.service.AdministratedServiceImpl;
+import org.jboss.shotoku.service.AdministratedService;
+import org.jboss.shotoku.ContentManager;
+import org.jboss.shotoku.tools.Constants;
+import org.jboss.shotoku.aop.CacheItem;
+
+import javax.ejb.Local;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * @author Adam Warski (adamw at aster.pl)
+ */
+ at Service(objectName = FeedsConstants.FEEDS_SERVICE_NAME)
+ at Local(FeedsServiceLocal.class)
+ at Management(FeedsService.class)
+ at Depends(Constants.SHOTOKU_SERVICE_NAME)
+public class FeedsServiceImpl extends AdministratedServiceImpl
+        implements FeedsService, FeedsServiceLocal {
+    /*
+     * FeedsService implementation.
+     */
+
+    @SuppressWarnings({"UNUSED_SYMBOL"})
+    @CacheItem
+    private static FeedsConfigurationWatcher conf;
+
+    private ConcurrentHashMap<String, FeedsDescriptor> fds;
+    public static final Object synchronizer = new Object();
+
+    public Feed getFeed(String id, String name, String type) {
+        if (!fds.contains(id)) {
+            synchronized(synchronizer) {
+                if (!fds.contains(id)) {
+                    fds.put(id, new FeedsDescriptor(id, conf));
+                }
+            }
+        }
+
+        return fds.get(id).getFeed(name, type);
+    }
+
+    /*
+     * Update method.
+     */
+
+    public void update() {
+        for (String id : fds.keySet()) {
+            FeedsDescriptor fd = fds.get(id);
+            fds.put(id, new FeedsDescriptor(id, conf));
+            fd.release();
+        }
+    }
+
+    /*
+     * Service management.
+     */
+
+    public void create() throws Exception {
+        super.create();
+
+        setTimerInterval(ContentManager.getProperty(
+                FeedsConstants.PROPERTY_INTERVAL, 10000));
+        fds = new ConcurrentHashMap<String, FeedsDescriptor>();
+
+        super.afterCreate();
+    }
+
+    public void start() throws Exception {
+        super.start();
+        startUpdateThread();
+        super.afterStart();
+    }
+
+    public void destroy() {
+
+    }
+
+    /*
+     * Administrated service implementation.
+     */
+
+    public String getServiceId() {
+        return "ShotokuFeedsService";
+    }
+
+    public String getServiceName() {
+        return "Feeds service";
+    }
+
+    public String getServiceDescription() {
+        StringBuffer sb = new StringBuffer("Shotoku feeds service is " +
+                "handling the following feed configurations: ");
+        for (String id : fds.keySet()) {
+            sb.append(id).append(" ");
+        }
+
+        return sb.append(".").toString();
+    }
+
+    public AdministratedService getServiceInstance() {
+        return FeedsTools.getService();
+    }
+}

Added: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/service/FeedsServiceLocal.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/service/FeedsServiceLocal.java	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/service/FeedsServiceLocal.java	2006-07-24 21:18:42 UTC (rev 5267)
@@ -0,0 +1,7 @@
+package org.jboss.shotoku.feeds.service;
+
+/**
+ * @author Adam Warski (adamw at aster.pl)
+ */
+public interface FeedsServiceLocal {
+}

Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/AggregatedFeedTagHandler.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/AggregatedFeedTagHandler.java	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/AggregatedFeedTagHandler.java	2006-07-24 21:18:42 UTC (rev 5267)
@@ -5,7 +5,7 @@
 import org.jboss.shotoku.feeds.data.NormalFeed;
 import org.jboss.shotoku.feeds.FeedFactory;
 import org.jboss.shotoku.feeds.FeedsDescriptor;
-import org.jboss.shotoku.feeds.tools.Constants;
+import org.jboss.shotoku.feeds.tools.FeedsConstants;
 import org.jboss.shotoku.feeds.variables.Substitution;
 import org.jboss.shotoku.tools.Tools;
 import org.apache.log4j.Logger;
@@ -29,8 +29,7 @@
         Node definition = getDefinition();
 
         // Reading all attributes and making the substitution on them.
-        Map<String, String> attributes = Tools.getMapFromNodeAttributes(definition);
-        getSubstitution().make(attributes);
+        Map<String, String> attributes = getAttributes();
 
         // First, getting (and if need be, generating) the feeds to be
         // aggregated as written in the tag.
@@ -76,7 +75,8 @@
             return false;
         }
 
-        NormalFeed feed = FeedFactory.getNewNormalFeed(feedName, attributes.get(Constants.DISP_NAME_ATTR),
+        NormalFeed feed = FeedFactory.getNewNormalFeed(feedName,
+                attributes.get(FeedsConstants.DISP_NAME_ATTR),
                 feedType);
 
         try {

Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/FeedTagHandler.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/FeedTagHandler.java	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/FeedTagHandler.java	2006-07-24 21:18:42 UTC (rev 5267)
@@ -3,8 +3,11 @@
 import org.w3c.dom.Node;
 import org.jboss.shotoku.feeds.variables.Substitution;
 import org.jboss.shotoku.feeds.FeedsDescriptor;
-import org.jboss.shotoku.feeds.tools.Constants;
+import org.jboss.shotoku.feeds.tools.FeedsConstants;
+import org.jboss.shotoku.tools.Tools;
 
+import java.util.Map;
+
 /**
  * A base class for classes which handle generation of various feed types,
  * basing on feed description that is contained in an xml node.
@@ -15,12 +18,17 @@
     private String group;
     private Node definition;
     private Substitution s;
+    private Map<String, String> attributes;
 
-    public FeedTagHandler(String feedName, String group, Node definition, Substitution s) {
+    public FeedTagHandler(String feedName, String group, Node definition,
+                          Substitution s) {
         this.feedName = feedName;
         this.group = group;
         this.definition = definition;
         this.s = s;
+
+        attributes = Tools.getMapFromNodeAttributes(definition);
+        s.make(attributes);
     }
 
     public String getFeedName() {
@@ -40,9 +48,13 @@
     }
 
     public String getFeedType() {
-        return s.getSubstitutionFor(Constants.TYPE_VARIABLE);
+        return s.getSubstitutionFor(FeedsConstants.TYPE_VARIABLE);
     }
 
+    public Map<String, String> getAttributes() {
+        return attributes;
+    }
+
     /**
      * Generates a feed handled by this instance. The generated feed should
      * be added to the FeedsDescriptor by calling the FeedsDescriptor.addFeed()
@@ -63,7 +75,7 @@
 	 */
 	protected String generateFeedLink(FeedsDescriptor fd, boolean full, String feedName,
                                       String feedType) {
-		return (full ? fd.getBaseServerAddress() : "") + "/feeds/" + feedName + "/"
-				+ feedType;
+		return (full ? getAttributes().get(FeedsConstants.BASE_ADDR_ATTR) : "")
+                + "/feeds/" + feedName + "/" + feedType;
 	}
 }

Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/FeedTagHandlerManager.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/FeedTagHandlerManager.java	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/FeedTagHandlerManager.java	2006-07-24 21:18:42 UTC (rev 5267)
@@ -1,7 +1,7 @@
 package org.jboss.shotoku.feeds.tag;
 
 import org.jboss.shotoku.tools.Tools;
-import org.jboss.shotoku.feeds.tools.Constants;
+import org.jboss.shotoku.feeds.tools.FeedsConstants;
 import org.jboss.shotoku.feeds.FeedsDescriptor;
 import org.jboss.shotoku.feeds.variables.VariableResolverManager;
 import org.jboss.shotoku.feeds.variables.Substitution;
@@ -41,10 +41,10 @@
     static {
         handlers = new HashMap<String, Constructor>();
 
-        addHandler(Constants.AGG_FEED_TAG, AggregatedFeedTagHandler.class);
-        addHandler(Constants.REM_FEED_TAG, RemoteFeedTagHandler.class);
-        addHandler(Constants.SHO_FEED_TAG, ShotokuFeedTagHandler.class);
-        addHandler(Constants.TAG_FEED_TAG, TagFeedTagHandler.class);
+        addHandler(FeedsConstants.AGG_FEED_TAG, AggregatedFeedTagHandler.class);
+        addHandler(FeedsConstants.REM_FEED_TAG, RemoteFeedTagHandler.class);
+        addHandler(FeedsConstants.SHO_FEED_TAG, ShotokuFeedTagHandler.class);
+        addHandler(FeedsConstants.TAG_FEED_TAG, TagFeedTagHandler.class);
     }
 
     /**
@@ -76,7 +76,7 @@
     protected static Set<String> getVariablesForNode(Node n) {
         Set<String> variables = new HashSet<String>();
         // We always have to substitute the type variable.
-        variables.add(Constants.TYPE_VARIABLE);
+        variables.add(FeedsConstants.TYPE_VARIABLE);
         addVariablesFromNode(variables, n);
 
         return variables;
@@ -91,7 +91,7 @@
         }
 
         // Reading the feed name attribute.
-        String feedNameAttr = Tools.getAttributeValue(definition, Constants.NAME_ATTR);
+        String feedNameAttr = Tools.getAttributeValue(definition, FeedsConstants.NAME_ATTR);
 
         // Getting all variables that are in the given node.
         Set<String> variables = getVariablesForNode(definition);
@@ -114,7 +114,7 @@
             String feedName = s.make(feedNameAttr);
 
             try {
-                fd.addFeedTagHandler(feedName, s.getSubstitutionFor(Constants.TYPE_VARIABLE),
+                fd.addFeedTagHandler(feedName, s.getSubstitutionFor(FeedsConstants.TYPE_VARIABLE),
                         (FeedTagHandler) handlerConstr.newInstance(feedName, group, definition, s));
             } catch (Exception e) {
                 log.error("Error constructing feed " + feedName + " tag handler.", e);

Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/RemoteFeedTagHandler.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/RemoteFeedTagHandler.java	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/RemoteFeedTagHandler.java	2006-07-24 21:18:42 UTC (rev 5267)
@@ -1,11 +1,10 @@
 package org.jboss.shotoku.feeds.tag;
 
 import org.w3c.dom.Node;
-import org.jboss.shotoku.tools.Tools;
 import org.jboss.shotoku.feeds.variables.Substitution;
 import org.jboss.shotoku.feeds.data.NormalFeed;
 import org.jboss.shotoku.feeds.FeedFactory;
-import org.jboss.shotoku.feeds.tools.Constants;
+import org.jboss.shotoku.feeds.tools.FeedsConstants;
 import org.jboss.shotoku.feeds.FeedsDescriptor;
 import org.apache.log4j.Logger;
 
@@ -22,13 +21,11 @@
     }
 
     public boolean generate(FeedsDescriptor fd) {
-        Substitution s = getSubstitution();
         String feedName = getFeedName();
         String feedType = getFeedType();
 
-        String address = s.make(Tools.getAttributeValue(getDefinition(), "address"));
-        String displayName = s.make(Tools.getAttributeValue(getDefinition(),
-                Constants.DISP_NAME_ATTR));
+        String address = getAttributes().get("address");
+        String displayName = getAttributes().get(FeedsConstants.DISP_NAME_ATTR);
 
         try {
             NormalFeed feed = FeedFactory.getNewNormalFeed(feedName, displayName, feedType);

Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/ShotokuFeedTagHandler.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/ShotokuFeedTagHandler.java	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/ShotokuFeedTagHandler.java	2006-07-24 21:18:42 UTC (rev 5267)
@@ -9,7 +9,7 @@
 import org.jboss.shotoku.feeds.data.NormalFeed;
 import org.jboss.shotoku.feeds.FeedFactory;
 import org.jboss.shotoku.feeds.FeedsDescriptor;
-import org.jboss.shotoku.feeds.tools.Constants;
+import org.jboss.shotoku.feeds.tools.FeedsConstants;
 import org.jboss.shotoku.feeds.variables.Substitution;
 import org.apache.velocity.VelocityContext;
 import org.apache.log4j.Logger;
@@ -108,15 +108,11 @@
     }
 
     public boolean generate(FeedsDescriptor fd) {
-        Node definition = getDefinition();
-        Substitution s = getSubstitution();
-
         // Reading all attributes and making the substitution on them.
-        Map<String, String> attributes = Tools.getMapFromNodeAttributes(definition);
-        s.make(attributes);
+        Map<String, String> attributes = getAttributes();
 
         String template = attributes.get("template");
-        String displayName = attributes.get(Constants.DISP_NAME_ATTR);
+        String displayName = attributes.get(FeedsConstants.DISP_NAME_ATTR);
 
         ContentManager cm = ContentManager.getContentManager(attributes.get("id"),
                 attributes.get("prefix"));
@@ -127,9 +123,9 @@
                 FeedsTools.generateVelocityAttributes(attributes);
 
         VelocityContext vc = new VelocityContext(velocityAttributes);
-        FeedsTools.prepareVelocityContext(attributes, fd, vc);
+        FeedsTools.prepareVelocityContext(attributes, vc);
 
-        NodeList feedNodeChildren = definition.getChildNodes();
+        NodeList feedNodeChildren = getDefinition().getChildNodes();
         for (int i = 0; i < feedNodeChildren.getLength(); i++) {
             // For each search node, generating and performing the
             // search, placing it under the demanded attribute in

Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/TagFeedTagHandler.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/TagFeedTagHandler.java	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tag/TagFeedTagHandler.java	2006-07-24 21:18:42 UTC (rev 5267)
@@ -1,13 +1,11 @@
 package org.jboss.shotoku.feeds.tag;
 
-import org.apache.log4j.Logger;
 import org.apache.velocity.VelocityContext;
 import org.jboss.shotoku.feeds.FeedsDescriptor;
 import org.jboss.shotoku.feeds.FeedFactory;
 import org.jboss.shotoku.feeds.data.SpecialFeed;
 import org.jboss.shotoku.feeds.tools.FeedsTools;
 import org.jboss.shotoku.feeds.variables.Substitution;
-import org.jboss.shotoku.tools.Tools;
 import org.w3c.dom.Node;
 
 import java.util.Map;
@@ -16,19 +14,15 @@
  * @author Adam Warski (adamw at aster.pl)
  */
 public class TagFeedTagHandler extends FeedTagHandler {
-    private static final Logger log = Logger.getLogger(FeedsDescriptor.class);
+    //private static final Logger log = Logger.getLogger(FeedsDescriptor.class);
 
     public TagFeedTagHandler(String feedName, String group, Node definition, Substitution s) {
         super(feedName, group, definition, s);
     }
 
     public boolean generate(FeedsDescriptor fd) {
-        Node definition = getDefinition();
-        Substitution s = getSubstitution();
-
         // Reading all attributes and making the substitution on them.
-        Map<String, String> attributes = Tools.getMapFromNodeAttributes(definition);
-        s.make(attributes);
+        Map<String, String> attributes = getAttributes();
 
         Map<String, Object> velocityAttributes =
                 FeedsTools.generateVelocityAttributes(attributes);
@@ -36,7 +30,7 @@
         // Creating a velocity context with parts that won't change in all
         // generated feeds.
         VelocityContext vc = new VelocityContext(velocityAttributes);
-        FeedsTools.prepareVelocityContext(attributes, fd, vc);
+        FeedsTools.prepareVelocityContext(attributes, vc);
 
         String feedName = getFeedName();
         String feedType = getFeedType();

Deleted: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tools/Constants.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tools/Constants.java	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tools/Constants.java	2006-07-24 21:18:42 UTC (rev 5267)
@@ -1,76 +0,0 @@
-package org.jboss.shotoku.feeds.tools;
-
-/**
- * @author Adam Warski (adamw at aster.pl)
- */
-public class Constants {
-	/**
-	 * Node with names ending with this string are parsed and
-     * feed definitons are read from them.
-	 */
-	public final static String NODE_ENDING = "-feeds.xml";
-
-    /*
-     * Tag names.
-     */
-    public final static String REM_FEED_TAG = "remote-feed";
-	public final static String AGG_FEED_TAG = "aggregated-feed";
-	public final static String SHO_FEED_TAG = "shotoku-feed";
-    public final static String TAG_FEED_TAG = "tag-feed";
-
-    /*
-     * Date format compatible with RFC822.
-     */
-    public final static String RFC_822_DATE = "EEE, d MMM yyyy HH:mm:ss Z";
-
-    /*
-     * Content types.
-     */
-    public static final String ATOM_CONTENT_TYPE    = "application/atom+xml";
-    public static final String RSS_CONTENT_TYPE     = "text/xml";
-    public static final String RDF_CONTENT_TYPE     = "text/xml";
-
-    /*
-     * Property name, under which content manager id and name of the
-     * directory which contains the configuration file can be found.
-     */
-    public final static String CONFIGDIR   = "shotoku.internal.feeds.configdir";
-    public final static String CONFIGID    = "shotoku.internal.feeds.configcmid";
-
-    /*
-     * Property name suffixes, under which content manager id and name
-     * of the directory which contains the feed files can be found.
-     */
-    public final static String FEEDDIR     = ".xml.directory";
-    public final static String FEEDID      = ".xml.cmid";
-
-    /**
-     * Property name suffix, under which information about available
-     * variables can be found.
-     */
-    public final static String ALL_VARS    = ".variables";
-    /**
-     * Property name middle, under which informatin about a concerete
-     * variable can be found (should be prepended with an id and followed
-     * by a property name).
-     */
-    public final static String ONE_VAR     = ".variable.";
-
-    /**
-     * Variable, for which feed type will be substituted.
-     */
-    public final static String TYPE_VARIABLE = "${type}";
-
-    /*
-     * Xml node attributes denoting a feed name and display name.
-     */
-    public static final String NAME_ATTR    = "name";
-    public static final String DISP_NAME_ATTR   = "display-name";
-
-    /**
-     * Xml node attribute prefix denoting an attribute for which
-     * an instance of the "attribute-value" class should be loaded
-     * and placed in the velocity context.
-     */
-    public static final String CLASS_ATTR_PREFIX = "class-";
-}

Copied: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tools/FeedsConstants.java (from rev 5218, labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tools/Constants.java)
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tools/Constants.java	2006-07-21 13:30:47 UTC (rev 5218)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tools/FeedsConstants.java	2006-07-24 21:18:42 UTC (rev 5267)
@@ -0,0 +1,88 @@
+package org.jboss.shotoku.feeds.tools;
+
+import org.jboss.shotoku.tools.Constants;
+
+/**
+ * @author Adam Warski (adamw at aster.pl)
+ */
+public class FeedsConstants {
+    public static final String FEEDS_SERVICE_NAME = "shotoku:service=feeds";
+
+    /**
+     * Node with names ending with this string are parsed and
+     * feed definitons are read from them.
+     */
+    public final static String NODE_ENDING = "-feeds.xml";
+
+    /*
+     * Tag names.
+     */
+    public final static String REM_FEED_TAG = "remote-feed";
+    public final static String AGG_FEED_TAG = "aggregated-feed";
+    public final static String SHO_FEED_TAG = "shotoku-feed";
+    public final static String TAG_FEED_TAG = "tag-feed";
+
+    /*
+     * Date format compatible with RFC822.
+     */
+    public final static String RFC_822_DATE = "EEE, d MMM yyyy HH:mm:ss Z";
+
+    /*
+     * Content types.
+     */
+    public static final String ATOM_CONTENT_TYPE    = "application/atom+xml";
+    public static final String RSS_CONTENT_TYPE     = "text/xml";
+    public static final String RDF_CONTENT_TYPE     = "text/xml";
+
+    /*
+     * Property name, under which content manager id and name of the
+     * directory which contains the configuration file can be found.
+     */
+    public final static String CONFIGDIR   = Constants.PROPERTIES_INTERNAL + ".feeds.configdir";
+    public final static String CONFIGID    = Constants.PROPERTIES_INTERNAL + ".feeds.configcmid";
+
+    /**
+     * Property name, under which the length of the interval between tags
+     * service updates can be found.
+     */
+    public static final String PROPERTY_INTERVAL = Constants.PROPERTIES_INTERNAL + ".feeds.service.interval";
+
+
+    /*
+     * Property name suffixes, under which content manager id and name
+     * of the directory which contains the feed files can be found.
+     */
+    public final static String FEEDDIR     = ".xml.directory";
+    public final static String FEEDID      = ".xml.cmid";
+
+    /**
+     * Property name suffix, under which information about available
+     * variables can be found.
+     */
+    public final static String ALL_VARS    = ".variables";
+    /**
+     * Property name middle, under which informatin about a concerete
+     * variable can be found (should be prepended with an id and followed
+     * by a property name).
+     */
+    public final static String ONE_VAR     = ".variable.";
+
+    /**
+     * Variable, for which feed type will be substituted.
+     */
+    public final static String TYPE_VARIABLE = "${type}";
+
+    /*
+     * Xml node attributes denoting a feed name and display name.
+     */
+    public static final String NAME_ATTR    = "name";
+    public static final String DISP_NAME_ATTR   = "displayName";
+    public static final String BASE_ADDR_ATTR   = "baseServerAddress";
+
+    /**
+     * Xml node attribute prefix denoting an attribute for which
+     * an instance of the "attribute-value" class should be loaded
+     * and placed in the velocity context.
+     */
+    public static final String CLASS_ATTR_PREFIX = "class-";
+}

Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tools/FeedsTools.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tools/FeedsTools.java	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/tools/FeedsTools.java	2006-07-24 21:18:42 UTC (rev 5267)
@@ -3,6 +3,11 @@
 import org.apache.velocity.VelocityContext;
 import org.apache.log4j.Logger;
 import org.jboss.shotoku.feeds.FeedsDescriptor;
+import org.jboss.shotoku.feeds.FeedsService;
+import org.jboss.shotoku.feeds.service.FeedsServiceImpl;
+import org.jboss.shotoku.ContentManager;
+import org.jboss.mx.util.MBeanProxyExt;
+import org.jboss.mx.util.MBeanServerLocator;
 
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
@@ -14,15 +19,24 @@
  */
 public class FeedsTools {
     private static final Logger log = Logger.getLogger(FeedsDescriptor.class);
-    
+
+    /**
+     * For each attribute from the given map, if its key denotes a class
+     * to be loaded, puts in the resulting map a new (key, object of that
+     * class) binding, and otherwise, just copies the entry from the
+     * original map.
+     * @param attributes Original attributes to be copied/ expanded.
+     * @return A map of key-value bindings copied from the original map,
+     * or key-object of class taken from key bindings.
+     */
     public static Map<String, Object> generateVelocityAttributes(
             Map<String, String> attributes) {
         Map<String, Object> velocityAttributes = new HashMap<String, Object>();
         for (String key : attributes.keySet()) {
-            if (key.startsWith(Constants.CLASS_ATTR_PREFIX)) {
+            if (key.startsWith(FeedsConstants.CLASS_ATTR_PREFIX)) {
                 try {
                     velocityAttributes.put(
-                            key.substring(Constants.CLASS_ATTR_PREFIX.length()),
+                            key.substring(FeedsConstants.CLASS_ATTR_PREFIX.length()),
                             Class.forName(attributes.get(key)).newInstance());
                 } catch (Exception e) {
                     log.error("Exception while loading a class to the " +
@@ -36,14 +50,49 @@
         return velocityAttributes;
     }
 
+    /**
+     * Basing on the given attributes, puts in the given velocity context
+     * common attributez: date formats, current date and a text-escaping
+     * object.
+     * @param attributes Attributes basing on which, the initial content
+     * should be set
+     * @param vc Velocity context to fill.
+     */
     public static void prepareVelocityContext(Map<String, String> attributes,
-                                              FeedsDescriptor fd, VelocityContext vc) {
+                                              VelocityContext vc) {
         String dateFormat = attributes.get("dateFormat");
         vc.put("dateFormat", new SimpleDateFormat(dateFormat == null ? "MM/dd/yy" : dateFormat));
-        vc.put("rssDateFormat", new SimpleDateFormat(Constants.RFC_822_DATE));
+        vc.put("rssDateFormat", new SimpleDateFormat(FeedsConstants.RFC_822_DATE));
         vc.put("rdfDateFormat", new RdfDateFormat());
         vc.put("now", Calendar.getInstance().getTime());
-        vc.put("baseServerAddress", fd.getBaseServerAddress());
         vc.put("escape", new TextEscaping());
     }
+
+    private static FeedsService instance;
+
+    /**
+     * @return An instance of the feeds service.
+     */
+    public static FeedsService getService() {
+        try {
+            if (instance == null) {
+                if (ContentManager.isEmbedded()) {
+                    // Embedded mode - simply creating a new service instance.
+                    instance = new FeedsServiceImpl();
+                    instance.create();
+                    instance.start();
+                } else {
+                    // Application server mode - creating a proxy to a mbean.
+                    instance = (FeedsService) MBeanProxyExt.create(
+                            FeedsService.class,
+                            FeedsConstants.FEEDS_SERVICE_NAME,
+                            MBeanServerLocator.locate());
+                }
+            }
+
+            return instance;
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
 }

Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/variables/VariableResolverManager.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/variables/VariableResolverManager.java	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/variables/VariableResolverManager.java	2006-07-24 21:18:42 UTC (rev 5267)
@@ -1,7 +1,7 @@
 package org.jboss.shotoku.feeds.variables;
 
 import org.w3c.dom.Node;
-import org.jboss.shotoku.feeds.tools.Constants;
+import org.jboss.shotoku.feeds.tools.FeedsConstants;
 import org.jboss.shotoku.feeds.FeedsDescriptor;
 import org.apache.log4j.Logger;
 
@@ -24,14 +24,14 @@
         varResolversNodeConstructor = new HashMap<String, Constructor>();
         varResolversEmptyConstructor = new HashMap<String, Constructor>();
 
-        for (String variable : props.getProperty(id + Constants.ALL_VARS, "").split("[,]")) {
+        for (String variable : props.getProperty(id + FeedsConstants.ALL_VARS, "").split("[,]")) {
             Class varResolverClass;
 
             try {
-                varResolverClass = Class.forName(props.getProperty(id + Constants.ONE_VAR + variable));
+                varResolverClass = Class.forName(props.getProperty(id + FeedsConstants.ONE_VAR + variable));
             } catch (ClassNotFoundException e) {
                 log.error("Variable resolver class " + props.getProperty(id +
-                        Constants.ONE_VAR + variable) + " for variable " + variable +
+                        FeedsConstants.ONE_VAR + variable) + " for variable " + variable +
                         " not found", e);
                 continue;
             }
@@ -43,7 +43,7 @@
                     varResolversEmptyConstructor.put(variable, varResolverClass.getConstructor());
                 } catch (NoSuchMethodException e1) {
                     log.error("No (org.w3c.dom.Node) or () constructor found for variable " +
-                            props.getProperty(id + Constants.ONE_VAR + variable) + " resolver " +
+                            props.getProperty(id + FeedsConstants.ONE_VAR + variable) + " resolver " +
                             varResolverClass.getName() + ".", e);
                 }
             }

Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/variables/XmlNodeTypeVariableResolver.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/variables/XmlNodeTypeVariableResolver.java	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/variables/XmlNodeTypeVariableResolver.java	2006-07-24 21:18:42 UTC (rev 5267)
@@ -3,7 +3,7 @@
 import org.w3c.dom.Node;
 import org.jboss.shotoku.tools.Tools;
 import org.jboss.shotoku.feeds.FeedFactory;
-import org.jboss.shotoku.feeds.tools.Constants;
+import org.jboss.shotoku.feeds.tools.FeedsConstants;
 
 /**
  * @author Adam Warski (adamw at aster.pl)
@@ -27,7 +27,7 @@
     }
 
     protected String getVarName() {
-        return Constants.TYPE_VARIABLE;
+        return FeedsConstants.TYPE_VARIABLE;
     }
 
     protected String[] getValues() {

Modified: labs/shotoku/trunk/shotoku-files/maven.xml
===================================================================
--- labs/shotoku/trunk/shotoku-files/maven.xml	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-files/maven.xml	2006-07-24 21:18:42 UTC (rev 5267)
@@ -11,7 +11,7 @@
     <goal name="deploy">
         <ant:copy
                 file="target/shotoku-files.jar"
-                tofile="../target/${shotoku.sar.dir}/shotoku-files.ejb3"
+                tofile="${local.deploy.dir}/shotoku-files.ejb3"
                 overwrite="true" />
     </goal>
 </project>

Modified: labs/shotoku/trunk/shotoku-jcr/maven.xml
===================================================================
--- labs/shotoku/trunk/shotoku-jcr/maven.xml	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-jcr/maven.xml	2006-07-24 21:18:42 UTC (rev 5267)
@@ -27,9 +27,10 @@
 	    <ant:copy
                 todir="../target/${shotoku.sar.dir}" overwrite="true"
                 file="lib/jackrabbit.jar" />
+        
         <ant:copy
                 file="target/shotoku-jcr.jar"
-                tofile="../target/${shotoku.sar.dir}/shotoku-jcr.ejb3"
+                tofile="${local.deploy.dir}/shotoku-jcr.ejb3"
                 overwrite="true" />
     </goal>
 </project>

Modified: labs/shotoku/trunk/shotoku-svn/maven.xml
===================================================================
--- labs/shotoku/trunk/shotoku-svn/maven.xml	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-svn/maven.xml	2006-07-24 21:18:42 UTC (rev 5267)
@@ -15,7 +15,7 @@
                 overwrite="true" />
         <ant:copy
                 file="target/shotoku-svn.jar"
-                tofile="../target/${shotoku.sar.dir}/shotoku-svn.ejb3"
+                tofile="${local.deploy.dir}/shotoku-svn.ejb3"
                 overwrite="true" />
     </goal>
 </project>

Modified: labs/shotoku/trunk/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnContentManager.java
===================================================================
--- labs/shotoku/trunk/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnContentManager.java	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnContentManager.java	2006-07-24 21:18:42 UTC (rev 5267)
@@ -67,10 +67,6 @@
 
     public static void setup() {
         service = SvnTools.getService();
-        service.setTimerInterval(ContentManager.getProperty(
-                SvnTools.PROPERTY_INTERVAL, SvnTools.DEFAULT_TIMER_INTERVAL));
-        service.setFirstUpdate(ContentManager.getProperty(
-                SvnTools.FIRST_UPDATE, 1) != 0);
 
         // Configuring the repositories.
         // for DAV (over http and https)

Modified: labs/shotoku/trunk/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java
===================================================================
--- labs/shotoku/trunk/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java	2006-07-24 21:18:42 UTC (rev 5267)
@@ -77,12 +77,14 @@
 
         repositories = new ConcurrentHashMap<String, SvnRepository>();
 
-        // Setting the default timer interval.
-        setTimerInterval(SvnTools.DEFAULT_TIMER_INTERVAL);
+        setTimerInterval(ContentManager.getProperty(
+                SvnTools.PROPERTY_INTERVAL, SvnTools.DEFAULT_TIMER_INTERVAL));
+        setFirstUpdate(ContentManager.getProperty(
+                SvnTools.FIRST_UPDATE, 1) != 0);
 
         ContentManager.initializeContentManager(SvnContentManager.class.getName());
 
-        log.info("Svn service created.");
+        super.afterCreate();
     }
 
     public void start() throws Exception {

Modified: labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/service/TagServiceImpl.java
===================================================================
--- labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/service/TagServiceImpl.java	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/service/TagServiceImpl.java	2006-07-24 21:18:42 UTC (rev 5267)
@@ -84,7 +84,7 @@
                             org.jboss.shotoku.tags.tools.Constants.PROPERTY_CMDIR, ""));
         }
 
-        log.info("Tag service created.");
+        super.afterCreate();
     }
 
     EntityManager updaterThreadEm;

Modified: labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/tools/Constants.java
===================================================================
--- labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/tools/Constants.java	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/tools/Constants.java	2006-07-24 21:18:42 UTC (rev 5267)
@@ -16,20 +16,20 @@
      * found, with which Shotoku tags -> Shotoku synchrozniation should be
      * done.
      */
-    public static final String PROPERTY_CMID    = "shotoku.internal.tags.cmid";
-    public static final String PROPERTY_CMDIR   = "shotoku.internal.tags.cmdir";
+    public static final String PROPERTY_CMID    = org.jboss.shotoku.tools.Constants.PROPERTIES_INTERNAL + ".tags.cmid";
+    public static final String PROPERTY_CMDIR   = org.jboss.shotoku.tools.Constants.PROPERTIES_INTERNAL + ".tags.cmdir";
 
     /**
      * Property name, under which information if synchronization of tags
      * with shotoku should be done.
      */
-    public static final String PROPERTY_SYNC   = "shotoku.internal.tags.synchronization";
+    public static final String PROPERTY_SYNC   = org.jboss.shotoku.tools.Constants.PROPERTIES_INTERNAL + ".tags.synchronization";
 
     /**
      * Property name, under which the length of the interval between tags
      * service updates can be found.
      */
-    public static final String PROPERTY_INTERVAL = "shotoku.internal.tags.service.interval";
+    public static final String PROPERTY_INTERVAL = org.jboss.shotoku.tools.Constants.PROPERTIES_INTERNAL + ".tags.service.interval";
 
     /**
      * Separator of tokens in a string representation of a tag.

Modified: labs/shotoku/trunk/shotoku-user/src/java/org/jboss/shotoku/user/UserService.java
===================================================================
--- labs/shotoku/trunk/shotoku-user/src/java/org/jboss/shotoku/user/UserService.java	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-user/src/java/org/jboss/shotoku/user/UserService.java	2006-07-24 21:18:42 UTC (rev 5267)
@@ -12,8 +12,8 @@
     public List<Group> getGroupsOfUser(String userName) throws UserNotFoundException;
 
     /*
-    * SERVICE MANAGEMENT METHODS
-    */
+     * SERVICE MANAGEMENT METHODS
+     */
 
     public void create() throws Exception;
     public void start() throws Exception;

Modified: labs/shotoku/trunk/shotoku-user/src/java/org/jboss/shotoku/user/service/UserServiceImpl.java
===================================================================
--- labs/shotoku/trunk/shotoku-user/src/java/org/jboss/shotoku/user/service/UserServiceImpl.java	2006-07-24 21:04:44 UTC (rev 5266)
+++ labs/shotoku/trunk/shotoku-user/src/java/org/jboss/shotoku/user/service/UserServiceImpl.java	2006-07-24 21:18:42 UTC (rev 5267)
@@ -46,9 +46,11 @@
 public class UserServiceImpl implements UserService, UserServiceLocal {
     private static final Logger log = Logger.getLogger(UserService.class);
 
+    @SuppressWarnings({"UNUSED_SYMBOL"})
     @Depends(UserConstants.PORTAL_USER_SERVICE_NAME)
     private UserModule um;
 
+    @SuppressWarnings({"UNUSED_SYMBOL"})
     @Depends(UserConstants.PORTAL_ROLE_SERVICE_NAME)
     private RoleModule rm;
 
@@ -109,18 +111,18 @@
     */
 
     public void create() throws Exception {
-
+        log.info("User service created.");
     }
 
     public void start() throws Exception {
-
+        log.info("User service started.");
     }
 
     public void destroy() {
-
+        log.info("User service destroyed.");
     }
 
     public void stop() {
-
+        log.info("User service stopped.");
     }
 }




More information about the jboss-svn-commits mailing list