DO NOT REPLY [Bug 39941] New: - My jsf application fails

2006-07-01 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39941

   Summary: My jsf application fails
   Product: Tomcat 5
   Version: 5.0.28
  Platform: PC
OS/Version: Windows Server 2003
Status: NEW
  Severity: normal
  Priority: P2
 Component: Servlet & JSP API
AssignedTo: tomcat-dev@jakarta.apache.org
ReportedBy: [EMAIL PROTECTED]


I am encountering a problem with Tomcat 5.0.28 and JSF1.01(Sun RI).
Spec. detail:
Windows2003 server
Tomcat5.0.28
JDK1.4.08

Problem:
1)Access page1.  Show page1 in client IE.
2)Access page2.  Show page2 to next page1(i.e. show page1 and page2).
3)Access page3.  Show page3 to next page2(i.e. show page1, page2 and page3).
and so on.

But, on
WindowsXP
Tomcat5.0.28
JDK1.4.08,
I am encountering no problem. Why?
Think.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r418502 - /tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/ThreadPool.java

2006-07-01 Thread fhanik
Author: fhanik
Date: Sat Jul  1 12:50:50 2006
New Revision: 418502

URL: http://svn.apache.org/viewvc?rev=418502&view=rev
Log:
Removed the use of the interestOpsMutex object as we now correctly use the 
selector.
this file, again has the line ending problem that drives me nuts

Modified:

tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/ThreadPool.java

Modified: 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/ThreadPool.java
URL: 
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/ThreadPool.java?rev=418502&r1=418501&r2=418502&view=diff
==
--- 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/ThreadPool.java
 (original)
+++ 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/ThreadPool.java
 Sat Jul  1 12:50:50 2006
@@ -1,161 +1,161 @@
-/*
- * Copyright 1999,2004 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *  http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.catalina.tribes.transport;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-/**
- * @author not attributable
- * @version 1.0
- */
-
-public class ThreadPool
-{
-/**
- * A very simple thread pool class.  The pool size is set at
- * construction time and remains fixed.  Threads are cycled
- * through a FIFO idle queue.
- */
-
-List idle = new LinkedList();
-List used = new LinkedList();
-
-Object mutex = new Object();
-Object interestOpsMutex = null;
-boolean running = true;
-
-private static int counter = 1;
-private int maxThreads;
-private int minThreads;
-
-private ThreadCreator creator = null;
-
-private static synchronized int inc() {
-return counter++;
-}
-
-public ThreadPool (Object interestOpsMutex, int maxThreads, int 
minThreads, ThreadCreator creator) throws Exception {
-// fill up the pool with worker threads
-this.interestOpsMutex = interestOpsMutex;
-this.maxThreads = maxThreads;
-this.minThreads = minThreads;
-this.creator = creator;
-for (int i = 0; i < minThreads; i++) {
-WorkerThread thread = creator.getWorkerThread();
-setupThread(thread);
-idle.add (thread);
-}
-}
-
-protected void setupThread(WorkerThread thread) {
-thread.setPool(this);
-thread.setName (thread.getClass().getName()+"[" + inc()+"]");
-thread.setDaemon(true);
-thread.setPriority(Thread.MAX_PRIORITY);
-thread.start();
-}
-
-/**
- * Find an idle worker thread, if any.  Could return null.
- */
-public WorkerThread getWorker()
-{
-WorkerThread worker = null;
-
-
-synchronized (mutex) {
-while ( worker == null && running ) {
-if (idle.size() > 0) {
-try {
-worker = (WorkerThread) idle.remove(0);
-} catch (java.util.NoSuchElementException x) {
-//this means that there are no available workers
-worker = null;
-}
-} else if ( used.size() < this.maxThreads && creator != null) {
-worker = creator.getWorkerThread();
-setupThread(worker);
-} else {
-try { mutex.wait(); } catch ( 
java.lang.InterruptedException x ) {Thread.currentThread().interrupted();}
-}
-}//while
-if ( worker != null ) used.add(worker);
-}
-return (worker);
-}
-
-public int available() {
-return idle.size();
-}
-
-/**
- * Called by the worker thread to return itself to the
- * idle pool.
- */
-public void returnWorker (WorkerThread worker) {
-if ( running ) {
-synchronized (mutex) {
-used.remove(worker);
-if ( idle.size() < minThreads && !idle.contains(worker)) 
idle.add(worker);
-else {
-worker.setDoRun(false);
-synchronized (worker){worker.notify();}
-}
-mutex.notify();
-

svn commit: r418503 - in /tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes: io/ transport/ transport/bio/ transport/nio/

2006-07-01 Thread fhanik
Author: fhanik
Date: Sat Jul  1 12:53:16 2006
New Revision: 418503

URL: http://svn.apache.org/viewvc?rev=418503&view=rev
Log:
Improved NioReceiver by almost 50% in performance, handles concurrency much 
better now

Modified:

tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/ChannelData.java

tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/XByteBuffer.java

tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/ReceiverBase.java

tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/bio/BioReceiver.java

tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/bio/BioSender.java

tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/nio/NioReceiver.java

tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/nio/NioReplicationThread.java

tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/nio/NioSender.java

Modified: 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/ChannelData.java
URL: 
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/ChannelData.java?rev=418503&r1=418502&r2=418503&view=diff
==
--- 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/ChannelData.java
 (original)
+++ 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/ChannelData.java
 Sat Jul  1 12:53:16 2006
@@ -215,6 +215,30 @@
  * @param b byte[]
  * @return ChannelData
  */
+public static ChannelData getDataFromPackage(XByteBuffer xbuf)  {
+ChannelData data = new ChannelData(false);
+int offset = 0;
+data.setOptions(XByteBuffer.toInt(xbuf.getBytesDirect(),offset));
+offset += 4; //options
+data.setTimestamp(XByteBuffer.toLong(xbuf.getBytesDirect(),offset));
+offset += 8; //timestamp
+data.uniqueId = new 
byte[XByteBuffer.toInt(xbuf.getBytesDirect(),offset)];
+offset += 4; //uniqueId length
+
System.arraycopy(xbuf.getBytesDirect(),offset,data.uniqueId,0,data.uniqueId.length);
+offset += data.uniqueId.length; //uniqueId data
+byte[] addr = new 
byte[XByteBuffer.toInt(xbuf.getBytesDirect(),offset)];
+offset += 4; //addr length
+System.arraycopy(xbuf.getBytesDirect(),offset,addr,0,addr.length);
+data.setAddress(MemberImpl.getMember(addr));
+offset += addr.length; //addr data
+int xsize = XByteBuffer.toInt(xbuf.getBytesDirect(),offset);
+
System.arraycopy(xbuf.getBytesDirect(),offset,xbuf.getBytesDirect(),0,xsize);
+xbuf.setLength(xsize);
+data.message = xbuf;
+return data;
+
+}
+
 public static ChannelData getDataFromPackage(byte[] b)  {
 ChannelData data = new ChannelData(false);
 int offset = 0;

Modified: 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/XByteBuffer.java
URL: 
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/XByteBuffer.java?rev=418503&r1=418502&r2=418503&view=diff
==
--- 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/XByteBuffer.java
 (original)
+++ 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/XByteBuffer.java
 Sat Jul  1 12:53:16 2006
@@ -113,6 +113,11 @@
 public int getLength() {
 return bufSize;
 }
+
+public void setLength(int size) {
+if ( size > buf.length ) throw new 
ArrayIndexOutOfBoundsException("Size is larger than existing buffer.");
+bufSize = size;
+}
 
 public void trim(int length) {
 if ( (bufSize - length) < 0 ) 
@@ -307,24 +312,24 @@
  * @param clearFromBuffer - if true, the package will be removed from the 
byte buffer
  * @return - returns the actual message bytes (header, compress,size and 
footer not included).
  */
-public byte[] extractDataPackage(boolean clearFromBuffer) {
+public XByteBuffer extractDataPackage(boolean clearFromBuffer) {
 int psize = countPackages(true);
 if (psize == 0) throw new java.lang.IllegalStateException("No package 
exists in XByteBuffer");
 int size = toInt(buf, START_DATA.length);
-byte[] data = new byte[size];
-System.arraycopy(buf, START_DATA.length + 4, data, 0, size);
+XByteBuffer xbuf = BufferPool.getBufferPool().getBuffer(size,false);
+System.arraycopy(buf, START_DATA.length + 4, xbuf.getBytesDirect(), 0, 
size);
 if (clearFromBuffer) {
 int tot

svn commit: r418504 - /tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/demos/SocketNioReceive.java

2006-07-01 Thread fhanik
Author: fhanik
Date: Sat Jul  1 12:54:41 2006
New Revision: 418504

URL: http://svn.apache.org/viewvc?rev=418504&view=rev
Log:
improved the sustainability of the process staying alive

Modified:

tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/demos/SocketNioReceive.java

Modified: 
tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/demos/SocketNioReceive.java
URL: 
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/demos/SocketNioReceive.java?rev=418504&r1=418503&r2=418504&view=diff
==
--- 
tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/demos/SocketNioReceive.java
 (original)
+++ 
tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/demos/SocketNioReceive.java
 Sat Jul  1 12:54:41 2006
@@ -14,6 +14,7 @@
 
 public class SocketNioReceive {
 
+protected static Object mutex = new Object();
 public static void main(String[] args) throws Exception {
 Member mbr = new MemberImpl("localhost", , 0);
 ChannelData data = new ChannelData();
@@ -29,7 +30,15 @@
 receiver.setMessageListener(list);
 receiver.start();
 System.out.println("Listening on ");
-Thread.sleep(10);
+while (true) {
+try {
+synchronized (mutex) {
+mutex.wait();
+}
+}catch (Throwable x) {
+x.printStackTrace();
+}
+}
 }
 
 public static class MyList implements MessageListener {



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r418507 - in /tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes: io/ObjectReader.java transport/nio/NioReceiver.java transport/nio/NioReplicationThread.java

2006-07-01 Thread fhanik
Author: fhanik
Date: Sat Jul  1 13:23:27 2006
New Revision: 418507

URL: http://svn.apache.org/viewvc?rev=418507&view=rev
Log:
added a last access method to the object reader, so that we can track when a 
socket was last accessed.
again, SVN is playing a trick on me, with the line endings

Modified:

tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/ObjectReader.java

tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/nio/NioReceiver.java

tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/nio/NioReplicationThread.java

Modified: 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/ObjectReader.java
URL: 
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/ObjectReader.java?rev=418507&r1=418506&r2=418507&view=diff
==
--- 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/ObjectReader.java
 (original)
+++ 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/ObjectReader.java
 Sat Jul  1 13:23:27 2006
@@ -1,126 +1,135 @@
-/*
- * Copyright 1999,2004-2005 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *  http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.catalina.tribes.io;
-
-import java.io.IOException;
-import java.net.Socket;
-import java.nio.ByteBuffer;
-import java.nio.channels.Selector;
-import java.nio.channels.SocketChannel;
-
-import org.apache.catalina.tribes.ChannelMessage;
-
-
-
-/**
- * The object reader object is an object used in conjunction with
- * java.nio TCP messages. This object stores the message bytes in a
- * XByteBuffer until a full package has been received.
- * This object uses an XByteBuffer which is an extendable object buffer that 
also allows
- * for message encoding and decoding.
- *
- * @author Filip Hanik
- * @version $Revision: 377484 $, $Date: 2006-02-13 15:00:05 -0600 (Mon, 13 Feb 
2006) $
- */
-public class ObjectReader {
-
-protected static org.apache.commons.logging.Log log = 
org.apache.commons.logging.LogFactory.getLog(ObjectReader.class);
-
-private XByteBuffer buffer;
-
-/**
- * Creates an ObjectReader for a TCP NIO socket channel
- * @param channel - the channel to be read.
- */
-public ObjectReader(SocketChannel channel) {
-this(channel.socket());
-}
-
-/**
- * Creates an ObjectReader for a TCP socket
- * @param socket Socket
- */
-public ObjectReader(Socket socket) {
-try{
-this.buffer = new XByteBuffer(socket.getReceiveBufferSize(), true);
-}catch ( IOException x ) {
-//unable to get buffer size
-log.warn("Unable to retrieve the socket receiver buffer size, 
setting to default 43800 bytes.");
-this.buffer = new XByteBuffer(43800,true);
-}
-}
-
-/**
- * Append new bytes to buffer. 
- * @see XByteBuffer#countPackages()
- * @param data new transfer buffer
- * @param off offset
- * @param len length in buffer
- * @return number of messages that sended to callback
- * @throws java.io.IOException
- */
-public int append(ByteBuffer data, int len, boolean count) throws 
java.io.IOException {
-   buffer.append(data,len);
-   int pkgCnt = -1;
-   if ( count ) pkgCnt = buffer.countPackages();
-   return pkgCnt;
-   }
-
- public int append(byte[] data,int off,int len, boolean count) throws 
java.io.IOException {
-buffer.append(data,off,len);
-int pkgCnt = -1;
-if ( count ) pkgCnt = buffer.countPackages();
-return pkgCnt;
-}
-
-/**
- * Send buffer to cluster listener (callback).
- * Is message complete receiver send message to callback?
- *
- * @see 
org.apache.catalina.tribes.transport.ClusterReceiverBase#messageDataReceived(ChannelMessage)
- * @see XByteBuffer#doesPackageExist()
- * @see XByteBuffer#extractPackage(boolean)
- *
- * @return number of received packages/messages
- * @throws java.io.IOException
- */
-public ChannelMessage[] execute() throws java.io.IOException {
-int pkgCnt = buffer.countPackages();
-ChannelMessage[] result = new ChannelMessage[pkgCnt];
-for (int i=0; ihttp://www.apache.org/licenses/

svn commit: r418515 - in /tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes: demos/ChannelCreator.java demos/SocketSend.java test/channel/TestDataIntegrity.java

2006-07-01 Thread fhanik
Author: fhanik
Date: Sat Jul  1 15:43:35 2006
New Revision: 418515

URL: http://svn.apache.org/viewvc?rev=418515&view=rev
Log:
Added a test case to verify data integrity.

Added:

tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/channel/TestDataIntegrity.java
Modified:

tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/demos/ChannelCreator.java

tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/demos/SocketSend.java

Modified: 
tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/demos/ChannelCreator.java
URL: 
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/demos/ChannelCreator.java?rev=418515&r1=418514&r2=418515&view=diff
==
--- 
tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/demos/ChannelCreator.java
 (original)
+++ 
tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/demos/ChannelCreator.java
 Sat Jul  1 15:43:35 2006
@@ -82,7 +82,7 @@
 int port = 4001;
 String mbind = null;
 boolean gzip = false;
-int tcpseltimeout = 100;
+int tcpseltimeout = 5000;
 int tcpthreadcount = 4;
 int acktimeout = 15000;
 String mcastaddr = "228.0.0.5";

Modified: 
tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/demos/SocketSend.java
URL: 
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/demos/SocketSend.java?rev=418515&r1=418514&r2=418515&view=diff
==
--- 
tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/demos/SocketSend.java
 (original)
+++ 
tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/demos/SocketSend.java
 Sat Jul  1 15:43:35 2006
@@ -7,12 +7,14 @@
 import org.apache.catalina.tribes.io.XByteBuffer;
 import org.apache.catalina.tribes.Member;
 import org.apache.catalina.tribes.io.ChannelData;
+import org.apache.catalina.tribes.Channel;
 
 public class SocketSend {
 
 public static void main(String[] args) throws Exception {
 Member mbr = new MemberImpl("localhost", , 0);
 ChannelData data = new ChannelData();
+data.setOptions(Channel.SEND_OPTIONS_BYTE_MESSAGE);
 data.setAddress(mbr);
 byte[] buf = new byte[8192 * 4];
 data.setMessage(new XByteBuffer(buf,false));

Added: 
tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/channel/TestDataIntegrity.java
URL: 
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/channel/TestDataIntegrity.java?rev=418515&view=auto
==
--- 
tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/channel/TestDataIntegrity.java
 (added)
+++ 
tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/test/channel/TestDataIntegrity.java
 Sat Jul  1 15:43:35 2006
@@ -0,0 +1,114 @@
+package org.apache.catalina.tribes.test.channel;
+
+import junit.framework.TestCase;
+import java.io.Serializable;
+import java.util.Random;
+import java.util.Arrays;
+import org.apache.catalina.tribes.ChannelListener;
+import org.apache.catalina.tribes.Member;
+import org.apache.catalina.tribes.group.GroupChannel;
+import org.apache.catalina.tribes.test.channel.TestDataIntegrity.Listener;
+
+/**
+ * Title:  
+ * 
+ * Description:  
+ * 
+ * Copyright: Copyright (c) 2005 
+ * 
+ * Company: 
+ * 
+ * @author not attributable
+ * @version 1.0
+ */
+public class TestDataIntegrity extends TestCase {
+int msgCount = 1000;
+GroupChannel channel1;
+GroupChannel channel2;
+Listener listener1;
+protected void setUp() throws Exception {
+super.setUp();
+channel1 = new GroupChannel();
+channel2 = new GroupChannel();
+listener1 = new Listener();
+channel2.addChannelListener(listener1);
+channel1.start(GroupChannel.DEFAULT);
+channel2.start(GroupChannel.DEFAULT);
+}
+
+protected void tearDown() throws Exception {
+super.tearDown();
+channel1.stop(GroupChannel.DEFAULT);
+channel2.stop(GroupChannel.DEFAULT);
+}
+
+public void testDataSendNO_ACK() throws Exception {
+System.err.println("Starting NO_ACK");
+for (int i=0; i

svn commit: r418516 - in /tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes: io/ChannelData.java io/ObjectReader.java io/XByteBuffer.java transport/nio/NioReceiver.java tr

2006-07-01 Thread fhanik
Author: fhanik
Date: Sat Jul  1 15:52:11 2006
New Revision: 418516

URL: http://svn.apache.org/viewvc?rev=418516&view=rev
Log:
Major improvements, there seems to be an error with the thread handling on the 
NIOReceiver and the hand off for the worker thread

Modified:

tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/ChannelData.java

tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/ObjectReader.java

tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/XByteBuffer.java

tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/nio/NioReceiver.java

tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/nio/NioReplicationThread.java

Modified: 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/ChannelData.java
URL: 
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/ChannelData.java?rev=418516&r1=418515&r2=418516&view=diff
==
--- 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/ChannelData.java
 (original)
+++ 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/ChannelData.java
 Sat Jul  1 15:52:11 2006
@@ -232,6 +232,7 @@
 data.setAddress(MemberImpl.getMember(addr));
 offset += addr.length; //addr data
 int xsize = XByteBuffer.toInt(xbuf.getBytesDirect(),offset);
+offset += 4; //xsize length
 
System.arraycopy(xbuf.getBytesDirect(),offset,xbuf.getBytesDirect(),0,xsize);
 xbuf.setLength(xsize);
 data.message = xbuf;

Modified: 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/ObjectReader.java
URL: 
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/ObjectReader.java?rev=418516&r1=418515&r2=418516&view=diff
==
--- 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/ObjectReader.java
 (original)
+++ 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/ObjectReader.java
 Sat Jul  1 15:52:11 2006
@@ -41,6 +41,8 @@
 private XByteBuffer buffer;
 
 protected long lastAccess = System.currentTimeMillis();
+
+protected boolean accessed = false;
 
 /**
  * Creates an ObjectReader for a TCP NIO socket channel
@@ -62,6 +64,18 @@
 log.warn("Unable to retrieve the socket receiver buffer size, 
setting to default 43800 bytes.");
 this.buffer = new XByteBuffer(43800,true);
 }
+}
+
+public synchronized void access() {
+this.accessed = true;
+}
+
+public synchronized void finish() {
+this.accessed = false;
+}
+
+public boolean isAccessed() {
+return this.accessed;
 }
 
 /**

Modified: 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/XByteBuffer.java
URL: 
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/XByteBuffer.java?rev=418516&r1=418515&r2=418516&view=diff
==
--- 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/XByteBuffer.java
 (original)
+++ 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/io/XByteBuffer.java
 Sat Jul  1 15:52:11 2006
@@ -317,6 +317,7 @@
 if (psize == 0) throw new java.lang.IllegalStateException("No package 
exists in XByteBuffer");
 int size = toInt(buf, START_DATA.length);
 XByteBuffer xbuf = BufferPool.getBufferPool().getBuffer(size,false);
+xbuf.setLength(size);
 System.arraycopy(buf, START_DATA.length + 4, xbuf.getBytesDirect(), 0, 
size);
 if (clearFromBuffer) {
 int totalsize = START_DATA.length + 4 + size + END_DATA.length;

Modified: 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/nio/NioReceiver.java
URL: 
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/nio/NioReceiver.java?rev=418516&r1=418515&r2=418516&view=diff
==
--- 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/nio/NioReceiver.java
 (original)
+++ 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/nio/NioReceiver.java
 Sat Jul  1 15:52:11 2006
@@ -1,321 +1,377 @@
-/*
- * Copyright 1999,2004-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License,

svn commit: r418517 - in /tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport: ThreadPool.java bio/BioReplicationThread.java nio/NioReplicationThread.java

2006-07-01 Thread fhanik
Author: fhanik
Date: Sat Jul  1 16:16:04 2006
New Revision: 418517

URL: http://svn.apache.org/viewvc?rev=418517&view=rev
Log:
Fixed threading hand off, now works correctly

Modified:

tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/ThreadPool.java

tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/bio/BioReplicationThread.java

tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/nio/NioReplicationThread.java

Modified: 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/ThreadPool.java
URL: 
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/ThreadPool.java?rev=418517&r1=418516&r2=418517&view=diff
==
--- 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/ThreadPool.java
 (original)
+++ 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/ThreadPool.java
 Sat Jul  1 16:16:04 2006
@@ -62,11 +62,14 @@
 }
 
 protected void setupThread(WorkerThread thread) {
-thread.setPool(this);
-thread.setName (thread.getClass().getName()+"[" + inc()+"]");
-thread.setDaemon(true);
-thread.setPriority(Thread.MAX_PRIORITY);
-thread.start();
+synchronized (thread) {
+thread.setPool(this);
+thread.setName(thread.getClass().getName() + "[" + inc() + "]");
+thread.setDaemon(true);
+thread.setPriority(Thread.MAX_PRIORITY);
+thread.start();
+try {thread.wait(500); }catch ( InterruptedException x ) {}
+}
 }
 
 /**

Modified: 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/bio/BioReplicationThread.java
URL: 
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/bio/BioReplicationThread.java?rev=418517&r1=418516&r2=418517&view=diff
==
--- 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/bio/BioReplicationThread.java
 (original)
+++ 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/bio/BioReplicationThread.java
 Sat Jul  1 16:16:04 2006
@@ -58,6 +58,7 @@
 // loop forever waiting for work to do
 public synchronized void run()
 {
+this.notify();
 while (isDoRun()) {
 try {
 // sleep and release object lock

Modified: 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/nio/NioReplicationThread.java
URL: 
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/nio/NioReplicationThread.java?rev=418517&r1=418516&r2=418517&view=diff
==
--- 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/nio/NioReplicationThread.java
 (original)
+++ 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/nio/NioReplicationThread.java
 Sat Jul  1 16:16:04 2006
@@ -59,6 +59,7 @@
 // loop forever waiting for work to do
 public synchronized void run()
 {
+this.notify();
 if ( (getOptions() & OPTION_DIRECT_BUFFER) == OPTION_DIRECT_BUFFER ) {
 buffer = ByteBuffer.allocateDirect(getRxBufSize());
 }else {
@@ -77,8 +78,11 @@
 if (key == null) {
 continue;  // just in case
 }
+ObjectReader reader = (ObjectReader)key.attachment();
 try {
-drainChannel (key);
+reader.setLastAccess(System.currentTimeMillis());
+reader.access();
+drainChannel (key,reader);
 } catch (Exception e) {
 //this is common, since the sockets on the other
 //end expire after a certain time.
@@ -86,13 +90,15 @@
 //do nothing
 } else if ( e instanceof IOException ) {
 //dont spew out stack traces for IO exceptions unless 
debug is enabled.
-if (log.isDebugEnabled()) log.debug ("IOException in 
replication worker, unable to drain channel. Probable cause: Keep alive socket 
closed.", e);
-else log.warn ("IOException in replication worker, unable 
to drain channel. Probable cause: Keep alive socket closed.");
+if (log.isDebugEnabled()) log.debug ("IOException in 
replication worker, unable to drain channel. Probable cause: Keep alive socket 
closed["+e.getMessage()+"].", e);
+   

svn commit: r418520 - in /tomcat/container/tc5.5.x/modules/groupcom: VERSION build/build.xml

2006-07-01 Thread fhanik
Author: fhanik
Date: Sat Jul  1 16:34:50 2006
New Revision: 418520

URL: http://svn.apache.org/viewvc?rev=418520&view=rev
Log:
Changed build script to generate archived JARs with version so that maven 
repositories can use it

Modified:
tomcat/container/tc5.5.x/modules/groupcom/VERSION
tomcat/container/tc5.5.x/modules/groupcom/build/build.xml

Modified: tomcat/container/tc5.5.x/modules/groupcom/VERSION
URL: 
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/VERSION?rev=418520&r1=418519&r2=418520&view=diff
==
--- tomcat/container/tc5.5.x/modules/groupcom/VERSION (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/VERSION Sat Jul  1 16:34:50 2006
@@ -1,3 +1,7 @@
+0.9.4.2
+  - Huge Performance improvements on the NIOReceiver
+  - revision 418518
+  - worked out the build script to generate versioned jars
 0.9.4.1
   - fixed bug with the command being transferred but not deserialized
 0.9.4.0

Modified: tomcat/container/tc5.5.x/modules/groupcom/build/build.xml
URL: 
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/build/build.xml?rev=418520&r1=418519&r2=418520&view=diff
==
--- tomcat/container/tc5.5.x/modules/groupcom/build/build.xml (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/build/build.xml Sat Jul  1 
16:34:50 2006
@@ -3,6 +3,8 @@
   
   
   
+  
+  
 
   
@@ -136,6 +138,8 @@
 
   
 
+
+
 
 
 
@@ -145,10 +149,13 @@
 
   
 
+
+
 
   
 
 
+
 
   
   



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]