JBoss Native SVN: r1901 - trunk/mod_cluster/test/java.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-09-25 02:43:12 -0400 (Thu, 25 Sep 2008)
New Revision: 1901
Modified:
trunk/mod_cluster/test/java/build.properties.default
Log:
Arrange jar name.
Modified: trunk/mod_cluster/test/java/build.properties.default
===================================================================
--- trunk/mod_cluster/test/java/build.properties.default 2008-09-24 19:15:52 UTC (rev 1900)
+++ trunk/mod_cluster/test/java/build.properties.default 2008-09-25 06:43:12 UTC (rev 1901)
@@ -39,4 +39,4 @@
jboss-ejb-api.jar.loc=${base-jboss.loc}/jboss-ejb-api/${jboss-ejb-api.version}/jboss-ejb-api-${jboss-ejb-api.version}.jar
jboss-ejb-api.jar=${base.path}/${jboss-ejb-api.version}/jboss-ejb-api-spi-${jboss-ejb-api.version}.jar
-mod_cluster.jar=../../target/mod_cluster-1.0.0-SNAPSHOT.jar
+mod_cluster.jar=../../target/mod-cluster-1.0.0-SNAPSHOT.jar
16 years, 3 months
JBoss Native SVN: r1900 - trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl.
by jbossnative-commits@lists.jboss.org
Author: pferraro
Date: 2008-09-24 15:15:52 -0400 (Wed, 24 Sep 2008)
New Revision: 1900
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java
Log:
Socket, Reader, and Writer must be volatile.
Modified: trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java
===================================================================
--- trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java 2008-09-24 19:04:09 UTC (rev 1899)
+++ trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java 2008-09-24 19:15:52 UTC (rev 1900)
@@ -834,11 +834,11 @@
private volatile boolean ioExceptionLogged;
@GuardedBy("Proxy.this")
- private Socket socket = null;
+ private volatile Socket socket = null;
@GuardedBy("Proxy.this")
- private BufferedReader reader = null;
+ private volatile BufferedReader reader = null;
@GuardedBy("Proxy.this")
- private BufferedWriter writer = null;
+ private volatile BufferedWriter writer = null;
Proxy(InetAddress address, int port, SocketFactory socketFactory, MCMPHandlerConfiguration config)
{
16 years, 3 months
JBoss Native SVN: r1899 - trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl.
by jbossnative-commits@lists.jboss.org
Author: pferraro
Date: 2008-09-24 15:04:09 -0400 (Wed, 24 Sep 2008)
New Revision: 1899
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java
Log:
getLocalAddress() should return local address of socket.
Do not expose socket from Proxy.
Modified: trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java
===================================================================
--- trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java 2008-09-24 17:30:20 UTC (rev 1898)
+++ trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java 2008-09-24 19:04:09 UTC (rev 1899)
@@ -386,7 +386,7 @@
{
try
{
- return proxy.getConnection().getInetAddress();
+ return proxy.getLocalAddress();
}
catch (IOException e)
{
@@ -932,11 +932,16 @@
{
this.established = established;
}
-
+
+ InetAddress getLocalAddress() throws IOException
+ {
+ return this.getConnection().getLocalAddress();
+ }
+
/**
* Return a reader to the proxy.
*/
- synchronized Socket getConnection() throws IOException
+ private synchronized Socket getConnection() throws IOException
{
if ((this.socket == null) || this.socket.isClosed())
{
16 years, 3 months
JBoss Native SVN: r1898 - trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl.
by jbossnative-commits@lists.jboss.org
Author: pferraro
Date: 2008-09-24 13:30:20 -0400 (Wed, 24 Sep 2008)
New Revision: 1898
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java
Log:
Add explicit closing of input/output socket stream.
Cache socket reader/writer until closed.
Modified: trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java
===================================================================
--- trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java 2008-09-24 15:28:12 UTC (rev 1897)
+++ trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java 2008-09-24 17:30:20 UTC (rev 1898)
@@ -372,6 +372,7 @@
}
return result.toString();
}
+
public InetAddress getLocalAddress() throws IOException
{
IOException firstException = null;
@@ -834,6 +835,10 @@
@GuardedBy("Proxy.this")
private Socket socket = null;
+ @GuardedBy("Proxy.this")
+ private BufferedReader reader = null;
+ @GuardedBy("Proxy.this")
+ private BufferedWriter writer = null;
Proxy(InetAddress address, int port, SocketFactory socketFactory, MCMPHandlerConfiguration config)
{
@@ -944,17 +949,25 @@
/**
* Convenience method that returns a reader to the proxy.
*/
- BufferedReader getConnectionReader() throws IOException
+ synchronized BufferedReader getConnectionReader() throws IOException
{
- return new BufferedReader(new InputStreamReader(this.getConnection().getInputStream()));
+ if (this.reader == null)
+ {
+ this.reader = new BufferedReader(new InputStreamReader(this.getConnection().getInputStream()));
+ }
+ return this.reader;
}
/**
* Convenience method that returns a writer to the proxy.
*/
- BufferedWriter getConnectionWriter() throws IOException
+ synchronized BufferedWriter getConnectionWriter() throws IOException
{
- return new BufferedWriter(new OutputStreamWriter(this.getConnection().getOutputStream()));
+ if (this.writer == null)
+ {
+ this.writer = new BufferedWriter(new OutputStreamWriter(this.getConnection().getOutputStream()));
+ }
+ return this.writer;
}
/**
@@ -962,16 +975,43 @@
*/
synchronized void closeConnection()
{
- if ((this.socket != null) && !this.socket.isClosed())
+ if (this.reader != null)
{
try
{
- this.socket.close();
+ this.reader.close();
}
catch (IOException e)
{
// Ignore
}
+ this.reader = null;
+ }
+ if (this.writer != null)
+ {
+ try
+ {
+ this.writer.close();
+ }
+ catch (IOException e)
+ {
+ // Ignore
+ }
+ this.writer = null;
+ }
+ if (this.socket != null)
+ {
+ if (!this.socket.isClosed())
+ {
+ try
+ {
+ this.socket.close();
+ }
+ catch (IOException e)
+ {
+ // Ignore
+ }
+ }
this.socket = null;
}
}
@@ -986,7 +1026,7 @@
this.ioExceptionLogged = ioErrorLogged;
}
}
-
+
@Immutable
private static class MCMPServerStateImpl implements MCMPServerState, Serializable
{
16 years, 3 months
JBoss Native SVN: r1897 - trunk/mod_cluster.
by jbossnative-commits@lists.jboss.org
Author: pferraro
Date: 2008-09-24 11:28:12 -0400 (Wed, 24 Sep 2008)
New Revision: 1897
Modified:
trunk/mod_cluster/pom.xml
Log:
Comment out run-demo target
Modified: trunk/mod_cluster/pom.xml
===================================================================
--- trunk/mod_cluster/pom.xml 2008-09-24 03:40:24 UTC (rev 1896)
+++ trunk/mod_cluster/pom.xml 2008-09-24 15:28:12 UTC (rev 1897)
@@ -320,7 +320,7 @@
<ant antfile="build-demo.xml" target="main" />
<!-- Execute the demo that require httpd -->
- <ant antfile="build-demo.xml" target="run-demo" />
+ <!--ant antfile="build-demo.xml" target="run-demo" /-->
</tasks>
</configuration>
16 years, 3 months
JBoss Native SVN: r1896 - trunk/mod_cluster.
by jbossnative-commits@lists.jboss.org
Author: pferraro
Date: 2008-09-23 23:40:24 -0400 (Tue, 23 Sep 2008)
New Revision: 1896
Modified:
trunk/mod_cluster/build-demo.xml
Log:
Fixed demo compile.
Now only demo launch does not work.
Modified: trunk/mod_cluster/build-demo.xml
===================================================================
--- trunk/mod_cluster/build-demo.xml 2008-09-24 01:37:12 UTC (rev 1895)
+++ trunk/mod_cluster/build-demo.xml 2008-09-24 03:40:24 UTC (rev 1896)
@@ -27,9 +27,9 @@
<property name="demo.dependencies.lib" location="${module.output}/dependencies/lib"></property>
<path id="demo">
- <pathelement location="${demo.dependencies.lib}/*.jar"/>
+ <fileset dir="${demo.dependencies.lib}" includes="*.jar"/>
</path>
-
+
<target name="main" depends="init, compile-demo">
<jar destfile="${demo.output.client}/${demo.client.jar}">
<fileset dir="${demo.output.classes}" excludes="**/server/**"></fileset>
@@ -48,13 +48,14 @@
<target name="init">
<mkdir dir="${demo.output}"/>
+ <mkdir dir="${demo.output.classes}"></mkdir>
<mkdir dir="${demo.output.client}"/>
<mkdir dir="${demo.output.server}"/>
</target>
<target name="compile-demo">
- <!-- Why doesn't this work? -->
- <!--javac target="${demo.output.classes}" srcdir="${demo.src.java}" classpathref="demo"/-->
+ <!-- Why doesn't this work without fork? -->
+ <javac destdir="${demo.output.classes}" srcdir="${demo.src.java}" classpathref="demo" fork="true"></javac>
</target>
<target name="run-demo" depends="main">
16 years, 3 months
JBoss Native SVN: r1895 - trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet.
by jbossnative-commits@lists.jboss.org
Author: pferraro
Date: 2008-09-23 21:37:12 -0400 (Tue, 23 Sep 2008)
New Revision: 1895
Modified:
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/HeapMemoryLoadServlet.java
Log:
Workaround for javac bug:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4941882
Modified: trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/HeapMemoryLoadServlet.java
===================================================================
--- trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/HeapMemoryLoadServlet.java 2008-09-23 15:51:53 UTC (rev 1894)
+++ trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/HeapMemoryLoadServlet.java 2008-09-24 01:37:12 UTC (rev 1895)
@@ -45,8 +45,17 @@
long free = Runtime.getRuntime().freeMemory();
@SuppressWarnings("unused")
- Object array = (free > Integer.MAX_VALUE) ? new byte[Integer.MAX_VALUE][(int) free / Integer.MAX_VALUE] : new byte[(int) free];
+ Object array = null;
+ if (free > Integer.MAX_VALUE)
+ {
+ array = new byte[Integer.MAX_VALUE][(int) free / Integer.MAX_VALUE];
+ }
+ else
+ {
+ array = new byte[(int) free];
+ }
+
try
{
Thread.sleep(duration);
16 years, 3 months
JBoss Native SVN: r1894 - trunk/mod_cluster/src/test/java/org/jboss/modcluster/load/metric.
by jbossnative-commits@lists.jboss.org
Author: pferraro
Date: 2008-09-23 11:51:53 -0400 (Tue, 23 Sep 2008)
New Revision: 1894
Modified:
trunk/mod_cluster/src/test/java/org/jboss/modcluster/load/metric/ActiveSessionsLoadMetricTestCase.java
Log:
Change session manager attribute to activeSessions.
Clustered session manager will be modified to return local active session count.
Modified: trunk/mod_cluster/src/test/java/org/jboss/modcluster/load/metric/ActiveSessionsLoadMetricTestCase.java
===================================================================
--- trunk/mod_cluster/src/test/java/org/jboss/modcluster/load/metric/ActiveSessionsLoadMetricTestCase.java 2008-09-23 15:51:10 UTC (rev 1893)
+++ trunk/mod_cluster/src/test/java/org/jboss/modcluster/load/metric/ActiveSessionsLoadMetricTestCase.java 2008-09-23 15:51:53 UTC (rev 1894)
@@ -110,8 +110,8 @@
EasyMock.verify(this.server);
EasyMock.reset(this.server);
- EasyMock.expect(this.server.getAttribute(name1, "LocalActiveSessions")).andReturn(1);
- EasyMock.expect(this.server.getAttribute(name2, "LocalActiveSessions")).andReturn(2);
+ EasyMock.expect(this.server.getAttribute(name1, "activeSessions")).andReturn(1);
+ EasyMock.expect(this.server.getAttribute(name2, "activeSessions")).andReturn(2);
EasyMock.replay(this.server);
16 years, 3 months
JBoss Native SVN: r1893 - trunk/mod_cluster/src/main/java/org/jboss/modcluster/load/metric/impl.
by jbossnative-commits@lists.jboss.org
Author: pferraro
Date: 2008-09-23 11:51:10 -0400 (Tue, 23 Sep 2008)
New Revision: 1893
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/load/metric/impl/ActiveSessionsLoadMetric.java
Log:
Use lower case activeSessions
Modified: trunk/mod_cluster/src/main/java/org/jboss/modcluster/load/metric/impl/ActiveSessionsLoadMetric.java
===================================================================
--- trunk/mod_cluster/src/main/java/org/jboss/modcluster/load/metric/impl/ActiveSessionsLoadMetric.java 2008-09-23 15:39:14 UTC (rev 1892)
+++ trunk/mod_cluster/src/main/java/org/jboss/modcluster/load/metric/impl/ActiveSessionsLoadMetric.java 2008-09-23 15:51:10 UTC (rev 1893)
@@ -30,7 +30,7 @@
*/
public class ActiveSessionsLoadMetric extends MBeanAttributeLoadMetric
{
- private static final String DEFAULT_ATTRIBUTE = "ActiveSessions";
+ private static final String DEFAULT_ATTRIBUTE = "activeSessions";
public ActiveSessionsLoadMetric(SessionLoadMetricSource source)
{
16 years, 3 months
JBoss Native SVN: r1892 - trunk/mod_cluster/src/main/java/org/jboss/modcluster/load/metric/impl.
by jbossnative-commits@lists.jboss.org
Author: pferraro
Date: 2008-09-23 11:39:14 -0400 (Tue, 23 Sep 2008)
New Revision: 1892
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/load/metric/impl/ActiveSessionsLoadMetric.java
Log:
Change session manager attribute to ActiveSessions.
Clustered session manager will be modified to return local active session count.
Modified: trunk/mod_cluster/src/main/java/org/jboss/modcluster/load/metric/impl/ActiveSessionsLoadMetric.java
===================================================================
--- trunk/mod_cluster/src/main/java/org/jboss/modcluster/load/metric/impl/ActiveSessionsLoadMetric.java 2008-09-23 14:48:47 UTC (rev 1891)
+++ trunk/mod_cluster/src/main/java/org/jboss/modcluster/load/metric/impl/ActiveSessionsLoadMetric.java 2008-09-23 15:39:14 UTC (rev 1892)
@@ -30,7 +30,7 @@
*/
public class ActiveSessionsLoadMetric extends MBeanAttributeLoadMetric
{
- private static final String DEFAULT_ATTRIBUTE = "LocalActiveSessions";
+ private static final String DEFAULT_ATTRIBUTE = "ActiveSessions";
public ActiveSessionsLoadMetric(SessionLoadMetricSource source)
{
16 years, 3 months