shuber 2005/07/25 20:12:42 CEST
Modified files:
core maven.xml
core/src/java/org/jahia/services/cluster ClusterMessage.java
JGroupsClusterService.java
core/src/test/src/java/org/jahia/services/cache
AbstractClusterCacheTest.java
TestClusterCacheNode1.java
TestClusterCacheNode2.java
core/src/webapp/WEB-INF/etc/spring
applicationContext-services.xml
Added files:
core/src/test/etc/cluster applicationContext-clustertests.xml
jahia_clusterservicetest.properties
log4j_clusterservicetest.xml
core/src/test/src/java/org/jahia/services/cluster
AbstractClusterServiceTest.java
TestClusterServiceNode1.java
TestClusterServiceNode2.java
Log:
Started implementation of cluster service test units. Not yet functional.
Revision Changes Path
1.35 +14 -12 jahia/core/maven.xml
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/maven.xml.diff?r1=1.34&r2=1.35&f=h
1.2 +16 -3
jahia/core/src/java/org/jahia/services/cluster/ClusterMessage.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/java/org/jahia/services/cluster/ClusterMessage.java.diff?r1=1.1&r2=1.2&f=h
1.3 +1 -12
jahia/core/src/java/org/jahia/services/cluster/JGroupsClusterService.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/java/org/jahia/services/cluster/JGroupsClusterService.java.diff?r1=1.2&r2=1.3&f=h
1.1 +16 -0
jahia/core/src/test/etc/cluster/applicationContext-clustertests.xml (new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/test/etc/cluster/applicationContext-clustertests.xml?rev=1.1&content-type=text/plain
1.1 +410 -0
jahia/core/src/test/etc/cluster/jahia_clusterservicetest.properties (new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/test/etc/cluster/jahia_clusterservicetest.properties?rev=1.1&content-type=text/plain
1.1 +132 -0
jahia/core/src/test/etc/cluster/log4j_clusterservicetest.xml (new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/test/etc/cluster/log4j_clusterservicetest.xml?rev=1.1&content-type=text/plain
1.2 +1 -1
jahia/core/src/test/src/java/org/jahia/services/cache/AbstractClusterCacheTest.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/test/src/java/org/jahia/services/cache/AbstractClusterCacheTest.java.diff?r1=1.1&r2=1.2&f=h
1.2 +1 -1
jahia/core/src/test/src/java/org/jahia/services/cache/TestClusterCacheNode1.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/test/src/java/org/jahia/services/cache/TestClusterCacheNode1.java.diff?r1=1.1&r2=1.2&f=h
1.2 +1 -1
jahia/core/src/test/src/java/org/jahia/services/cache/TestClusterCacheNode2.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/test/src/java/org/jahia/services/cache/TestClusterCacheNode2.java.diff?r1=1.1&r2=1.2&f=h
1.1 +110 -0
jahia/core/src/test/src/java/org/jahia/services/cluster/AbstractClusterServiceTest.java
(new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/test/src/java/org/jahia/services/cluster/AbstractClusterServiceTest.java?rev=1.1&content-type=text/plain
1.1 +20 -0
jahia/core/src/test/src/java/org/jahia/services/cluster/TestClusterServiceNode1.java
(new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/test/src/java/org/jahia/services/cluster/TestClusterServiceNode1.java?rev=1.1&content-type=text/plain
1.1 +20 -0
jahia/core/src/test/src/java/org/jahia/services/cluster/TestClusterServiceNode2.java
(new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/test/src/java/org/jahia/services/cluster/TestClusterServiceNode2.java?rev=1.1&content-type=text/plain
1.6 +6 -0
jahia/core/src/webapp/WEB-INF/etc/spring/applicationContext-services.xml
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/webapp/WEB-INF/etc/spring/applicationContext-services.xml.diff?r1=1.5&r2=1.6&f=h
Index: maven.xml
===================================================================
RCS file: /home/cvs/repository/jahia/core/maven.xml,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- maven.xml 21 Jul 2005 15:07:21 -0000 1.34
+++ maven.xml 25 Jul 2005 18:12:40 -0000 1.35
@@ -190,26 +190,28 @@
<!-- Cluster tests launch goals -->
- <goal name="jahia:testCluster1">
+ <goal name="jahia:testClusterCache1">
<j:set var="maven.junit.usefile" value="false" />
<j:set var="testcase"
value="org.jahia.services.cache.TestClusterCacheNode1" />
<attainGoal name="test:single" />
- <!--
- <java classname="junit.textui.TestRunner" fork="yes">
- <classpath>
- <path refid="maven.dependency.classpath"/>
- <pathelement path="${maven.build.dest}"/>
- <pathelement path="${maven.test.dest}"/>
- </classpath>
- <arg value="org.jahia.services.cache.TestClusterCacheNode1" />
- </java>
- -->
</goal>
- <goal name="jahia:testCluster2">
+ <goal name="jahia:testClusterCache2">
<j:set var="maven.junit.usefile" value="false" />
<j:set var="testcase"
value="org.jahia.services.cache.TestClusterCacheNode2" />
<attainGoal name="test:single" />
</goal>
+ <goal name="jahia:testClusterService1">
+ <j:set var="maven.junit.usefile" value="false" />
+ <j:set var="testcase"
value="org.jahia.services.cluster.TestClusterServiceNode1" />
+ <attainGoal name="test:single" />
+ </goal>
+
+ <goal name="jahia:testClusterService2">
+ <j:set var="maven.junit.usefile" value="false" />
+ <j:set var="testcase"
value="org.jahia.services.cluster.TestClusterServiceNode2" />
+ <attainGoal name="test:single" />
+ </goal>
+
</project>
Index: ClusterMessage.java
===================================================================
RCS file:
/home/cvs/repository/jahia/core/src/java/org/jahia/services/cluster/ClusterMessage.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ClusterMessage.java 21 Jul 2005 15:07:40 -0000 1.1
+++ ClusterMessage.java 25 Jul 2005 18:12:41 -0000 1.2
@@ -8,9 +8,22 @@
* Date: Jul 12, 2005
* Time: 6:30:22 PM
*/
-public interface ClusterMessage {
+public class ClusterMessage {
- Serializable getObject();
- void setObject(Serializable object);
+ protected Serializable object;
+
+ public ClusterMessage() {
+ }
+
+ public ClusterMessage(Serializable object) {
+ this.object = object;
+ }
+
+ Serializable getObject() {
+ return object;
+ }
+ void setObject(Serializable object) {
+ this.object = object;
+ }
}
Index: JGroupsClusterService.java
===================================================================
RCS file:
/home/cvs/repository/jahia/core/src/java/org/jahia/services/cluster/JGroupsClusterService.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- JGroupsClusterService.java 22 Jul 2005 16:54:47 -0000 1.2
+++ JGroupsClusterService.java 25 Jul 2005 18:12:41 -0000 1.3
@@ -36,21 +36,10 @@
private MessageListenerAdapter messageListenerAdapter;
private MembershipListener membershipListener;
- class JGroupsClusterMessage implements ClusterMessage {
-
- Serializable object;
-
+ class JGroupsClusterMessage extends ClusterMessage {
public JGroupsClusterMessage(Message message) {
object = (Serializable) message.getObject();
}
-
- public Serializable getObject() {
- return object;
- }
-
- public void setObject(Serializable object) {
- this.object = object;
- }
}
class JGroupsMessageListener implements MessageListener {
Index: AbstractClusterCacheTest.java
===================================================================
RCS file:
/home/cvs/repository/jahia/core/src/test/src/java/org/jahia/services/cache/AbstractClusterCacheTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AbstractClusterCacheTest.java 21 Jul 2005 15:07:41 -0000 1.1
+++ AbstractClusterCacheTest.java 25 Jul 2005 18:12:41 -0000 1.2
@@ -22,7 +22,7 @@
public abstract class AbstractClusterCacheTest extends TestCase {
private static final org.apache.log4j.Logger logger =
- org.apache.log4j.Logger.getLogger (CacheFactory.class);
+ org.apache.log4j.Logger.getLogger
(AbstractClusterCacheTest.class);
private final static String springRelativePath = "src"+File.separator+
"test"+File.separator+
Index: TestClusterCacheNode1.java
===================================================================
RCS file:
/home/cvs/repository/jahia/core/src/test/src/java/org/jahia/services/cache/TestClusterCacheNode1.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TestClusterCacheNode1.java 21 Jul 2005 15:07:41 -0000 1.1
+++ TestClusterCacheNode1.java 25 Jul 2005 18:12:41 -0000 1.2
@@ -10,7 +10,7 @@
public class TestClusterCacheNode1 extends AbstractClusterCacheTest {
private static final org.apache.log4j.Logger logger =
- org.apache.log4j.Logger.getLogger (CacheFactory.class);
+ org.apache.log4j.Logger.getLogger (TestClusterCacheNode1.class);
public synchronized void testClusterCacheNode1() throws
InterruptedException {
logger.info("Sending first value...");
Index: TestClusterCacheNode2.java
===================================================================
RCS file:
/home/cvs/repository/jahia/core/src/test/src/java/org/jahia/services/cache/TestClusterCacheNode2.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TestClusterCacheNode2.java 21 Jul 2005 15:07:41 -0000 1.1
+++ TestClusterCacheNode2.java 25 Jul 2005 18:12:41 -0000 1.2
@@ -9,7 +9,7 @@
public class TestClusterCacheNode2 extends AbstractClusterCacheTest {
private static final org.apache.log4j.Logger logger =
- org.apache.log4j.Logger.getLogger (CacheFactory.class);
+ org.apache.log4j.Logger.getLogger (TestClusterCacheNode2.class);
public synchronized void testClusterCacheNode2() throws
InterruptedException {
logger.info("Waiting for value from first node...");
Index: applicationContext-services.xml
===================================================================
RCS file:
/home/cvs/repository/jahia/core/src/webapp/WEB-INF/etc/spring/applicationContext-services.xml,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- applicationContext-services.xml 25 Jul 2005 12:08:40 -0000 1.5
+++ applicationContext-services.xml 25 Jul 2005 18:12:41 -0000 1.6
@@ -461,6 +461,12 @@
<bean id="ClusterService" parent="txProxyTemplate">
<property name="target">
<bean class="org.jahia.services.cluster.JGroupsClusterService">
+ <property name="channelGroupName">
+ <value>JahiaCluster</value>
+ </property>
+ <property name="channelProperties">
+
<value>UDP:PING:FD:STABLE:NAKACK:UNICAST:FRAG:FLUSH:GMS:VIEW_ENFORCER:STATE_TRANSFER:QUEUE</value>
+ </property>
</bean>
</property>
</bean>
Index: applicationContext-clustertests.xml
====================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="org.jahia.services.cluster.ClusterService"
class="org.jahia.services.cluster.JGroupsClusterService">
<property name="channelGroupName">
<value>JahiaCluster</value>
</property>
<property name="channelProperties">
<value>UDP:PING:FD:STABLE:NAKACK:UNICAST:FRAG:FLUSH:GMS:VIEW_ENFORCER:STATE_TRANSFER:QUEUE</value>
</property>
</bean>
</beans>
Index: jahia_clusterservicetest.properties
====================================================================
### Server ##########################
release =
server =
serverHomeDiskPath =
### Disk Paths ######################
jahiaJspDiskPath = /jsp/jahia/
jahiaEnginesDiskPath = /jsp/jahia/engines/
jahiaTemplatesDiskPath =
/jsp/jahia/templates/
jahiaHtmlEditorsDiskPath =
/jsp/jahia/htmleditors/
jahiaJavaScriptDiskPath =
/jsp/jahia/javascript/
jahiaFilesDiskPath = $context/WEB-INF
jahiaEtcDiskPath =
jahiaVarDiskPath =
jahiaFilesBigTextDiskPath =
slideContentDiskPath =
$context/WEB-INF/var/content/slide/
tmpContentDiskPath =
$context/WEB-INF/var/content/tmp/
jahiaFilesTemplatesDiskPath =
jahiaNewTemplatesDiskPath =
jahiaNewWebAppsDiskPath =
jahiaSharedTemplatesDiskPath =
jahiaSharedComponentsDiskPath =
jahiaLdapDiskPath =
$context/WEB-INF/etc/ldap/
jahiaCasDiskPath =
$context/WEB-INF/etc/cas/
jahiaOutputCacheConfigDiskPath =
$context/WEB-INF/etc/outputcache/
classDiskPath = /WEB-INF/classes/
componentsDiskPath =
/WEB-INF/classes/components/
### URL's ###########################
jahiaHostHttpPath =
jahiaCoreHttpPath =
jahiaTemplatesHttpPath =
jahiaEnginesHttpPath =
jahiaJavaScriptHttpPath =
jahiaWebAppsDeployerBaseURL =
siteIDInURL = false
### Mail Service Configuration #######
mail_server =
mail_administrator =
mail_from =
mail_paranoia =
### Database ########################
db_script = hypersonic.script
db_driver =
org.hsqldb.jdbcDriver
db_url =
jdbc\:hsqldb\:hsql\://localhost
db_username = sa
db_password =
db_transactions = false
db_support_embedded_select_statement = true
db_starthsqlserver = true
# The settings below are no longer used, please use the dbpool.properties
# file to configure the connection pool.
db_min_connections = 10
db_max_connections = 50
db_waitIfBusy = true
db_verbose = false
db_veryVerbose = false
### Datasource ########################
# this parameter will allow Jahia to seek for a Datasource defined
# in the appserver context before using direct connection pooling.
# leave it blank to use standard Jahia behavior
datasource.name =
### Characters encoding ##############
# Global encoding parameter, used to encode content to/from the database
utf8Encoding = true
# You may need to change the following values depending on the servlet
# container you are using. The default values here are designed to work
# with Tomcat.
#
# Default encoding for the output generated by Jahia :
defaultResponseBodyEncoding = UTF-8
# Default encoding for URI and URLs send to Jahia :
defaultURIEncoding = UTF-8
### Locks verification ###############
# Must be leave to true. If you want to deactivate locks,
# Make the LockService using DummyLockService
locksActivated = true
fileLockOnPublication = false
### Cache settings ###################
#
# By default cache have no limits. If you want to set a size
# limit for a cache, use the following syntax :
#
# max_cached_CACHENAME = LIMIT
#
# where CACHENAME is the name of the cache that corresponds
# to the "Server and Cache Status" name in parenthesis, and
# LIMIT is a number that corresponds to the max number of
# entries we want to allow in the cache.
#
# Here below we present some example, but note that these are not
# the complete number of caches in Jahia.
#
# For the meantime there are some caches you should leave unlimited,
# such as the ACL caches, otherwise Jahia will not behave properly
# (it assumes the whole content of the DB table is in memory).
#
#max_cached_ContentFieldCache = 20000
#max_cached_FieldCache = 20000
#max_cached_PageChildCache = 10000
#max_cached_ContainerCache = 2000
#max_cached_TextFileCache = 1000
#max_cached_PageInfoCache = 10000
#max_cached_LDAPGroupsCache = 165
#max_cached_LDAPUsersCache = 20000
#max_cached_PortletsOutputCache = 10000
#max_cached_PortletsRequestCache = 10000
#
# Usually the only cache we recommend that you limit is the output (HTML)
# cache, which can be configured like this :
#
#max_cached_HTMLCache = 2000
### Output cache #####################
# The output (HTML) cache may also be controlled in more detail with the
# following parameters.
outputCacheActivated = true
# the following value is in milliseconds, set to -1 for no time expiration
outputCacheDefaultExpirationDelay = -1
### JMS Cache Settings ###############
org.jahia.cache.jmsCacheActivated = true
org.jahia.cache.jmsCacheInitialContextFactory =
org.exolab.jms.jndi.InitialContextFactory
org.jahia.cache.jmsCacheContextProviderURL =
rmi://localhost:1099/
org.jahia.cache.jmsCacheTopicConnectionFactoryName =
JmsTopicConnectionFactory
org.jahia.cache.jmsCacheTopicName = jahiaCache
org.jahia.cache.jmsCacheMaxMessagesInPackage = 2000
org.jahia.cache.jmsServerLookupSleepTime = 10000
### JMX Settings #####################
org.jahia.jmx.activated = false
org.jahia.jmx.httpAdaptorActivated = false
org.jahia.jmx.xslProcessorActivated = false
org.jahia.jmx.rmiAdaptorActivated = false
org.jahia.jmx.httpHostName = localhost
org.jahia.jmx.httpPort = 8082
org.jahia.jmx.httpAuthorizationMode = basic
org.jahia.jmx.httpAuthorizationUser = jmx
org.jahia.jmx.httpAuthorizationPassword = jahiajmx
org.jahia.jmx.httpProcessorNameString =
Server:name=XSLTProcessor
# org.jahia.jmx.httpSocketFactoryNameString =
org.jahia.jmx.rmiSSLServerSocketFactoryActivated = false
org.jahia.jmx.rmiSSLServerSocketFactoryKeyStoreName =
org.jahia.jmx.rmiSSLServerSocketFactoryKeyStorePassword =
org.jahia.jmx.rmiSSLServerSocketFactoryKeyManagerPassword =
### Template set #####################
default_templates_set =
corporate_portal_templates
### Filemanager #####################
jahiaFileRepositoryDiskPath =
jahiaFileUploadMaxSize = 50485760
### Templates Observer ##############
jahiaTemplatesAutoDeploy = 1
# Time in milliseconds between checks in the new_templates directory for new
# templates to deploy. Set to -1 to deactivate file watching completely.
templates.observer.interval = 5000
templates.observer.checkmode = ALL
### WebApps Observer ################
jahiaWebAppsAutoDeploy = 1
# Time in milliseconds between checks in the new_webapps directory for new
# webapps to deploy. Set to -1 to deactivate file watching completely.
webapps.observer.interval = 5000
webapps.observer.checkmode = ALL
### WebApps Dispatcher ##############
webapps.dispatcher.inheritJahiaSessionAttributes = false
### Audit log #######################
jahiaMaxLogs = 500
### Multilingual support ###########
org.jahia.multilang.default_language_code = en
### ACLs ###########################
org.jahia.acl.preload_count = 10000
### Page properties ##################
org.jahia.pages.properties.preload_count = 2000
### Tidy Configuration file ##########
# this file must be located in <jahia>/web-inf/etc/config dir.
tidyConfig = tidy.properties
### WebDAV processing options ########
# Specifies whether we should transform file names because of compatibility
# problems with Windows WebDAV implementation.
transformFilenames = false
# Same option for directories, set to true by default because there are
# serious bugs in Windows' WebDAV implementation when using non ISO-8859-1
# characters.
transformDirnames = true
### Jetspeed Portal ###########################
jetspeedConfig =
WEB-INF/etc/jetspeed/conf/jetspeed.properties
jetspeedDeploymentDirectory =
$context/WEB-INF/etc/jetspeed/deploy
### Authentification pipeline ###################
#
# Jahia now uses a pipeline mechanism to process user authentification, which
# allows developers to extend the system for custom authentification
back-ends.
#
# You might want to modify the pipeline if you want to extend Jahia's
# authentification system, for example by adding a JAASAuthValve or something
# else.
#
# Name of the file containing the valve configuration for the authentification
# pipeline
authPipelineFileName =
/WEB-INF/etc/config/auth-pipeline.xml
# Class name for the pipeline implementation to use when creating the
# authorization pipeline.
authPipelineClassName =
org.jahia.pipelines.impl.GenericPipeline
### Process pipeline ###########################
#
# Jahia now uses a pipeline mechanism to process requests, which
# allows developers to extend the system for custom processing.
#
# You might want to modify the pipeline if you want to extend Jahia's
# processing system
#
# Name of the file containing the valve configuration for the processing
# pipeline
processPipelineFileName =
/WEB-INF/etc/config/process-pipeline.xml
# Class name for the pipeline implementation to use when creating the
# request processing pipeline.
processPipelineClassName =
org.jahia.pipelines.impl.GenericPipeline
### Cookie authentification valve config ########
#
# The cookie authentification valve is a system that uses cookies to store
# an identifier corresponding to a specific Jahia user, when he selects the
# "remember me" option in the login engine.
#
# Should we use cookie authentification for login ?
cookieAuthActivated = true
#
# length of cookie identifier key for user. This is the actual value
# stored in the cookie, so make sure it is long enough to improve security.
cookieAuthIDLength = 40
# name of user property under which we store the cookie identifier key in
# Jahia's database, for matching with the value coming from the cookie.
cookieAuthUserPropertyName =
org.jahia.user.cookieauth.id
# cookie name. It is a good idea to keep this name a bit cryptic so that
# even if someone steals the cookie he doesn't necessarily understand it.
cookieAuthCookieName = jid
# age of cookie in seconds. So basically a value of 2592000 is 30 days
# expiration, which means that if the user doesn't come back to the site
during
# 30 days he will then have to login again. The way the cookie is renewed
# depends how the cookieAuthRenewalActivated setting is set.
cookieAuthMaxAgeInSeconds = 2592000
# Cookie renewal means that if a user is recognized using a cookie, the age in
# seconds will be reset. So it means that every time the user comes in and is
# recognized using a cookie, the cookie age will be reset to the value defined
# in cookieAuthMaxAgeInSeconds. If this setting is false, cookies will not be
# renewed, and after the cookie expires the user will have to login again.
# For a more natural behavior, it is best to set this setting to true and
leave
# the age in seconds to a value in days.
cookieAuthRenewalActivated = true
### Scheduler config ################
# Path to scheduler configuration
schedulerConfigFile =
$context/WEB-INF/etc/config/quartz.properties
### Site serverName testing config ###
# The following configuration parameters mostly concern the generation of the
# "Exit Administration" button in the administration console. The URL that is
# generated to go back to a site needs to be tested first, in order to
# determine if we should generate an URL using the site's serverName or if
# we should generate an URL using the current host name used for accessing the
# administration servlet.
#
# For example, if for a site we have :
# serverName="this.is.an.invalid.hostname",
# serverKey="myTestSite"
# the following parameters will determine the URL that will be tested. So
# if we have the default, Jahia will try to connect to :
# http://this.is.an.invalid.hostname:8080/jahia/jsp/isjahia.jsp
# and use the connection timeout that we specify. If the connection fails,
# the URL generated will be :
# http://localhost:8080/jahia/Jahia/site/myTestSite
# The localhost:8080 part may be different if this is not what we are using
# when connecting to the administration servlet. If we are connected to the
# administration servlet with :
# http://127.0.0.1:7070/cms/administration
# then the fallback URL for the "Exit Administration" would be :
# http://127.0.0.1:7070/cms/Jahia/site/myTestSite
#
# The siteServerNameTestURLExpr can access the following variables :
# "request" - an HttpServletRequest object
# "siteServerName" - a String that contains the siteServerName we want to
# test.
# Expressions always start with "${" and end with "}". The expression
# language supported is JEXL. You can find more information about JEXL
# here : http://jakarta.apache.org/commons/jexl/
# Note : you can also change the name/location of the isjahia.jsp file. The
# only thing this resource must do is set a header called "jahia-version" that
# must be present for the siteServerName to be properly identified as a Jahia
# server.
siteServerNameTestURLExpr =
${request.scheme}://${siteServerName}:${request.serverPort}${request.contextPath}/jsp/isjahia.jsp
# The following parameter allows for configuration of the connection timeout
# when testing with the above URL. Don't set this too high as the connection
# will be attempted everytime an "Exit Administration" button is generated.
# The timeout value is in milliseconds.
siteServerNameTestConnectTimeout = 500
### Jahia Services ##################
# You should never need to change these unless you are doing some
customizations
# to Jahia and want to replace a default service implementation.
JahiaIncrementorsDBService =
org.jahia.services.database.JahiaIncrementorsDBBaseService
JahiaFileTransferService =
org.jahia.services.files.JahiaFileTransferBaseService
JahiaTextFileService =
org.jahia.services.files.JahiaTextFileBaseService
# Comment previous line and uncomment next one to save big text in database
instead of file system
# JahiaTextFileService =
org.jahia.services.files.JahiaTextFileDBBaseService
JahiaPageService =
org.jahia.services.pages.JahiaPageBaseService
JahiaTreeViewService =
org.jahia.services.pages.JahiaTreeViewService
JahiaPageTemplateService =
org.jahia.services.pages.JahiaPageTemplateBaseService
JahiaFieldService =
org.jahia.services.fields.JahiaFieldBaseService
JahiaFieldsDBService =
org.jahia.services.fields.JahiaFieldsDBBaseService
JahiaNavService =
org.jahia.services.nav.JahiaNavBaseService
JahiaNavBeanFactoryService =
org.jahia.services.nav.JahiaNavBeanFactoryBaseService
DispatchingService =
org.jahia.services.applications.DispatchingServiceImpl
ApplicationsManagerService =
org.jahia.services.applications.ApplicationsManagerServiceImpl
JahiaApplicationContextService =
org.jahia.services.applications.JahiaApplicationContextBaseService
JahiaContainersService =
org.jahia.services.containers.JahiaContainersBaseService
JahiaContainersDBService =
org.jahia.services.containers.JahiaContainersDBBaseService
JahiaSearchService =
org.jahia.services.search.JahiaSearchBaseService
JahiaFilemanagerService =
org.jahia.services.filemanager.JahiaFilemanagerBaseService
JahiaUserManagerService =
org.jahia.services.usermanager.JahiaUserManagerRoutingService
JahiaGroupManagerService =
org.jahia.services.usermanager.JahiaGroupManagerRoutingService
JahiaACLManagerService =
org.jahia.services.acl.JahiaACLManagerService
JahiaFetcherService =
org.jahia.services.fetchers.JahiaFetcherBaseService
JahiaTemplatesDeployerService =
org.jahia.services.templates_deployer.JahiaTemplatesDeployerBaseService
JahiaWebAppsDeployerService =
JahiaFileWatcherService =
org.jahia.services.deamons.filewatcher.JahiaFileWatcherBaseService
JahiaEventService =
org.jahia.services.events.JahiaEventGeneratorBaseService
JahiaAuditLogManagerService =
org.jahia.services.audit.JahiaDBAuditLogManagerService
JahiaSitesService =
org.jahia.services.sites.JahiaSitesSlideService
JahiaSiteUserManagerService =
org.jahia.services.usermanager.JahiaSiteUserManagerDBService
JahiaSiteGroupManagerService =
org.jahia.services.usermanager.JahiaSiteGroupManagerDBService
AppsShareService =
org.jahia.services.shares.AppsShareBaseService
JahiaHomepagesService =
org.jahia.services.homepages.JahiaHomepagesBaseService
JahiaVersionService =
org.jahia.services.version.JahiaVersionDBService
JahiaCacheService =
org.jahia.services.cache.CacheFactory
JahiaSiteMapService =
org.jahia.services.sitemap.JahiaSiteMapService
JahiaHtmlEditorsService =
org.jahia.services.htmleditors.HtmlEditorsBaseService
JahiaResourceBundleService =
org.jahia.resourcebundle.ResourceBundleBaseService
MailService =
org.jahia.services.mail.MailService
LockService =
org.jahia.services.lock.LockRegistry
#LockService =
org.jahia.services.lock.DummyLockRegistry
CategoryService =
org.jahia.services.categories.CategoryServiceImpl
HtmlParserService =
org.jahia.services.htmlparser.HtmlParserBaseService
URLRewritingService =
org.jahia.services.urlrewriting.URLRewritingService
WorkflowService =
org.jahia.services.workflow.WorkflowService
MetadataService =
org.jahia.services.metadata.MetadataBaseService
SchedulerService =
org.jahia.services.scheduler.SchedulerServiceImpl
JCRStoreService =
org.jahia.services.content.JCRStoreService
FileExtractionService =
org.jahia.services.fileextraction.JahiaFileExtractionServiceImpl
CasService =
org.jahia.services.sso.CasService
### Added settings ##################
defautSite=myjahiasite
Index: log4j_clusterservicetest.xml
====================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<!--
<appender name="Chainsaw" class="org.apache.log4j.net.SocketAppender">
<param name="RemoteHost" value="localhost"/>
<param name="Port" value="4445"/>
<param name="LocationInfo" value="true"/>
</appender>
-->
<appender name="ROLL" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="jahia.log"></param>
<param name="MaxFileSize" value="1MB"></param>
<param name="MaxBackupIndex" value="2"></param>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{ISO8601}: [%t] %C{1},
%p, %c: %m%n"></param>
</layout>
</appender>
<appender name="Console" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{ISO8601}: %p:
%m%n"></param>
</layout>
</appender>
<appender name="jetspeed" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern"
value="%6r [%t] %5p %c.%M:%L - %m%n"/>
</layout>
</appender>
<logger name="REQUEST">
<appender-ref ref="ROLL"></appender-ref>
</logger>
<logger name="SysOut">
<appender-ref ref="Console"></appender-ref>
</logger>
<category name="org.apache.jetspeed">
<priority value="info"/>
<appender-ref ref="jetspeed"/>
</category>
<!--
<category name="org.apache.log4j.xml">
<priority value="debug"/>
<appender-ref ref="Chainsaw"/>
</category>
-->
<!--
Uncomment the following if you need to filter on categories,
such as class packages
-->
<!--
<category name="org.jahia.utils.JahiaConsole">
<priority value="info"/>
</category>
-->
<category name="org.jahia.services.cluster">
<priority value="debug"/>
</category>
<category name="org.apache.slide">
<priority value="info"/>
</category>
<category name="org.jahia.services.applications">
<priority value="info"/>
</category>
<category name="org.apache.axis">
<priority value="info"/>
</category>
<category name="org.apache.commons">
<priority value="info"/>
</category>
<category name="org.apache.commons.httpclient">
<priority value="error"/>
</category>
<category name="org.apache.jsp">
<priority value="info"/>
</category>
<category name="org.apache.jasper">
<priority value="info"/>
</category>
<category name="org.pdfbox">
<priority value="error"/>
</category>
<category name="org.springframework">
<priority value="info"/>
</category>
<category name="org.jahia.blogs">
<priority value="debug"/>
</category>
<category name="org.hibernate">
<priority value="warn"/>
</category>
<category name="net.sf.ehcache">
<priority value="warn"/>
</category>
<category name="org.jahia.hibernate">
<priority value="error"/>
</category>
<root>
<level value ="info"></level>
<appender-ref ref="ROLL"></appender-ref>
<appender-ref ref="Console"></appender-ref>
</root>
</log4j:configuration>
Index: AbstractClusterServiceTest.java
====================================================================
package org.jahia.services.cluster;
import junit.framework.TestCase;
import org.jahia.utils.PathResolver;
import org.jahia.utils.FilePathResolver;
import org.jahia.settings.SettingsBean;
import org.jahia.bin.JahiaInterface;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.apache.log4j.xml.DOMConfigurator;
import java.io.File;
import java.io.Serializable;
/**
* User: Serge Huber
* Date: Jul 25, 2005
* Time: 7:40:57 PM
* Copyright (C) Jahia Inc.
*/
public abstract class AbstractClusterServiceTest extends TestCase implements
ClusterListener {
private static final org.apache.log4j.Logger logger =
org.apache.log4j.Logger.getLogger
(AbstractClusterServiceTest.class);
private final static String springRelativePath = "src"+File.separator+
"test"+File.separator+
"etc"+File.separator+
"cluster";
protected ApplicationContext context;
protected ClusterService clusterService;
protected long wakeupTime = 2000;
protected long shutdownTime = 2000;
protected Serializable value = null;
private static final String PROP_FILE = "src"+File.separator+
"test"+File.separator+
"etc"+File.separator+
"cluster" + File.separator +
"jahia_clusterservicetest.properties";
private static final String LOG4J_FILE = "src"+File.separator+
"test"+File.separator+
"etc"+File.separator+
"cluster" + File.separator +
"log4j_clusterservicetest.xml";
protected synchronized void setUp() throws Exception {
super.setUp();
DOMConfigurator.configureAndWatch(LOG4J_FILE);
PathResolver pathResolver = new FilePathResolver();
File jahiaCacheProperties = new File(PROP_FILE);
logger.info("Loading Jahia configuration from " +
jahiaCacheProperties.getAbsoluteFile().toString());
SettingsBean settingsBean = new SettingsBean(pathResolver,
jahiaCacheProperties.getAbsoluteFile().toString(), "",
JahiaInterface.BUILD_NUMBER);
settingsBean.load();
try {
final String springPath =
pathResolver.resolvePath(springRelativePath);
String[] paths = {"file:" + springPath + File.separator +
"applicationContext-*.xml"};
context = new FileSystemXmlApplicationContext(paths);
} catch (Throwable e) {
logger.error("Cannot load spring initialisation file ",e);
String[] paths = {"spring/applicationContext*.xml"};
context = new ClassPathXmlApplicationContext(paths);
}
clusterService = (ClusterService)
context.getBean(ClusterService.class.getName());
clusterService.init(settingsBean);
logger.info("Waiting for wake-up of all nodes...");
wait(wakeupTime); // give some time for other node to wake-up
}
protected synchronized void tearDown() throws Exception {
super.tearDown();
clusterService.shutdown();
logger.info("Waiting for shutdown of all nodes...");
wait(shutdownTime); // give some time for other node to finish
processing.
}
protected synchronized Serializable waitForValue(int maxLoops, long
checkInterval) throws InterruptedException {
value = null;
int loops = 0;
while (value == null) {
wait(checkInterval);
loops++;
if (loops == maxLoops) {
return null;
}
}
return value;
}
public void messageReceived(ClusterMessage message) {
synchronized (value) {
value = message.getObject();
}
}
public void sendMessage(String message) {
ClusterMessage clusterMessage = new ClusterMessage(message);
clusterService.sendMessage(clusterMessage);
}
}
Index: TestClusterServiceNode1.java
====================================================================
package org.jahia.services.cluster;
/**
* User: Serge Huber
* Date: Jul 25, 2005
* Time: 7:54:19 PM
* Copyright (C) Jahia Inc.
*/
public class TestClusterServiceNode1 extends AbstractClusterServiceTest {
private static final org.apache.log4j.Logger logger =
org.apache.log4j.Logger.getLogger (TestClusterServiceNode1.class);
public void testClusterServiceNode1() throws InterruptedException {
logger.debug("Sending first value...");
sendMessage("value1");
logger.debug("Waiting for value...");
logger.debug("Received value: " + waitForValue(50, 100000));
}
}
Index: TestClusterServiceNode2.java
====================================================================
package org.jahia.services.cluster;
/**
* User: Serge Huber
* Date: Jul 25, 2005
* Time: 7:55:20 PM
* Copyright (C) Jahia Inc.
*/
public class TestClusterServiceNode2 extends AbstractClusterServiceTest {
private static final org.apache.log4j.Logger logger =
org.apache.log4j.Logger.getLogger (TestClusterServiceNode2.class);
public void testClusterServiceNode2 () throws InterruptedException {
logger.debug("Waiting for value...");
logger.debug("Received value: " + waitForValue(50, 100000));
logger.debug("Sending value...");
sendMessage("value2");
}
}