From: <jbo...@li...> - 2005-09-24 13:42:36
|
Author: adamw Date: 2005-09-24 09:42:22 -0400 (Sat, 24 Sep 2005) New Revision: 1199 Modified: trunk/forge/portal-extensions/shotoku/maven.xml trunk/forge/portal-extensions/shotoku/project.properties trunk/forge/portal-extensions/shotoku/shotoku-base/src/etc/shotoku.xml trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/ContentManager.java trunk/forge/portal-extensions/shotoku/shotoku-svn-service/maven.xml trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/etc/repositories.xml trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnRepository.java trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceTimer.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/AbstractSvnResource.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnContentManager.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnDirectory.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnNode.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnService.java Log: First shotoku functionalities Modified: trunk/forge/portal-extensions/shotoku/maven.xml =================================================================== --- trunk/forge/portal-extensions/shotoku/maven.xml 2005-09-24 12:36:19 UTC (rev 1198) +++ trunk/forge/portal-extensions/shotoku/maven.xml 2005-09-24 13:42:22 UTC (rev 1199) @@ -3,22 +3,36 @@ Distributable under LGPL license. See terms of license at gnu.org. --> -<project xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:u="jelly:util"> - <!-- Default war-project goals --> - +<project xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:u="jelly:util" xmlns:maven="jelly:maven"> <goal name="all"> + <attainGoal name="clean" /> <attainGoal name="build" /> <attainGoal name="deploy" /> </goal> + <goal name="shotoku-all-projects"> + <maven:reactor includes="shotoku-base/project.xml" excludes="" basedir="." + banner="Shotoku base" + goals="${goal}" ignoreFailures="false" /> + <maven:reactor includes="shotoku-svn/project.xml" excludes="" basedir="." + banner="Shotoku svn" + goals="${goal}" ignoreFailures="false" /> + <maven:reactor includes="shotoku-svn-service/project.xml" excludes="" basedir="." + banner="Shotoku svn service" + goals="${goal}" ignoreFailures="false" /> + <maven:reactor includes="shotoku-test/project.xml" excludes="" basedir="." + banner="Shotoku test" + goals="${goal}" ignoreFailures="false" /> + </goal> + <goal name="build"> <j:set var="goal" value="build" /> - <attainGoal name="multiproject:goal" /> + <attainGoal name="shotoku-all-projects" /> </goal> <goal name="deploy"> <j:set var="goal" value="deploy" /> - <attainGoal name="multiproject:goal" /> + <attainGoal name="shotoku-all-projects" /> </goal> <goal name="clean"> @@ -26,6 +40,7 @@ <ant:delete dir="shotoku-base/target" /> <ant:delete dir="shotoku-svn/target" /> <ant:delete dir="shotoku-svn-service/target" /> - <ant:delete dir="${local.deploy.dir}/${shotoku.ear.dir}" /> + <ant:delete dir="shotoku-test/target" /> + <ant:delete dir="${local.deploy.dir}/shotoku.ear" /> </goal> </project> Modified: trunk/forge/portal-extensions/shotoku/project.properties =================================================================== --- trunk/forge/portal-extensions/shotoku/project.properties 2005-09-24 12:36:19 UTC (rev 1198) +++ trunk/forge/portal-extensions/shotoku/project.properties 2005-09-24 13:42:22 UTC (rev 1199) @@ -2,4 +2,4 @@ maven.junit.fork=yes maven.war.src=${basedir}/src/web -maven.multiproject.includes=shotoku-base/project.xml,shotoku-svn/project.xml,shotoku-svn-service/project.xml +maven.multiproject.includes=shotoku-base/project.xml,shotoku-svn/project.xml,shotoku-svn-service/project.xml,shotoku-test/project.xml Modified: trunk/forge/portal-extensions/shotoku/shotoku-base/src/etc/shotoku.xml =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-base/src/etc/shotoku.xml 2005-09-24 12:36:19 UTC (rev 1198) +++ trunk/forge/portal-extensions/shotoku/shotoku-base/src/etc/shotoku.xml 2005-09-24 13:42:22 UTC (rev 1199) @@ -4,5 +4,5 @@ <default-id id="default" /> <content-manager id="default" - implementation="SvnContentManager" /> + implementation="org.jboss.shotoku.svn.SvnContentManager" /> </content-managers> \ No newline at end of file Modified: trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/ContentManager.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/ContentManager.java 2005-09-24 12:36:19 UTC (rev 1198) +++ trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/ContentManager.java 2005-09-24 13:42:22 UTC (rev 1199) @@ -4,7 +4,6 @@ import java.util.HashMap; import java.util.Map; -import org.apache.log4j.BasicConfigurator; import org.apache.log4j.Logger; import org.apache.xerces.parsers.DOMParser; import org.jboss.shotoku.search.SearchParameters; @@ -63,9 +62,6 @@ private static Map<String, Constructor> contentManagers; static { - // Configuring the logger. - BasicConfigurator.configure(); - contentManagers = new HashMap<String, Constructor>(); // Loading configuration file. @@ -85,7 +81,7 @@ if (n.getNodeType() == org.w3c.dom.Node.ELEMENT_NODE) { if ("default-id".equals(n.getNodeName())) { // Overriding the default content manager id. - defaultId = Tools.unmarshallText(n); + defaultId = Tools.getAttributeValue(n, "id"); log.info("Set default id to: " + defaultId); } else if ("content-manager".equals(n.getNodeName())) { @@ -112,6 +108,15 @@ } /** + * Gets a content manager with a default id and an empty prefix. + * @return A ""-prefixed, default content manager, or null, if a default + * content manager is not registered. + */ + public static ContentManager getContentManager() { + return getContentManager(""); + } + + /** * Gets a content manager with a default id and the given prefix. * @param prefix Prefix for the new content manager (all paths will * have this prepended). Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/AbstractSvnResource.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/AbstractSvnResource.java 2005-09-24 12:36:19 UTC (rev 1198) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/AbstractSvnResource.java 2005-09-24 13:42:22 UTC (rev 1199) @@ -1,7 +1,43 @@ package org.jboss.shotoku.svn; +import java.io.File; +import java.util.HashMap; +import java.util.Map; + import org.jboss.shotoku.AbstractResource; public abstract class AbstractSvnResource implements AbstractResource { - + private Map<String, String> modifiedProperties; + + protected SvnService service; + + protected String id; + protected String fullPath; + protected File file; + + public AbstractSvnResource(String id, String fullPath, File file) { + this.file = file; + this.fullPath = fullPath; + this.id = id; + + modifiedProperties = new HashMap<String, String>(); + service = Tools.getService(); + } + + public String getProperty(String name) { + return service.getProperty(id, fullPath, name); + } + + public void setProperty(String name, String value) { + modifiedProperties.put(name, value); + } + + protected boolean save() { + for (String name : modifiedProperties.keySet()) { + service.setProperty(id, fullPath, name, + modifiedProperties.get(name)); + } + + return modifiedProperties.size() > 1; + } } Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnContentManager.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnContentManager.java 2005-09-24 12:36:19 UTC (rev 1198) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnContentManager.java 2005-09-24 13:42:22 UTC (rev 1199) @@ -1,33 +1,64 @@ package org.jboss.shotoku.svn; +import java.io.File; + import org.jboss.shotoku.ContentManager; import org.jboss.shotoku.Directory; import org.jboss.shotoku.Node; import org.jboss.shotoku.NodeList; +import org.jboss.shotoku.exceptions.NodeDoesNotExist; import org.jboss.shotoku.search.SearchParameters; public class SvnContentManager extends ContentManager { + private String prefix; + private String id; + private SvnService service; + public SvnContentManager(String id, String prefix) { super(id, prefix); + + this.prefix = prefix; + this.id = id; + + service = Tools.getService(); } + + private String getPrefixedPath(String path) { + return prefix + '/' + path; + } + + private File getFileForPath(String path) { + return new File( + service.getFileSystemPath(id, getPrefixedPath(path))); + } @Override public Directory getRootDirectory() { - return null; + return getDirectory(""); } @Override - public Node getNode(String arg0) { - return null; + public Node getNode(String path) { + File file = getFileForPath(path); + + if (!file.isFile()) + throw new NodeDoesNotExist(); + + return new SvnHeadNode(id, getPrefixedPath(path), file); } @Override - public Directory getDirectory(String arg0) { - return null; + public Directory getDirectory(String path) { + File file = getFileForPath(path); + + if (!file.isFile()) + throw new NodeDoesNotExist(); + + return new SvnDirectory(id, getPrefixedPath(path), file); } @Override - public NodeList search(SearchParameters arg0) { - return null; + public NodeList search(SearchParameters parameters) { + throw new RuntimeException("Operation not yet implemented"); } } Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnDirectory.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnDirectory.java 2005-09-24 12:36:19 UTC (rev 1198) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnDirectory.java 2005-09-24 13:42:22 UTC (rev 1199) @@ -1,5 +1,6 @@ package org.jboss.shotoku.svn; +import java.io.File; import java.util.List; import org.jboss.shotoku.Directory; @@ -7,50 +8,47 @@ import org.jboss.shotoku.NodeList; public class SvnDirectory extends AbstractSvnResource implements Directory { + public SvnDirectory(String id, String fullPath, File file) { + super(id, fullPath, file); + } + public NodeList getNodes() { - return null; + throw new RuntimeException("Operation not yet implemented"); } public List<Directory> getDirectories() { - return null; + throw new RuntimeException("Operation not yet implemented"); } - public Node newNode(String arg0) { - return null; + public Node newNode(String name) { + throw new RuntimeException("Operation not yet implemented"); } - public Directory newDirectory(String arg0) { - return null; + public Directory newDirectory(String name) { + throw new RuntimeException("Operation not yet implemented"); } - public boolean hasIndex(String arg0) { - return false; + public boolean hasIndex(String propertyName) { + throw new RuntimeException("Operation not yet implemented"); } - public void setIndex(String arg0, boolean arg1) { - + public void setIndex(String propertyName, boolean index) { + throw new RuntimeException("Operation not yet implemented"); } - public String getProperty(String arg0) { - return null; - } - - public void setProperty(String arg0, String arg1) { - } - public Directory getParent() { - return null; + throw new RuntimeException("Operation not yet implemented"); } - public void save(String arg0) { - + public void save(String logMessage) { + throw new RuntimeException("Operation not yet implemented"); } public String getLogMessage() { - return null; + throw new RuntimeException("Operation not yet implemented"); } public void delete() { - + throw new RuntimeException("Operation not yet implemented"); } } Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnNode.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnNode.java 2005-09-24 12:36:19 UTC (rev 1198) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnNode.java 2005-09-24 13:42:22 UTC (rev 1199) @@ -1,65 +1,15 @@ package org.jboss.shotoku.svn; -import java.io.InputStream; +import java.io.File; -import org.jboss.shotoku.Directory; -import org.jboss.shotoku.History; import org.jboss.shotoku.Node; -public class SvnNode extends AbstractSvnResource implements Node { - public String getContent() { - return null; +public abstract class SvnNode extends AbstractSvnResource implements Node { + public SvnNode(String id, String fullPath, File file) { + super(id, fullPath, file); } - - public void setContent(String arg0) { - - } - - public History getHistory() { - return null; - } - - public int getRevisionNumber() { - return 0; - } - + public void copyToFile(String arg0) { - + throw new RuntimeException("Operation not yet implemented"); } - - public InputStream getContentInputStream() { - return null; - } - - public long getLength() { - return 0; - } - - public long getLastModfication() { - return 0; - } - - public String getProperty(String arg0) { - return null; - } - - public void setProperty(String arg0, String arg1) { - - } - - public Directory getParent() { - return null; - } - - public void save(String arg0) { - - } - - public String getLogMessage() { - return null; - } - - public void delete() { - - } } Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnService.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnService.java 2005-09-24 12:36:19 UTC (rev 1198) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnService.java 2005-09-24 13:42:22 UTC (rev 1199) @@ -1,12 +1,7 @@ package org.jboss.shotoku.svn; -import javax.management.MalformedObjectNameException; - -import org.jboss.mx.util.MBeanProxyExt; -import org.jboss.mx.util.MBeanServerLocator; - -public abstract class SvnService { - public abstract void commit(String id, String path); +public abstract interface SvnService { + public abstract void commit(String id, String path, String logMessage); public abstract void setProperty(String id, String path, String name, String value); public abstract String getProperty(String id, String path, String name); @@ -15,26 +10,8 @@ public abstract String getLogMessage(String id, String revision); public abstract int getRevisionCount(String id, String path); public abstract void delete(String id, String path); + public abstract void add(String id, String path); + public abstract String getFileSystemPath(String id, String path); public final static String SVN_SERVICE_NAME = "shotoku:service=svn"; - - /* - * Getting an instance of the service. - */ - - private static SvnService instance; - - public static SvnService getInstance() { - try { - if (instance == null) - instance = (SvnService) MBeanProxyExt.create( - SvnService.class, - SVN_SERVICE_NAME, - MBeanServerLocator.locate()); - - return instance; - } catch (MalformedObjectNameException e) { - throw new RuntimeException(e); - } - } } Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn-service/maven.xml =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn-service/maven.xml 2005-09-24 12:36:19 UTC (rev 1198) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn-service/maven.xml 2005-09-24 13:42:22 UTC (rev 1199) @@ -23,6 +23,12 @@ <ant:copy todir="target/${shotoku.ear.dir}" overwrite="true" file="${maven.repo.local}/shotoku/jars/shotoku-base.jar" /> + <ant:copy + todir="target/${shotoku.ear.dir}" overwrite="true"> + <ant:fileset dir="${maven.repo.local}/tmate/jars"> + <ant:filename name="*.jar" /> + </ant:fileset> + </ant:copy> <ant:copy todir="target/${shotoku.ear.dir}"> <ant:fileset dir="src/app" flatten="true" overwrite="true"> <ant:filename name="**" /> @@ -32,7 +38,7 @@ <!-- Copying the ear to the deploy directory. --> <ant:copy todir="${local.deploy.dir}"> <ant:fileset dir="target" flatten="true" overwrite="true"> - <ant:filename name="**" /> + <ant:filename name="${shotoku.ear.dir}/**" /> </ant:fileset> </ant:copy> </goal> Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/etc/repositories.xml =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/etc/repositories.xml 2005-09-24 12:36:19 UTC (rev 1198) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/etc/repositories.xml 2005-09-24 13:42:22 UTC (rev 1199) @@ -6,5 +6,5 @@ url="https://cms.labs.jboss.com/trunk/forge/portal-content" username="jbf...@jb..." password="rO@B5oPfff" - localpath="/home/adamw/jboss/content/trunk/forge/portal-contet" /> + localpath="/home/adamw/jboss/content/trunk/forge/portal-content" /> </repositories> \ No newline at end of file Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnRepository.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnRepository.java 2005-09-24 12:36:19 UTC (rev 1198) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnRepository.java 2005-09-24 13:42:22 UTC (rev 1199) @@ -1,20 +1,28 @@ package org.jboss.shotoku.svn.service; import java.io.File; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; +import org.apache.log4j.Logger; import org.tmatesoft.svn.core.SVNException; import org.tmatesoft.svn.core.SVNURL; import org.tmatesoft.svn.core.wc.ISVNOptions; import org.tmatesoft.svn.core.wc.SVNClientManager; +import org.tmatesoft.svn.core.wc.SVNCommitClient; import org.tmatesoft.svn.core.wc.SVNRevision; import org.tmatesoft.svn.core.wc.SVNUpdateClient; import org.tmatesoft.svn.core.wc.SVNWCUtil; public class SvnRepository { + private static final Logger log = Logger.getLogger(SvnRepository.class); + private SVNClientManager ourClientManager; private String url; private String localpath; private File wc; + private Set<String[]> toCommit; public SvnRepository(String username, String password, String url, String localpath) { @@ -24,8 +32,9 @@ this.url = url; this.localpath = localpath; - + wc = new File(localpath); + toCommit = Collections.synchronizedSet(new HashSet<String[]>()); } private void tryCleanup() { @@ -59,4 +68,38 @@ tryCleanup(); } } + + public void addToCommit(String path, String logMessage) { + toCommit.add(new String[] { path, logMessage }); + } + + public void commit() { + String[][] allToCommit; + + synchronized (toCommit) { + allToCommit = toCommit.toArray(new String[0][0]); + toCommit.clear(); + } + + for (String[] oneToCommit : allToCommit) { + SVNCommitClient commitClient = ourClientManager.getCommitClient(); + try { + commitClient.doCommit( + new File[] { new File(getFileSystemPath(oneToCommit[0])) }, + false, oneToCommit[1], true, false); + } catch (SVNException e) { + tryCleanup(); + log.warn("Commiting of " + oneToCommit[0] + " failed", e); + } + } + } + + public String getFileSystemPath(String path) { + return replaceSeparators(localpath + '/' + path); + } + + private String replaceSeparators(String path) { + return '/' == File.separatorChar ? + path : path.replace('/', File.separatorChar); + } } Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java 2005-09-24 12:36:19 UTC (rev 1198) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java 2005-09-24 13:42:22 UTC (rev 1199) @@ -1,9 +1,11 @@ package org.jboss.shotoku.svn.service; import java.util.HashMap; + import java.util.Map; import javax.annotation.EJB; +import javax.ejb.Local; import org.apache.log4j.Logger; import org.apache.xerces.parsers.DOMParser; @@ -17,7 +19,8 @@ import org.xml.sax.InputSource; @Service(objectName=SvnService.SVN_SERVICE_NAME) -public class SvnServiceImpl extends SvnService { +@Local(SvnServiceLocal.class) +public class SvnServiceImpl implements SvnServiceManagement { private static final Logger log = Logger.getLogger(SvnServiceImpl.class); /** @@ -28,12 +31,12 @@ private long timerInterval; @EJB - private SvnServiceTimer timer; + private SvnServiceTimerLocal timer; private Map<String, SvnRepository> repositories; /* - * Service lifecycle methods. + * Service lifecycle management. */ public void create() throws Exception { @@ -72,7 +75,7 @@ url, Tools.getAttributeValue(n, "localpath"))); - log.info("Added svn repository: " + id + ": " + url); + log.info("Added svn repository: " + id + ", " + url); } } } catch (Exception e) { @@ -106,46 +109,50 @@ return timerInterval; } - void update() { - + public void update() { + for (SvnRepository repo : repositories.values()) { + repo.update(); + repo.commit(); + } } /* * SvnService implementation. */ - @Override - public void commit(String id, String path) { - + public void commit(String id, String path, String logMessage) { + repositories.get(id).addToCommit(path, logMessage); } - @Override - public void setProperty(String id, String arg1, String arg2, String arg3) { + public void setProperty(String id, String path, String name, String value) { } - @Override - public String getProperty(String id, String arg0, String arg1) { + public String getProperty(String id, String path, String name) { return null; } - @Override - public String getNodeAtRevision(String id, String arg0, int arg1) { + public String getNodeAtRevision(String id, String path, int revision) { return null; } - @Override - public String getLogMessage(String id, String arg0) { + public String getLogMessage(String id, String path) { return null; } - @Override - public int getRevisionCount(String id, String arg0) { + public int getRevisionCount(String id, String path) { return 0; } - @Override - public void delete(String id, String arg0) { + public void delete(String id, String path) { } + + public void add(String id, String path) { + + } + + public String getFileSystemPath(String id, String path) { + return repositories.get(id).getFileSystemPath(path); + } } Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceTimer.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceTimer.java 2005-09-24 12:36:19 UTC (rev 1198) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn-service/src/java/org/jboss/shotoku/svn/service/SvnServiceTimer.java 2005-09-24 13:42:22 UTC (rev 1199) @@ -10,6 +10,7 @@ import javax.ejb.Timer; import javax.management.MalformedObjectNameException; +import org.apache.log4j.Logger; import org.jboss.mx.util.MBeanProxyExt; import org.jboss.mx.util.MBeanServerLocator; import org.jboss.shotoku.svn.SvnService; @@ -17,6 +18,7 @@ @Stateless @Local(SvnServiceTimerLocal.class) public class SvnServiceTimer { + private static final Logger log = Logger.getLogger(SvnServiceTimer.class); private @Resource SessionContext ctx; public void scheduleTimer(long interval) { @@ -27,13 +29,15 @@ @Timeout public void timeoutHandler(Timer timer) { try { - SvnServiceImpl ssi = - ((SvnServiceImpl) MBeanProxyExt.create( - SvnServiceImpl.class, + SvnServiceLocal ssi = + ((SvnServiceLocal) MBeanProxyExt.create( + SvnServiceLocal.class, SvnService.SVN_SERVICE_NAME, MBeanServerLocator.locate())); + log.info("Updating svn service ..."); ssi.update(); + log.info("Done updating svn service."); scheduleTimer(ssi.getTimerInterval()); } catch (MalformedObjectNameException e) { |