[jboss-svn-commits] JBL Code SVN: r8945 - in labs/shotoku/trunk: lib/jboss and 24 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Sat Jan 20 18:21:30 EST 2007
Author: adamw
Date: 2007-01-20 18:21:29 -0500 (Sat, 20 Jan 2007)
New Revision: 8945
Added:
labs/shotoku/trunk/shotoku-base-service/
labs/shotoku/trunk/shotoku-base-service/maven.xml
labs/shotoku/trunk/shotoku-base-service/project.properties
labs/shotoku/trunk/shotoku-base-service/project.xml
labs/shotoku/trunk/shotoku-base-service/shotoku-base-service.iml
labs/shotoku/trunk/shotoku-base-service/src/
labs/shotoku/trunk/shotoku-base-service/src/etc/
labs/shotoku/trunk/shotoku-base-service/src/java/
labs/shotoku/trunk/shotoku-base-service/src/java/org/
labs/shotoku/trunk/shotoku-base-service/src/java/org/jboss/
labs/shotoku/trunk/shotoku-base-service/src/java/org/jboss/shotoku/
labs/shotoku/trunk/shotoku-base-service/src/java/org/jboss/shotoku/service/
labs/shotoku/trunk/shotoku-base-service/src/java/org/jboss/shotoku/service/ShotokuServiceImpl.java
labs/shotoku/trunk/shotoku-test/src/java/org/jboss/shotoku/test/ShotokuDemo.java
Removed:
labs/shotoku/trunk/shotoku-base-service/maven.xml
labs/shotoku/trunk/shotoku-base-service/project.properties
labs/shotoku/trunk/shotoku-base-service/project.xml
labs/shotoku/trunk/shotoku-base-service/shotoku-base-service.iml
labs/shotoku/trunk/shotoku-base-service/src/
labs/shotoku/trunk/shotoku-base-service/src/etc/
labs/shotoku/trunk/shotoku-base-service/src/java/
labs/shotoku/trunk/shotoku-base-service/src/java/org/
labs/shotoku/trunk/shotoku-base-service/src/java/org/jboss/
labs/shotoku/trunk/shotoku-base-service/src/java/org/jboss/shotoku/
labs/shotoku/trunk/shotoku-base-service/src/java/org/jboss/shotoku/service/
labs/shotoku/trunk/shotoku-base-service/src/java/org/jboss/shotoku/service/ShotokuServiceImpl.java
labs/shotoku/trunk/shotoku-base/src/java/org/jboss/shotoku/service/ShotokuServiceImpl.java
labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/portlet/
labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/feeds-object.xml
labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/portlet-instances.xml
labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/portlet.xml
labs/shotoku/trunk/shotoku-user/
Modified:
labs/shotoku/trunk/lib/jboss/activation.jar
labs/shotoku/trunk/lib/jboss/ejb3-persistence.jar
labs/shotoku/trunk/lib/jboss/javax.servlet.jar
labs/shotoku/trunk/lib/jboss/javax.servlet.jsp.jar
labs/shotoku/trunk/lib/jboss/jboss-annotations-ejb3.jar
labs/shotoku/trunk/lib/jboss/jboss-aop-jdk50.jar
labs/shotoku/trunk/lib/jboss/jboss-common.jar
labs/shotoku/trunk/lib/jboss/jboss-ejb3.jar
labs/shotoku/trunk/lib/jboss/jboss-ejb3x.jar
labs/shotoku/trunk/lib/jboss/jboss-j2ee.jar
labs/shotoku/trunk/lib/jboss/jboss-jmx.jar
labs/shotoku/trunk/lib/jboss/jboss-system.jar
labs/shotoku/trunk/lib/portal/portal-cms-lib.jar
labs/shotoku/trunk/lib/portal/portal-common-lib.jar
labs/shotoku/trunk/lib/portal/portal-core-lib.jar
labs/shotoku/trunk/lib/portal/portal-identity-lib.jar
labs/shotoku/trunk/lib/portal/portal-portlet-lib.jar
labs/shotoku/trunk/maven.xml
labs/shotoku/trunk/project.properties
labs/shotoku/trunk/shotoku-base/maven.xml
labs/shotoku/trunk/shotoku-base/src/java/org/jboss/shotoku/tools/Tools.java
labs/shotoku/trunk/shotoku-feeds/maven.xml
labs/shotoku/trunk/shotoku-feeds/project.xml
labs/shotoku/trunk/shotoku-feeds/shotoku-feeds.iml
labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/comments/service/CommentsServiceImpl.java
labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/FeedParsing.java
labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/ShotokuCommentableFeed.java
labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/service/FeedsServiceImpl.java
labs/shotoku/trunk/shotoku-file-access/maven.xml
labs/shotoku/trunk/shotoku-file-access/project.properties
labs/shotoku/trunk/shotoku-file-access/src/java/org/jboss/shotoku/fileaccess/FileAccessServlet.java
labs/shotoku/trunk/shotoku-jcr/maven.xml
labs/shotoku/trunk/shotoku-portal/maven.xml
labs/shotoku/trunk/shotoku-portal/src/java/org/jboss/shotoku/portal/ShotokuCMS.java
labs/shotoku/trunk/shotoku-svn/maven.xml
labs/shotoku/trunk/shotoku.iml
Log:
http://jira.jboss.com/jira/browse/JBLAB-817
Modified: labs/shotoku/trunk/lib/jboss/activation.jar
===================================================================
(Binary files differ)
Modified: labs/shotoku/trunk/lib/jboss/ejb3-persistence.jar
===================================================================
(Binary files differ)
Modified: labs/shotoku/trunk/lib/jboss/javax.servlet.jar
===================================================================
(Binary files differ)
Modified: labs/shotoku/trunk/lib/jboss/javax.servlet.jsp.jar
===================================================================
(Binary files differ)
Modified: labs/shotoku/trunk/lib/jboss/jboss-annotations-ejb3.jar
===================================================================
(Binary files differ)
Modified: labs/shotoku/trunk/lib/jboss/jboss-aop-jdk50.jar
===================================================================
(Binary files differ)
Modified: labs/shotoku/trunk/lib/jboss/jboss-common.jar
===================================================================
(Binary files differ)
Modified: labs/shotoku/trunk/lib/jboss/jboss-ejb3.jar
===================================================================
(Binary files differ)
Modified: labs/shotoku/trunk/lib/jboss/jboss-ejb3x.jar
===================================================================
(Binary files differ)
Modified: labs/shotoku/trunk/lib/jboss/jboss-j2ee.jar
===================================================================
(Binary files differ)
Modified: labs/shotoku/trunk/lib/jboss/jboss-jmx.jar
===================================================================
(Binary files differ)
Modified: labs/shotoku/trunk/lib/jboss/jboss-system.jar
===================================================================
(Binary files differ)
Modified: labs/shotoku/trunk/lib/portal/portal-cms-lib.jar
===================================================================
(Binary files differ)
Modified: labs/shotoku/trunk/lib/portal/portal-common-lib.jar
===================================================================
(Binary files differ)
Modified: labs/shotoku/trunk/lib/portal/portal-core-lib.jar
===================================================================
(Binary files differ)
Modified: labs/shotoku/trunk/lib/portal/portal-identity-lib.jar
===================================================================
(Binary files differ)
Modified: labs/shotoku/trunk/lib/portal/portal-portlet-lib.jar
===================================================================
(Binary files differ)
Modified: labs/shotoku/trunk/maven.xml
===================================================================
--- labs/shotoku/trunk/maven.xml 2007-01-20 22:42:16 UTC (rev 8944)
+++ labs/shotoku/trunk/maven.xml 2007-01-20 23:21:29 UTC (rev 8945)
@@ -24,7 +24,7 @@
excludes="" basedir="." banner="Shotoku build"
goals="${goal}" ignoreFailures="false" />
</j:forEach>
- </goal>
+ </goal>
<!-- Main goals -->
@@ -34,38 +34,37 @@
</goal>
<goal name="shotoku:deploy">
+ <ant:delete dir="${shotoku.jar.dest}" />
+
<j:set var="goal" value="deploy" />
<attainGoal name="shotoku-all-projects" />
- <!-- Constructing the sar -->
+ <!-- Copying the libraries -->
<ant:copy
- todir="target/${shotoku.sar.dir}" overwrite="true"
+ todir="${shotoku.jar.dest}" overwrite="true"
file="${maven.repo.local}/commons-configuration/jars/commons-configuration-1.1.jar" />
<ant:copy
- todir="target/${shotoku.sar.dir}" overwrite="true"
+ todir="${shotoku.jar.dest}" overwrite="true"
file="${maven.repo.local}/commons-lang/jars/commons-lang-2.1.jar" />
<ant:copy
- todir="target/${shotoku.sar.dir}" overwrite="true"
- file="${maven.repo.local}/commons-collections/jars/commons-collections-3.1.jar" />
- <ant:copy
- todir="target/${shotoku.sar.dir}" overwrite="true">
+ todir="${shotoku.jar.dest}" overwrite="true">
<ant:fileset dir="${maven.repo.local}/velocity/jars">
<ant:filename name="velocity*-1.4.jar" />
</ant:fileset>
</ant:copy>
+ <!-- Constructing the sar -->
<ant:copy todir="target/${shotoku.sar.dir}">
<ant:fileset dir="src/app" flatten="true" overwrite="true">
<ant:filename name="**" />
</ant:fileset>
</ant:copy>
+ <j:set var="jar.to.dir" value="target/${shotoku.sar.dir}" />
+ <attainGoal name="dir-to-jar" />
+
<!-- Copying the sar to the deploy directory. -->
- <ant:copy todir="${local.deploy.dir}">
- <ant:fileset dir="target" flatten="true" overwrite="true">
- <ant:filename name="${shotoku.sar.dir}/**" />
- </ant:fileset>
- </ant:copy>
+ <ant:copy todir="${local.deploy.dir}" file="target/${shotoku.sar.dir}" />
</goal>
<goal name="all">
@@ -80,7 +79,6 @@
<j:forEach items="${subprjs}" var="subprojectId">
<ant:delete dir="shotoku-${subprojectId}/target" />
</j:forEach>
- <ant:delete dir="${local.deploy.dir}/${shotoku.sar.dir}" />
</goal>
<!-- Distribution building -->
Modified: labs/shotoku/trunk/project.properties
===================================================================
--- labs/shotoku/trunk/project.properties 2007-01-20 22:42:16 UTC (rev 8944)
+++ labs/shotoku/trunk/project.properties 2007-01-20 23:21:29 UTC (rev 8945)
@@ -4,9 +4,13 @@
version=1.0-alpha3
shotoku.sar.dir=shotoku.sar
-shotoku.subprojects.cms=base,files,jcr,svn
-shotoku.subprojects=${shotoku.subprojects.cms},aop,test,user,admin,tags,feeds,file-access
+#shotoku.subprojects.cms=base,base-service,files,jcr,svn
+shotoku.subprojects.cms=base,base-service,svn
+#shotoku.subprojects=${shotoku.subprojects.cms},aop,test,,admin,tags,feeds,file-access,portal
+shotoku.subprojects=${shotoku.subprojects.cms},aop,admin,tags,feeds,file-access
+shotoku.jar.dest=${local.deploy.dir}/../lib/shotoku
+
maven.final.name=${pom.artifactId}
maven.jar.override=on
@@ -36,4 +40,3 @@
maven.jar.shotoku-svn=${shotoku.root.dir}/shotoku-svn/target/shotoku-svn.jar
maven.jar.shotoku-aop=${shotoku.root.dir}/shotoku-aop/target/shotoku-aop.jar
maven.jar.shotoku-tags=${shotoku.root.dir}/shotoku-tags/target/shotoku-tags.jar
-maven.jar.shotoku-user=${shotoku.root.dir}/shotoku-user/target/shotoku-user.jar
Modified: labs/shotoku/trunk/shotoku-base/maven.xml
===================================================================
--- labs/shotoku/trunk/shotoku-base/maven.xml 2007-01-20 22:42:16 UTC (rev 8944)
+++ labs/shotoku/trunk/shotoku-base/maven.xml 2007-01-20 23:21:29 UTC (rev 8945)
@@ -5,13 +5,13 @@
<goal name="build">
<attainGoal name="java:compile" />
- <attainGoal name="ejb" />
+ <attainGoal name="jar" />
</goal>
<goal name="deploy">
<ant:copy
file="target/shotoku-base.jar"
- tofile="../target/${shotoku.sar.dir}/shotoku-base.ejb3"
+ tofile="${shotoku.jar.dest}/shotoku-base.jar"
overwrite="true" />
</goal>
</project>
Deleted: 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 2007-01-20 22:42:16 UTC (rev 8944)
+++ labs/shotoku/trunk/shotoku-base/src/java/org/jboss/shotoku/service/ShotokuServiceImpl.java 2007-01-20 23:21:29 UTC (rev 8945)
@@ -1,293 +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.service;
-
-import javax.ejb.Local;
-
-import org.jboss.annotation.ejb.Management;
-import org.jboss.annotation.ejb.Service;
-import org.jboss.shotoku.ContentManager;
-import org.jboss.shotoku.cache.ShotokuCacheItem;
-import org.jboss.shotoku.cache.UpdateThread;
-import org.jboss.shotoku.tools.Constants;
-import org.jboss.shotoku.tools.ConcurrentSet;
-import org.jboss.shotoku.tools.ConcurrentHashSet;
-import org.jboss.shotoku.tools.Tools;
-import org.apache.log4j.Logger;
-
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.Set;
-
-/**
- *
- * @author Adam Warski (adamw at aster.pl)
- */
- at Service(objectName=Constants.SHOTOKU_SERVICE_NAME)
- at Local(ShotokuServiceLocal.class)
- at Management(ShotokuService.class)
-public class ShotokuServiceImpl extends AdministratedServiceImpl
- implements ShotokuService, ShotokuServiceLocal {
- Logger log = Logger.getLogger(AdministratedService.class);
-
- /*
- * Service-handling functions.
- */
-
- public void create() throws Exception {
- super.create();
-
- /*
- * Setting up content managers.
- */
- ContentManager.setup();
-
- log.info("ContentManager setup completed. Getting the default service timer interval...");
- updateThreadCount = ContentManager.getDefaultUpdateThreadCount();
-
- setTimerInterval(ContentManager.getDefaultServiceInterval());
-
- super.afterCreate();
- }
-
- public void start() throws Exception {
- super.start();
-
- log.info("Starting main update thread...");
-
- startUpdateThread();
-
- log.info("Starting update threads...");
- setUpdateThreadCount(updateThreadCount);
-
- log.info("Reseting keys during update in cache items...");
- // Reseting just in case - if any thread unexpectadly died.
- for (ShotokuCacheItem sci : cacheItems) {
- sci.resetKeysDuringUpdate();
- }
-
- super.afterStart();
- }
-
- public void stop() {
- super.stop();
-
- signalExitAllUpdateThreads();
- toRemove = 0;
- log.info("All update threads stopped.");
- }
-
- public void destroy() {
-
- }
-
- /*
- * Cache handling
- */
-
- private final ConcurrentMap<Object, Object> cache =
- new ConcurrentHashMap<Object, Object>();
- private final ConcurrentSet<ShotokuCacheItem> cacheItems =
- new ConcurrentHashSet<ShotokuCacheItem>();
- private final ConcurrentMap<Object, Long> lastUpdates =
- new ConcurrentHashMap<Object, Long>();
-
- public Object get(Object key) {
- Object ret = cache.get(key);
- if (Null.getInstance().equals(ret)) {
- return null;
- } else {
- return ret;
- }
- }
-
- public void put(Object key, Object o) {
- touch(key);
-
- if (o == null) {
- cache.put(key, Null.getInstance());
- } else {
- cache.put(key, o);
- }
- }
-
- public void touch(Object key) {
- lastUpdates.put(key, System.currentTimeMillis());
- }
-
- public void remove(Object key) {
- cache.remove(key);
- }
-
- public void register(ShotokuCacheItem cacheItem) {
- cacheItems.add(cacheItem);
- }
-
- private int counter = 0;
- private final Object counterSync = new Object();
-
- public String getNextKeyBase() {
- int c;
- synchronized(counterSync) { c = counter++; }
-
- return Constants.SHOTOKU_CACHE_KEY_BASE + c;
- }
-
- /*
- * Update threads management.
- */
-
- private final ConcurrentSet<UpdateThread> allUpdateThreads =
- new ConcurrentHashSet<UpdateThread>();
- private final LinkedBlockingQueue<UpdateThread> updateThreads =
- new LinkedBlockingQueue<UpdateThread>();
- private int updateThreadCount;
- /**
- * Number of threads that should be removed, instead of
- */
- private volatile int toRemove = 0;
-
- public int getUpdateThreadsCount() {
- return updateThreads.size();
- }
-
- public void setUpdateThreadCount(int n) {
- synchronized (updateThreads) {
- int current = updateThreads.size();
-
- if (current < n) {
- for (int i=current; i<n; i++) {
- UpdateThread ut = new UpdateThread(this);
- updateThreads.offer(ut);
- allUpdateThreads.add(ut);
- ut.start();
- }
- } else if (n < current) {
- toRemove += current - n;
- }
- }
-
- log.info("Update thread count set to: " + n + ".");
- updateThreadCount = n;
- }
-
- public UpdateThread acquireUpdateThread() {
- try {
- return updateThreads.take();
- } catch (InterruptedException e) {
- log.error("Error while acquireing an update thread (interrupted).", e);
- return null;
- }
- }
-
- public void releaseUpdateThread(UpdateThread ut) {
- if (toRemove != 0) {
- synchronized (updateThreads) {
- if (toRemove != 0) {
- ut.signalExit();
- toRemove--;
- return;
- }
- }
- }
-
- updateThreads.offer(ut);
- }
-
- public void updateThreadExited(UpdateThread ut) {
- allUpdateThreads.remove(ut);
- }
-
- private void signalExitAllUpdateThreads() {
- for (UpdateThread ut : allUpdateThreads) {
- ut.signalExit();
- }
- }
-
- /*
- * Update function.
- */
-
- public void update() {
- for (ShotokuCacheItem sci : cacheItems) {
- try {
- sci.update();
- } catch (Throwable t) {
- log.error("Exception while updating a cache item.", t);
- }
- }
- }
-
- /*
- * Description functions.
- */
-
- public AdministratedService getServiceInstance() {
- return Tools.getService();
- }
-
- public String getServiceId() {
- return "ShotokuService";
- }
-
- public String getServiceName() {
- return "Shotoku service";
- }
-
- public String getServiceDescription() {
- long now = System.currentTimeMillis();
-
- StringBuffer sb = new StringBuffer("Cache service.<br />");
- sb.append("Currently storing ").append(cache.size()).append(" items in the cache ");
- sb.append("and ").append(cacheItems.size()).append(" ShotokuCacheItem objects.<br />");
- sb.append("Objects in cache:<br />");
- for (Object key : cache.keySet()) {
- sb.append(key.toString()).append(" : ").append(
- cache.get(key).getClass().getName()).append(
- ", last updated ").append((now - lastUpdates.get(key)) / 1000).append(
- " seconds ago.<br />");
- }
-
- sb.append("Cache items:<br />");
- for (ShotokuCacheItem sci : cacheItems) {
- sb.append(sci.getClass().getName()).append("<br />");
- }
-
- return sb.toString();
- }
-
- /*
- * Service administration.
- */
-
- private ConcurrentSet<AdministratedServiceGetter> services =
- new ConcurrentHashSet<AdministratedServiceGetter>();
-
- public void addAdministratedService(AdministratedServiceGetter asg) {
- services.add(asg);
- }
-
- public Set<AdministratedServiceGetter> getAdministratedServices() {
- return services;
- }
-}
Modified: labs/shotoku/trunk/shotoku-base/src/java/org/jboss/shotoku/tools/Tools.java
===================================================================
--- labs/shotoku/trunk/shotoku-base/src/java/org/jboss/shotoku/tools/Tools.java 2007-01-20 22:42:16 UTC (rev 8944)
+++ labs/shotoku/trunk/shotoku-base/src/java/org/jboss/shotoku/tools/Tools.java 2007-01-20 23:21:29 UTC (rev 8945)
@@ -33,7 +33,6 @@
import org.jboss.shotoku.ContentManager;
import org.jboss.shotoku.service.ShotokuService;
-import org.jboss.shotoku.service.ShotokuServiceImpl;
import org.jboss.shotoku.exceptions.RepositoryException;
import org.jboss.shotoku.exceptions.NameFormatException;
import org.jboss.mx.util.MBeanProxyExt;
@@ -58,7 +57,9 @@
if (instance == null) {
if (ContentManager.isEmbedded()) {
// Embedded mode - simply creating a new service instance.
- instance = new ShotokuServiceImpl();
+ instance = (ShotokuService) Thread.currentThread().
+ getContextClassLoader().loadClass(
+ "org.jboss.shotoku.service.ShotokuServiceImpl").newInstance();
instance.create();
instance.start();
} else {
@@ -258,6 +259,8 @@
/**
* Checks if the given string is empty (null or "").
+ * @param s String to check.
+ * @return True iff the given string is null or equal to "".
*/
public static boolean isEmpty(String s) {
return (s == null) || ("".equals(s));
@@ -355,7 +358,7 @@
* Input stream to read from.
* @param os
* Output stream to write to.
- * @throws IOException
+ * @throws IOException In case of an IO exception.
*/
public static void transfer(InputStream is, OutputStream os) throws IOException {
byte[] buffer = new byte[ContentManager.getTransferBufferSize()];
@@ -373,7 +376,7 @@
* Input stream to read from.
* @param w
* Printwriter to write to.
- * @throws IOException
+ * @throws IOException In case of an IO exception.
*/
public static void transfer(InputStream is, PrintWriter w) throws IOException {
char[] buffer = new char[ContentManager.getTransferBufferSize()];
@@ -421,7 +424,7 @@
/**
* @param file File to read from.
* @return Content of the given file represented as a byte buffer.
- * @throws IOException
+ * @throws IOException In case of an IO exception.
*/
public static ByteBuffer getFileBytes(File file) throws IOException {
FileChannel fc = new FileInputStream(file).getChannel();
@@ -435,7 +438,7 @@
/**
* @param file File to read from.
* @return Content of the given file represented as a String.
- * @throws IOException
+ * @throws IOException In case of an IO exception.
*/
public static String getFileString(File file) throws IOException {
return Charset.forName(
Copied: labs/shotoku/trunk/shotoku-base-service (from rev 8944, labs/shotoku/trunk-2.6/shotoku-base-service)
Property changes on: labs/shotoku/trunk/shotoku-base-service
___________________________________________________________________
Name: svn:ignore
+ target
Deleted: labs/shotoku/trunk/shotoku-base-service/maven.xml
===================================================================
--- labs/shotoku/trunk-2.6/shotoku-base-service/maven.xml 2007-01-20 22:42:16 UTC (rev 8944)
+++ labs/shotoku/trunk/shotoku-base-service/maven.xml 2007-01-20 23:21:29 UTC (rev 8945)
@@ -1,17 +0,0 @@
-<project xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:u="jelly:util">
- <goal name="clean">
- <attainGoal name="prj-clean" />
- </goal>
-
- <goal name="build">
- <attainGoal name="java:compile" />
- <attainGoal name="ejb" />
- </goal>
-
- <goal name="deploy">
- <ant:copy
- file="target/shotoku-base-service.jar"
- tofile="${local.deploy.dir}/shotoku-base-service.ejb3"
- overwrite="true" />
- </goal>
-</project>
Copied: labs/shotoku/trunk/shotoku-base-service/maven.xml (from rev 8944, labs/shotoku/trunk-2.6/shotoku-base-service/maven.xml)
===================================================================
--- labs/shotoku/trunk/shotoku-base-service/maven.xml (rev 0)
+++ labs/shotoku/trunk/shotoku-base-service/maven.xml 2007-01-20 23:21:29 UTC (rev 8945)
@@ -0,0 +1,17 @@
+<project xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:u="jelly:util">
+ <goal name="clean">
+ <attainGoal name="prj-clean" />
+ </goal>
+
+ <goal name="build">
+ <attainGoal name="java:compile" />
+ <attainGoal name="ejb" />
+ </goal>
+
+ <goal name="deploy">
+ <ant:copy
+ file="target/shotoku-base-service.jar"
+ tofile="${local.deploy.dir}/shotoku-base-service.ejb3"
+ overwrite="true" />
+ </goal>
+</project>
Deleted: labs/shotoku/trunk/shotoku-base-service/project.properties
===================================================================
--- labs/shotoku/trunk-2.6/shotoku-base-service/project.properties 2007-01-20 22:42:16 UTC (rev 8944)
+++ labs/shotoku/trunk/shotoku-base-service/project.properties 2007-01-20 23:21:29 UTC (rev 8945)
@@ -1,3 +0,0 @@
-maven.repo.remote=http://repo1.maven.org/maven
-
-maven.final.name=${pom.artifactId}
\ No newline at end of file
Copied: labs/shotoku/trunk/shotoku-base-service/project.properties (from rev 8944, labs/shotoku/trunk-2.6/shotoku-base-service/project.properties)
===================================================================
--- labs/shotoku/trunk/shotoku-base-service/project.properties (rev 0)
+++ labs/shotoku/trunk/shotoku-base-service/project.properties 2007-01-20 23:21:29 UTC (rev 8945)
@@ -0,0 +1,3 @@
+maven.repo.remote=http://repo1.maven.org/maven
+
+maven.final.name=${pom.artifactId}
\ No newline at end of file
Deleted: labs/shotoku/trunk/shotoku-base-service/project.xml
===================================================================
--- labs/shotoku/trunk-2.6/shotoku-base-service/project.xml 2007-01-20 22:42:16 UTC (rev 8944)
+++ labs/shotoku/trunk/shotoku-base-service/project.xml 2007-01-20 23:21:29 UTC (rev 8945)
@@ -1,46 +0,0 @@
-<?xml version='1.0' encoding='ISO-8859-1'?>
-<project>
- <pomVersion>3</pomVersion>
- <extend>../project.xml</extend>
- <id>shotoku-base-service</id>
- <name>Shotoku base service</name>
-
- <dependencies>
- <dependency>
- <groupId>shotoku</groupId>
- <artifactId>shotoku-base</artifactId>
- <jar>shotoku-base.jar</jar>
- </dependency>
-
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>ejb3-persistence</artifactId>
- <jar>ejb3-persistence.jar</jar>
- </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-ejb3x</artifactId>
- <jar>jboss-ejb3x.jar</jar>
- </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-j2ee</artifactId>
- <jar>jboss-j2ee.jar</jar>
- </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-annotations-ejb3</artifactId>
- <jar>jboss-annotations-ejb3.jar</jar>
- </dependency>
- </dependencies>
-
- <build>
- <sourceDirectory>src/java</sourceDirectory>
- <resources>
- <resource>
- <directory>src/etc/</directory>
- <include>**/*.xml</include>
- </resource>
- </resources>
- </build>
-</project>
Copied: labs/shotoku/trunk/shotoku-base-service/project.xml (from rev 8944, labs/shotoku/trunk-2.6/shotoku-base-service/project.xml)
===================================================================
--- labs/shotoku/trunk/shotoku-base-service/project.xml (rev 0)
+++ labs/shotoku/trunk/shotoku-base-service/project.xml 2007-01-20 23:21:29 UTC (rev 8945)
@@ -0,0 +1,46 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+<project>
+ <pomVersion>3</pomVersion>
+ <extend>../project.xml</extend>
+ <id>shotoku-base-service</id>
+ <name>Shotoku base service</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>shotoku</groupId>
+ <artifactId>shotoku-base</artifactId>
+ <jar>shotoku-base.jar</jar>
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>ejb3-persistence</artifactId>
+ <jar>ejb3-persistence.jar</jar>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-ejb3x</artifactId>
+ <jar>jboss-ejb3x.jar</jar>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-j2ee</artifactId>
+ <jar>jboss-j2ee.jar</jar>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-annotations-ejb3</artifactId>
+ <jar>jboss-annotations-ejb3.jar</jar>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <sourceDirectory>src/java</sourceDirectory>
+ <resources>
+ <resource>
+ <directory>src/etc/</directory>
+ <include>**/*.xml</include>
+ </resource>
+ </resources>
+ </build>
+</project>
Deleted: labs/shotoku/trunk/shotoku-base-service/shotoku-base-service.iml
===================================================================
--- labs/shotoku/trunk-2.6/shotoku-base-service/shotoku-base-service.iml 2007-01-20 22:42:16 UTC (rev 8944)
+++ labs/shotoku/trunk/shotoku-base-service/shotoku-base-service.iml 2007-01-20 23:21:29 UTC (rev 8945)
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module version="4" relativePaths="true" type="JAVA_MODULE">
- <component name="ModuleRootManager" />
- <component name="NewModuleRootManager" inherit-compiler-output="true">
- <exclude-output />
- <content url="file://$MODULE_DIR$">
- <sourceFolder url="file://$MODULE_DIR$/src/java" isTestSource="false" />
- <excludeFolder url="file://$MODULE_DIR$/target" />
- </content>
- <orderEntry type="inheritedJdk" />
- <orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="module" module-name="shotoku-aop" />
- <orderEntry type="module" module-name="shotoku-base" />
- <orderEntry type="library" name="jboss" level="application" />
- <orderEntryProperties />
- </component>
-</module>
-
Copied: labs/shotoku/trunk/shotoku-base-service/shotoku-base-service.iml (from rev 8944, labs/shotoku/trunk-2.6/shotoku-base-service/shotoku-base-service.iml)
===================================================================
--- labs/shotoku/trunk/shotoku-base-service/shotoku-base-service.iml (rev 0)
+++ labs/shotoku/trunk/shotoku-base-service/shotoku-base-service.iml 2007-01-20 23:21:29 UTC (rev 8945)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/java" isTestSource="false" />
+ <excludeFolder url="file://$MODULE_DIR$/target" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="shotoku-aop" />
+ <orderEntry type="module" module-name="shotoku-base" />
+ <orderEntry type="library" name="jboss" level="application" />
+ <orderEntryProperties />
+ </component>
+</module>
+
Copied: labs/shotoku/trunk/shotoku-base-service/src (from rev 8944, labs/shotoku/trunk-2.6/shotoku-base-service/src)
Copied: labs/shotoku/trunk/shotoku-base-service/src/etc (from rev 8944, labs/shotoku/trunk-2.6/shotoku-base-service/src/etc)
Copied: labs/shotoku/trunk/shotoku-base-service/src/java (from rev 8944, labs/shotoku/trunk-2.6/shotoku-base-service/src/java)
Copied: labs/shotoku/trunk/shotoku-base-service/src/java/org (from rev 8944, labs/shotoku/trunk-2.6/shotoku-base-service/src/java/org)
Copied: labs/shotoku/trunk/shotoku-base-service/src/java/org/jboss (from rev 8944, labs/shotoku/trunk-2.6/shotoku-base-service/src/java/org/jboss)
Copied: labs/shotoku/trunk/shotoku-base-service/src/java/org/jboss/shotoku (from rev 8944, labs/shotoku/trunk-2.6/shotoku-base-service/src/java/org/jboss/shotoku)
Copied: labs/shotoku/trunk/shotoku-base-service/src/java/org/jboss/shotoku/service (from rev 8944, labs/shotoku/trunk-2.6/shotoku-base-service/src/java/org/jboss/shotoku/service)
Deleted: labs/shotoku/trunk/shotoku-base-service/src/java/org/jboss/shotoku/service/ShotokuServiceImpl.java
===================================================================
--- labs/shotoku/trunk-2.6/shotoku-base-service/src/java/org/jboss/shotoku/service/ShotokuServiceImpl.java 2007-01-20 22:42:16 UTC (rev 8944)
+++ labs/shotoku/trunk/shotoku-base-service/src/java/org/jboss/shotoku/service/ShotokuServiceImpl.java 2007-01-20 23:21:29 UTC (rev 8945)
@@ -1,293 +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.service;
-
-import javax.ejb.Local;
-
-import org.jboss.annotation.ejb.Management;
-import org.jboss.annotation.ejb.Service;
-import org.jboss.shotoku.ContentManager;
-import org.jboss.shotoku.cache.ShotokuCacheItem;
-import org.jboss.shotoku.cache.UpdateThread;
-import org.jboss.shotoku.tools.Constants;
-import org.jboss.shotoku.tools.ConcurrentSet;
-import org.jboss.shotoku.tools.ConcurrentHashSet;
-import org.jboss.shotoku.tools.Tools;
-import org.apache.log4j.Logger;
-
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.Set;
-
-/**
- *
- * @author Adam Warski (adamw at aster.pl)
- */
- at Service(objectName=Constants.SHOTOKU_SERVICE_NAME)
- at Local(ShotokuServiceLocal.class)
- at Management(ShotokuService.class)
-public class ShotokuServiceImpl extends AdministratedServiceImpl
- implements ShotokuService, ShotokuServiceLocal {
- Logger log = Logger.getLogger(AdministratedService.class);
-
- /*
- * Service-handling functions.
- */
-
- public void create() throws Exception {
- super.create();
-
- /*
- * Setting up content managers.
- */
- ContentManager.setup();
-
- log.info("ContentManager setup completed. Getting the default service timer interval...");
- updateThreadCount = ContentManager.getDefaultUpdateThreadCount();
-
- setTimerInterval(ContentManager.getDefaultServiceInterval());
-
- super.afterCreate();
- }
-
- public void start() throws Exception {
- super.start();
-
- log.info("Starting main update thread...");
-
- startUpdateThread();
-
- log.info("Starting update threads...");
- setUpdateThreadCount(updateThreadCount);
-
- log.info("Reseting keys during update in cache items...");
- // Reseting just in case - if any thread unexpectadly died.
- for (ShotokuCacheItem sci : cacheItems) {
- sci.resetKeysDuringUpdate();
- }
-
- super.afterStart();
- }
-
- public void stop() {
- super.stop();
-
- signalExitAllUpdateThreads();
- toRemove = 0;
- log.info("All update threads stopped.");
- }
-
- public void destroy() {
-
- }
-
- /*
- * Cache handling
- */
-
- private final ConcurrentMap<Object, Object> cache =
- new ConcurrentHashMap<Object, Object>();
- private final ConcurrentSet<ShotokuCacheItem> cacheItems =
- new ConcurrentHashSet<ShotokuCacheItem>();
- private final ConcurrentMap<Object, Long> lastUpdates =
- new ConcurrentHashMap<Object, Long>();
-
- public Object get(Object key) {
- Object ret = cache.get(key);
- if (Null.getInstance().equals(ret)) {
- return null;
- } else {
- return ret;
- }
- }
-
- public void put(Object key, Object o) {
- touch(key);
-
- if (o == null) {
- cache.put(key, Null.getInstance());
- } else {
- cache.put(key, o);
- }
- }
-
- public void touch(Object key) {
- lastUpdates.put(key, System.currentTimeMillis());
- }
-
- public void remove(Object key) {
- cache.remove(key);
- }
-
- public void register(ShotokuCacheItem cacheItem) {
- cacheItems.add(cacheItem);
- }
-
- private int counter = 0;
- private final Object counterSync = new Object();
-
- public String getNextKeyBase() {
- int c;
- synchronized(counterSync) { c = counter++; }
-
- return Constants.SHOTOKU_CACHE_KEY_BASE + c;
- }
-
- /*
- * Update threads management.
- */
-
- private final ConcurrentSet<UpdateThread> allUpdateThreads =
- new ConcurrentHashSet<UpdateThread>();
- private final LinkedBlockingQueue<UpdateThread> updateThreads =
- new LinkedBlockingQueue<UpdateThread>();
- private int updateThreadCount;
- /**
- * Number of threads that should be removed, instead of returned
- */
- private volatile int toRemove = 0;
-
- public int getUpdateThreadsCount() {
- return updateThreads.size();
- }
-
- public void setUpdateThreadCount(int n) {
- synchronized (updateThreads) {
- int current = updateThreads.size();
-
- if (current < n) {
- for (int i=current; i<n; i++) {
- UpdateThread ut = new UpdateThread(this);
- updateThreads.offer(ut);
- allUpdateThreads.add(ut);
- ut.start();
- }
- } else if (n < current) {
- toRemove += current - n;
- }
- }
-
- log.info("Update thread count set to: " + n + ".");
- updateThreadCount = n;
- }
-
- public UpdateThread acquireUpdateThread() {
- try {
- return updateThreads.take();
- } catch (InterruptedException e) {
- log.error("Error while acquireing an update thread (interrupted).", e);
- return null;
- }
- }
-
- public void releaseUpdateThread(UpdateThread ut) {
- if (toRemove != 0) {
- synchronized (updateThreads) {
- if (toRemove != 0) {
- ut.signalExit();
- toRemove--;
- return;
- }
- }
- }
-
- updateThreads.offer(ut);
- }
-
- public void updateThreadExited(UpdateThread ut) {
- allUpdateThreads.remove(ut);
- }
-
- private void signalExitAllUpdateThreads() {
- for (UpdateThread ut : allUpdateThreads) {
- ut.signalExit();
- }
- }
-
- /*
- * Update function.
- */
-
- public void update() {
- for (ShotokuCacheItem sci : cacheItems) {
- try {
- sci.update();
- } catch (Throwable t) {
- log.error("Exception while updating a cache item.", t);
- }
- }
- }
-
- /*
- * Description functions.
- */
-
- public AdministratedService getServiceInstance() {
- return Tools.getService();
- }
-
- public String getServiceId() {
- return "ShotokuService";
- }
-
- public String getServiceName() {
- return "Shotoku service";
- }
-
- public String getServiceDescription() {
- long now = System.currentTimeMillis();
-
- StringBuffer sb = new StringBuffer("Cache service.<br />");
- sb.append("Currently storing ").append(cache.size()).append(" items in the cache ");
- sb.append("and ").append(cacheItems.size()).append(" ShotokuCacheItem objects.<br />");
- sb.append("Objects in cache:<br />");
- for (Object key : cache.keySet()) {
- sb.append(key.toString()).append(" : ").append(
- cache.get(key).getClass().getName()).append(
- ", last updated ").append((now - lastUpdates.get(key)) / 1000).append(
- " seconds ago.<br />");
- }
-
- sb.append("Cache items:<br />");
- for (ShotokuCacheItem sci : cacheItems) {
- sb.append(sci.getClass().getName()).append("<br />");
- }
-
- return sb.toString();
- }
-
- /*
- * Service administration.
- */
-
- private ConcurrentSet<AdministratedServiceGetter> services =
- new ConcurrentHashSet<AdministratedServiceGetter>();
-
- public void addAdministratedService(AdministratedServiceGetter asg) {
- services.add(asg);
- }
-
- public Set<AdministratedServiceGetter> getAdministratedServices() {
- return services;
- }
-}
Copied: labs/shotoku/trunk/shotoku-base-service/src/java/org/jboss/shotoku/service/ShotokuServiceImpl.java (from rev 8944, labs/shotoku/trunk-2.6/shotoku-base-service/src/java/org/jboss/shotoku/service/ShotokuServiceImpl.java)
===================================================================
--- labs/shotoku/trunk/shotoku-base-service/src/java/org/jboss/shotoku/service/ShotokuServiceImpl.java (rev 0)
+++ labs/shotoku/trunk/shotoku-base-service/src/java/org/jboss/shotoku/service/ShotokuServiceImpl.java 2007-01-20 23:21:29 UTC (rev 8945)
@@ -0,0 +1,293 @@
+/*
+ * 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.service;
+
+import javax.ejb.Local;
+
+import org.jboss.annotation.ejb.Management;
+import org.jboss.annotation.ejb.Service;
+import org.jboss.shotoku.ContentManager;
+import org.jboss.shotoku.cache.ShotokuCacheItem;
+import org.jboss.shotoku.cache.UpdateThread;
+import org.jboss.shotoku.tools.Constants;
+import org.jboss.shotoku.tools.ConcurrentSet;
+import org.jboss.shotoku.tools.ConcurrentHashSet;
+import org.jboss.shotoku.tools.Tools;
+import org.apache.log4j.Logger;
+
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.Set;
+
+/**
+ *
+ * @author Adam Warski (adamw at aster.pl)
+ */
+ at Service(objectName=Constants.SHOTOKU_SERVICE_NAME)
+ at Local(ShotokuServiceLocal.class)
+ at Management(ShotokuService.class)
+public class ShotokuServiceImpl extends AdministratedServiceImpl
+ implements ShotokuService, ShotokuServiceLocal {
+ Logger log = Logger.getLogger(AdministratedService.class);
+
+ /*
+ * Service-handling functions.
+ */
+
+ public void create() throws Exception {
+ super.create();
+
+ /*
+ * Setting up content managers.
+ */
+ ContentManager.setup();
+
+ log.info("ContentManager setup completed. Getting the default service timer interval...");
+ updateThreadCount = ContentManager.getDefaultUpdateThreadCount();
+
+ setTimerInterval(ContentManager.getDefaultServiceInterval());
+
+ super.afterCreate();
+ }
+
+ public void start() throws Exception {
+ super.start();
+
+ log.info("Starting main update thread...");
+
+ startUpdateThread();
+
+ log.info("Starting update threads...");
+ setUpdateThreadCount(updateThreadCount);
+
+ log.info("Reseting keys during update in cache items...");
+ // Reseting just in case - if any thread unexpectadly died.
+ for (ShotokuCacheItem sci : cacheItems) {
+ sci.resetKeysDuringUpdate();
+ }
+
+ super.afterStart();
+ }
+
+ public void stop() {
+ super.stop();
+
+ signalExitAllUpdateThreads();
+ toRemove = 0;
+ log.info("All update threads stopped.");
+ }
+
+ public void destroy() {
+
+ }
+
+ /*
+ * Cache handling
+ */
+
+ private final ConcurrentMap<Object, Object> cache =
+ new ConcurrentHashMap<Object, Object>();
+ private final ConcurrentSet<ShotokuCacheItem> cacheItems =
+ new ConcurrentHashSet<ShotokuCacheItem>();
+ private final ConcurrentMap<Object, Long> lastUpdates =
+ new ConcurrentHashMap<Object, Long>();
+
+ public Object get(Object key) {
+ Object ret = cache.get(key);
+ if (Null.getInstance().equals(ret)) {
+ return null;
+ } else {
+ return ret;
+ }
+ }
+
+ public void put(Object key, Object o) {
+ touch(key);
+
+ if (o == null) {
+ cache.put(key, Null.getInstance());
+ } else {
+ cache.put(key, o);
+ }
+ }
+
+ public void touch(Object key) {
+ lastUpdates.put(key, System.currentTimeMillis());
+ }
+
+ public void remove(Object key) {
+ cache.remove(key);
+ }
+
+ public void register(ShotokuCacheItem cacheItem) {
+ cacheItems.add(cacheItem);
+ }
+
+ private int counter = 0;
+ private final Object counterSync = new Object();
+
+ public String getNextKeyBase() {
+ int c;
+ synchronized(counterSync) { c = counter++; }
+
+ return Constants.SHOTOKU_CACHE_KEY_BASE + c;
+ }
+
+ /*
+ * Update threads management.
+ */
+
+ private final ConcurrentSet<UpdateThread> allUpdateThreads =
+ new ConcurrentHashSet<UpdateThread>();
+ private final LinkedBlockingQueue<UpdateThread> updateThreads =
+ new LinkedBlockingQueue<UpdateThread>();
+ private int updateThreadCount;
+ /**
+ * Number of threads that should be removed, instead of returned
+ */
+ private volatile int toRemove = 0;
+
+ public int getUpdateThreadsCount() {
+ return updateThreads.size();
+ }
+
+ public void setUpdateThreadCount(int n) {
+ synchronized (updateThreads) {
+ int current = updateThreads.size();
+
+ if (current < n) {
+ for (int i=current; i<n; i++) {
+ UpdateThread ut = new UpdateThread(this);
+ updateThreads.offer(ut);
+ allUpdateThreads.add(ut);
+ ut.start();
+ }
+ } else if (n < current) {
+ toRemove += current - n;
+ }
+ }
+
+ log.info("Update thread count set to: " + n + ".");
+ updateThreadCount = n;
+ }
+
+ public UpdateThread acquireUpdateThread() {
+ try {
+ return updateThreads.take();
+ } catch (InterruptedException e) {
+ log.error("Error while acquireing an update thread (interrupted).", e);
+ return null;
+ }
+ }
+
+ public void releaseUpdateThread(UpdateThread ut) {
+ if (toRemove != 0) {
+ synchronized (updateThreads) {
+ if (toRemove != 0) {
+ ut.signalExit();
+ toRemove--;
+ return;
+ }
+ }
+ }
+
+ updateThreads.offer(ut);
+ }
+
+ public void updateThreadExited(UpdateThread ut) {
+ allUpdateThreads.remove(ut);
+ }
+
+ private void signalExitAllUpdateThreads() {
+ for (UpdateThread ut : allUpdateThreads) {
+ ut.signalExit();
+ }
+ }
+
+ /*
+ * Update function.
+ */
+
+ public void update() {
+ for (ShotokuCacheItem sci : cacheItems) {
+ try {
+ sci.update();
+ } catch (Throwable t) {
+ log.error("Exception while updating a cache item.", t);
+ }
+ }
+ }
+
+ /*
+ * Description functions.
+ */
+
+ public AdministratedService getServiceInstance() {
+ return Tools.getService();
+ }
+
+ public String getServiceId() {
+ return "ShotokuService";
+ }
+
+ public String getServiceName() {
+ return "Shotoku service";
+ }
+
+ public String getServiceDescription() {
+ long now = System.currentTimeMillis();
+
+ StringBuffer sb = new StringBuffer("Cache service.<br />");
+ sb.append("Currently storing ").append(cache.size()).append(" items in the cache ");
+ sb.append("and ").append(cacheItems.size()).append(" ShotokuCacheItem objects.<br />");
+ sb.append("Objects in cache:<br />");
+ for (Object key : cache.keySet()) {
+ sb.append(key.toString()).append(" : ").append(
+ cache.get(key).getClass().getName()).append(
+ ", last updated ").append((now - lastUpdates.get(key)) / 1000).append(
+ " seconds ago.<br />");
+ }
+
+ sb.append("Cache items:<br />");
+ for (ShotokuCacheItem sci : cacheItems) {
+ sb.append(sci.getClass().getName()).append("<br />");
+ }
+
+ return sb.toString();
+ }
+
+ /*
+ * Service administration.
+ */
+
+ private ConcurrentSet<AdministratedServiceGetter> services =
+ new ConcurrentHashSet<AdministratedServiceGetter>();
+
+ public void addAdministratedService(AdministratedServiceGetter asg) {
+ services.add(asg);
+ }
+
+ public Set<AdministratedServiceGetter> getAdministratedServices() {
+ return services;
+ }
+}
Modified: labs/shotoku/trunk/shotoku-feeds/maven.xml
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/maven.xml 2007-01-20 22:42:16 UTC (rev 8944)
+++ labs/shotoku/trunk/shotoku-feeds/maven.xml 2007-01-20 23:21:29 UTC (rev 8945)
@@ -27,32 +27,32 @@
<!-- Copying the rome plugins jar -->
<ant:copy
- todir="../target/${shotoku.sar.dir}" overwrite="true"
+ todir="${shotoku.jar.dest}" overwrite="true"
file="target/rome-plugins.jar" />
<ant:copy
- todir="../target/${shotoku.sar.dir}" overwrite="true"
+ todir="${shotoku.jar.dest}" overwrite="true"
file="${maven.repo.local}/jdom/jars/jdom-1.0.jar" />
<ant:copy
- todir="../target/${shotoku.sar.dir}" overwrite="true"
+ todir="${shotoku.jar.dest}" overwrite="true"
file="${maven.repo.local}/xerces/jars/xercesImpl-2.8.0.jar" />
<ant:copy
- todir="../target/${shotoku.sar.dir}" overwrite="true"
+ todir="${shotoku.jar.dest}" overwrite="true"
file="${maven.repo.local}/xerces/jars/xmlParserAPIs-2.6.2.jar" />
<ant:copy
- todir="../target/${shotoku.sar.dir}" overwrite="true"
+ todir="${shotoku.jar.dest}" overwrite="true"
file="${maven.repo.local}/xalan/jars/xalan-2.7.0.jar" />
<ant:copy
- todir="../target/${shotoku.sar.dir}" overwrite="true"
+ todir="${shotoku.jar.dest}" overwrite="true"
file="lib/informa.jar" />
<ant:copy
- todir="../target/${shotoku.sar.dir}" overwrite="true"
+ todir="${shotoku.jar.dest}" overwrite="true"
file="lib/rome-0.7.jar" />
- <j:set var="jar.to.dir" value="../target/${shotoku.sar.dir}/rome-0.7.jar" />
+ <j:set var="jar.to.dir" value="${shotoku.jar.dest}/rome-0.7.jar" />
<attainGoal name="jar-to-dir" />
- <ant:copy todir="../target/${shotoku.sar.dir}/rome-0.7.jar/com/sun/syndication"
+ <ant:copy todir="${shotoku.jar.dest}/rome-0.7.jar/com/sun/syndication"
overwrite="true"
file="src/rome/rome.properties" />
<attainGoal name="dir-to-jar" />
Modified: labs/shotoku/trunk/shotoku-feeds/project.xml
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/project.xml 2007-01-20 22:42:16 UTC (rev 8944)
+++ labs/shotoku/trunk/shotoku-feeds/project.xml 2007-01-20 23:21:29 UTC (rev 8945)
@@ -31,12 +31,6 @@
<dependency>
<groupId>shotoku</groupId>
- <artifactId>shotoku-user</artifactId>
- <jar>shotoku-user.jar</jar>
- </dependency>
-
- <dependency>
- <groupId>shotoku</groupId>
<artifactId>shotoku-aop</artifactId>
<jar>shotoku-aop.jar</jar>
</dependency>
Modified: labs/shotoku/trunk/shotoku-feeds/shotoku-feeds.iml
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/shotoku-feeds.iml 2007-01-20 22:42:16 UTC (rev 8944)
+++ labs/shotoku/trunk/shotoku-feeds/shotoku-feeds.iml 2007-01-20 23:21:29 UTC (rev 8945)
@@ -15,7 +15,6 @@
<orderEntry type="library" name="velocity" level="application" />
<orderEntry type="module" module-name="shotoku-tags" />
<orderEntry type="library" name="junit" level="application" />
- <orderEntry type="module" module-name="shotoku-user" />
<orderEntry type="library" name="feeds" level="application" />
<orderEntry type="library" name="portlet" level="application" />
<orderEntryProperties />
Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/comments/service/CommentsServiceImpl.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/comments/service/CommentsServiceImpl.java 2007-01-20 22:42:16 UTC (rev 8944)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/comments/service/CommentsServiceImpl.java 2007-01-20 23:21:29 UTC (rev 8945)
@@ -14,7 +14,6 @@
import org.jboss.shotoku.feeds.data.CommentableFeed;
import org.jboss.shotoku.feeds.data.ShotokuCommentableFeed;
import org.jboss.shotoku.feeds.exceptions.FeedDoesNotExistException;
-import org.jboss.shotoku.user.tools.UserConstants;
import org.jboss.shotoku.tools.Constants;
import org.jboss.shotoku.tools.Tools;
import org.jboss.shotoku.service.AdministratedServiceImpl;
@@ -42,8 +41,7 @@
@Service(objectName = FeedsConstants.COMMENTS_SERVICE_NAME)
@Local(CommentsServiceLocal.class)
@Management(CommentsService.class)
- at Depends({UserConstants.USER_SERVICE_NAME, Constants.SHOTOKU_SERVICE_NAME,
- FeedsConstants.FEEDS_SERVICE_NAME})
+ at Depends({Constants.SHOTOKU_SERVICE_NAME, FeedsConstants.FEEDS_SERVICE_NAME})
public class CommentsServiceImpl extends AdministratedServiceImpl
implements CommentsService, CommentsServiceLocal {
private static final Logger log = Logger.getLogger(AdministratedService.class);
Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/FeedParsing.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/FeedParsing.java 2007-01-20 22:42:16 UTC (rev 8944)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/FeedParsing.java 2007-01-20 23:21:29 UTC (rev 8945)
@@ -7,8 +7,7 @@
import java.io.InputStream;
import java.io.IOException;
-import java.util.List;
-import java.util.ArrayList;
+import java.util.*;
import com.sun.syndication.io.SyndFeedInput;
import com.sun.syndication.io.XmlReader;
@@ -25,6 +24,18 @@
* @author Adam Warski (adamw at aster.pl)
*/
public class FeedParsing {
+ private final static Comparator<FeedEntry> feedEntryComparator =
+ new Comparator<FeedEntry>() {
+ public int compare(FeedEntry o1, FeedEntry o2) {
+ Date date1 = o1.getCreated();
+ Date date2 = o2.getCreated();
+ if ((date1 == null) && (date2 == null)) return 0;
+ if (date1 == null) return 1;
+ if (date2 == null) return -1;
+ return date2.compareTo(date1);
+ }
+ };
+
public static FeedEntries parseWithRome(InputStream is)
throws IOException, FeedException {
// Parsing the generated feed.
@@ -56,6 +67,8 @@
entry.getUri(), commentsRss));
}
+ Collections.sort(entries, feedEntryComparator);
+
return new FeedEntries(inFeed.getAuthor(), inFeed.getTitle(),
inFeed.getDescription(), inFeed.getPublishedDate(),
inFeed.getLink(), entries);
@@ -81,6 +94,8 @@
nextItem.getGuid().getLocation(), ""));
}
+ Collections.sort(entries, feedEntryComparator);
+
return new FeedEntries(childChannel.getCreator(),
childChannel.getTitle(), childChannel.getDescription(),
childChannel.getPubDate(),
Modified: labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/ShotokuCommentableFeed.java
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/ShotokuCommentableFeed.java 2007-01-20 22:42:16 UTC (rev 8944)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/data/ShotokuCommentableFeed.java 2007-01-20 23:21:29 UTC (rev 8945)
@@ -2,8 +2,6 @@
import org.jboss.shotoku.NodeList;
import org.jboss.shotoku.Node;
-import org.jboss.shotoku.user.UserNotFoundException;
-import org.jboss.shotoku.tags.tools.UserTools;
import org.jboss.shotoku.feeds.data.model.FeedEntries;
import org.jboss.shotoku.feeds.tools.FeedsTools;
import org.jboss.shotoku.feeds.tools.FeedDefAttributes;
@@ -64,7 +62,8 @@
}
public boolean getUserModerateComments(String username) {
- for (String group : groupsAllowedToModerate) {
+ //TODO
+ /*for (String group : groupsAllowedToModerate) {
try {
if (UserTools.getService().getUser(username).isInGroup(group)) {
return true;
@@ -72,7 +71,7 @@
} catch (UserNotFoundException e) {
return false;
}
- }
+ }*/
return false;
}
Modified: 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 2007-01-20 22:42:16 UTC (rev 8944)
+++ labs/shotoku/trunk/shotoku-feeds/src/java/org/jboss/shotoku/feeds/service/FeedsServiceImpl.java 2007-01-20 23:21:29 UTC (rev 8945)
@@ -14,12 +14,10 @@
import org.jboss.shotoku.service.AdministratedServiceImpl;
import org.jboss.shotoku.service.AdministratedService;
import org.jboss.shotoku.ContentManager;
-import org.jboss.shotoku.user.tools.UserConstants;
import org.jboss.shotoku.tools.Constants;
import org.jboss.shotoku.aop.CacheItem;
import javax.ejb.Local;
-import java.util.concurrent.ConcurrentHashMap;
import java.util.HashMap;
/**
@@ -28,7 +26,7 @@
@Service(objectName = FeedsConstants.FEEDS_SERVICE_NAME)
@Local(FeedsServiceLocal.class)
@Management(FeedsService.class)
- at Depends({UserConstants.USER_SERVICE_NAME, Constants.SHOTOKU_SERVICE_NAME})
+ at Depends(Constants.SHOTOKU_SERVICE_NAME)
public class FeedsServiceImpl extends AdministratedServiceImpl
implements FeedsService, FeedsServiceLocal {
//private static final Logger log = Logger.getLogger(AdministratedService.class);
Deleted: labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/feeds-object.xml
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/feeds-object.xml 2007-01-20 22:42:16 UTC (rev 8944)
+++ labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/feeds-object.xml 2007-01-20 23:21:29 UTC (rev 8945)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<deployments>
- <deployment>
- <if-exists>overwrite</if-exists>
- <parent-ref>default</parent-ref>
- <page>
- <page-name>feedsview</page-name>
- <window>
- <window-name>FeedsViewPortletWindow</window-name>
- <instance-ref>FeedsViewPortletInstance</instance-ref>
- <region>center</region>
- <height>0</height>
- </window>
- </page>
- </deployment>
-</deployments>
Deleted: labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/portlet-instances.xml
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/portlet-instances.xml 2007-01-20 22:42:16 UTC (rev 8944)
+++ labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/portlet-instances.xml 2007-01-20 23:21:29 UTC (rev 8945)
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<deployments>
- <deployment>
- <if-exists>overwrite</if-exists>
- <instance>
- <instance-id>FeedsViewPortletInstance</instance-id>
- <portlet-ref>FeedsViewPortlet</portlet-ref>
- </instance>
- </deployment>
-</deployments>
Deleted: labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/portlet.xml
===================================================================
--- labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/portlet.xml 2007-01-20 22:42:16 UTC (rev 8944)
+++ labs/shotoku/trunk/shotoku-feeds/src/web/WEB-INF/portlet.xml 2007-01-20 23:21:29 UTC (rev 8945)
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" version="1.0">
- <portlet>
- <portlet-name>FeedsViewPortlet</portlet-name>
- <portlet-class>org.jboss.shotoku.feeds.portlet.FeedsViewPortlet</portlet-class>
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>VIEW</portlet-mode>
- </supports>
- <supported-locale>en</supported-locale>
- <portlet-info>
- <title>JBoss Feeds View Portlet</title>
- </portlet-info>
- </portlet>
-</portlet-app>
Modified: labs/shotoku/trunk/shotoku-file-access/maven.xml
===================================================================
--- labs/shotoku/trunk/shotoku-file-access/maven.xml 2007-01-20 22:42:16 UTC (rev 8944)
+++ labs/shotoku/trunk/shotoku-file-access/maven.xml 2007-01-20 23:21:29 UTC (rev 8945)
@@ -12,9 +12,10 @@
</goal>
<goal name="deploy">
- <ant:copy
- file="target/shotoku-file-access.war"
- todir="${local.deploy.dir}" />
+ <ant:copy file="target/shotoku-file-access.jar"
+ todir="${shotoku.jar.dest}" />
+ <ant:copy file="target/shotoku-file-access.war"
+ todir="${local.deploy.dir}" />
</goal>
<goal name="clean">
Modified: labs/shotoku/trunk/shotoku-file-access/project.properties
===================================================================
--- labs/shotoku/trunk/shotoku-file-access/project.properties 2007-01-20 22:42:16 UTC (rev 8944)
+++ labs/shotoku/trunk/shotoku-file-access/project.properties 2007-01-20 23:21:29 UTC (rev 8945)
@@ -4,3 +4,6 @@
maven.final.name=${pom.artifactId}
+maven.war.classes.excludes=**/*
+maven.jar.includes=**/*.class
+
Modified: labs/shotoku/trunk/shotoku-file-access/src/java/org/jboss/shotoku/fileaccess/FileAccessServlet.java
===================================================================
--- labs/shotoku/trunk/shotoku-file-access/src/java/org/jboss/shotoku/fileaccess/FileAccessServlet.java 2007-01-20 22:42:16 UTC (rev 8944)
+++ labs/shotoku/trunk/shotoku-file-access/src/java/org/jboss/shotoku/fileaccess/FileAccessServlet.java 2007-01-20 23:21:29 UTC (rev 8945)
@@ -34,10 +34,11 @@
private Pair<String, String> confKey;
@SuppressWarnings({"UNUSED_SYMBOL"})
- @CacheItem
private FileAccessConfigurationWatcher conf;
public void init(ServletConfig conf) {
+ this.conf = new FileAccessConfigurationWatcher();
+
contentManager = ContentManager.getContentManager(
conf.getInitParameter("contentManagerId"),
conf.getInitParameter("contentManagerPrefix"));
Modified: labs/shotoku/trunk/shotoku-jcr/maven.xml
===================================================================
--- labs/shotoku/trunk/shotoku-jcr/maven.xml 2007-01-20 22:42:16 UTC (rev 8944)
+++ labs/shotoku/trunk/shotoku-jcr/maven.xml 2007-01-20 23:21:29 UTC (rev 8945)
@@ -10,22 +10,22 @@
<goal name="deploy">
<ant:copy
- todir="../target/${shotoku.sar.dir}" overwrite="true"
+ todir="${shotoku.jar.dest}" overwrite="true"
file="${maven.repo.local}/concurrent/jars/concurrent-1.3.4.jar" />
<ant:copy
- todir="../target/${shotoku.sar.dir}" overwrite="true"
+ todir="${shotoku.jar.dest}" overwrite="true"
file="${maven.repo.local}/geronimo-spec/jars/geronimo-spec-jta-1.0-M1.jar" />
<ant:copy
- todir="../target/${shotoku.sar.dir}" overwrite="true"
+ todir="${shotoku.jar.dest}" overwrite="true"
file="${maven.repo.local}/lucene/jars/lucene-1.4.3.jar" />
<ant:copy
- todir="../target/${shotoku.sar.dir}" overwrite="true"
+ todir="${shotoku.jar.dest}" overwrite="true"
file="${maven.repo.local}/org.apache.derby/jars/derby-10.1.1.0.jar" />
<ant:copy
- todir="../target/${shotoku.sar.dir}" overwrite="true"
+ todir="${shotoku.jar.dest}" overwrite="true"
file="lib/jcr-1.0.jar" />
<ant:copy
- todir="../target/${shotoku.sar.dir}" overwrite="true"
+ todir="${shotoku.jar.dest}" overwrite="true"
file="lib/jackrabbit.jar" />
<ant:copy
Modified: labs/shotoku/trunk/shotoku-portal/maven.xml
===================================================================
--- labs/shotoku/trunk/shotoku-portal/maven.xml 2007-01-20 22:42:16 UTC (rev 8944)
+++ labs/shotoku/trunk/shotoku-portal/maven.xml 2007-01-20 23:21:29 UTC (rev 8945)
@@ -10,7 +10,7 @@
<goal name="deploy">
<ant:copy
file="target/shotoku-portal.jar"
- tofile="${local.deploy.dir}/jboss-portal.sar/portal-cms.sar/shotoku-portal.jar"
+ tofile="${shotoku.jar.dest}/shotoku-portal.jar"
overwrite="true" />
</goal>
</project>
Modified: labs/shotoku/trunk/shotoku-portal/src/java/org/jboss/shotoku/portal/ShotokuCMS.java
===================================================================
--- labs/shotoku/trunk/shotoku-portal/src/java/org/jboss/shotoku/portal/ShotokuCMS.java 2007-01-20 22:42:16 UTC (rev 8944)
+++ labs/shotoku/trunk/shotoku-portal/src/java/org/jboss/shotoku/portal/ShotokuCMS.java 2007-01-20 23:21:29 UTC (rev 8945)
@@ -21,7 +21,6 @@
*/
package org.jboss.shotoku.portal;
-import org.jboss.portal.common.system.AbstractJBossService;
import org.jboss.portal.cms.CMS;
import org.jboss.portal.cms.Command;
import org.jboss.portal.cms.CommandFactory;
Modified: labs/shotoku/trunk/shotoku-svn/maven.xml
===================================================================
--- labs/shotoku/trunk/shotoku-svn/maven.xml 2007-01-20 22:42:16 UTC (rev 8944)
+++ labs/shotoku/trunk/shotoku-svn/maven.xml 2007-01-20 23:21:29 UTC (rev 8945)
@@ -11,7 +11,7 @@
<goal name="deploy">
<ant:copy
file="lib/javasvn.jar"
- todir="../target/${shotoku.sar.dir}"
+ todir="${shotoku.jar.dest}"
overwrite="true" />
<ant:copy
file="target/shotoku-svn.jar"
Copied: labs/shotoku/trunk/shotoku-test/src/java/org/jboss/shotoku/test/ShotokuDemo.java (from rev 8944, labs/shotoku/trunk-2.6/shotoku-test/src/java/org/jboss/shotoku/test/ShotokuDemo.java)
===================================================================
--- labs/shotoku/trunk/shotoku-test/src/java/org/jboss/shotoku/test/ShotokuDemo.java (rev 0)
+++ labs/shotoku/trunk/shotoku-test/src/java/org/jboss/shotoku/test/ShotokuDemo.java 2007-01-20 23:21:29 UTC (rev 8945)
@@ -0,0 +1,51 @@
+package org.jboss.shotoku.test;
+
+import org.jboss.shotoku.ContentManager;
+import org.jboss.shotoku.Node;
+import org.jboss.shotoku.aop.Inject;
+import org.jboss.shotoku.exceptions.ResourceDoesNotExist;
+
+import static java.lang.System.out;
+
+import java.util.Map;
+
+/**
+ * @author Adam Warski (adamw at aster.pl)
+ */
+public class ShotokuDemo {
+ @Inject
+ private ContentManager cm;
+
+ public void printNode(String pathToNode) {
+ try {
+ Node node = cm.getNode(pathToNode);
+
+ out.println("Content of node" + pathToNode + ": ");
+ out.println(node.getContent());
+
+ Map<String, String> properties = node.getProperties();
+ out.println("Properties of node " + pathToNode + ": ");
+ for (String propName : properties.keySet()) {
+ out.println(propName + " = " + properties.get(propName));
+ }
+ } catch (ResourceDoesNotExist resourceDoesNotExist) {
+ System.out.println("The given node does not exist: " + pathToNode + ".");
+ }
+
+ }
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Modified: labs/shotoku/trunk/shotoku.iml
===================================================================
--- labs/shotoku/trunk/shotoku.iml 2007-01-20 22:42:16 UTC (rev 8944)
+++ labs/shotoku/trunk/shotoku.iml 2007-01-20 23:21:29 UTC (rev 8945)
@@ -5,6 +5,7 @@
<output url="file://$MODULE_DIR$" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+ <excludeFolder url="file://$MODULE_DIR$/shotoku-portal" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
More information about the jboss-svn-commits
mailing list