incubator-kato-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From monte...@apache.org
Subject svn commit: r883384 [18/47] - in /incubator/kato/trunk/org.apache.kato: ./ kato.anttasks/src/main/java/org/apache/kato/anttasks/ kato.anttasks/src/main/java/org/apache/kato/anttasks/sitebuilder/ kato.anttasks/src/main/java/org/apache/kato/anttasks/tck/...
Date Mon, 23 Nov 2009 15:54:15 GMT
Modified: incubator/kato/trunk/org.apache.kato/kato.hprof.reader/src/test/java/test/apache/kato/common/TestDataReader.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.hprof.reader/src/test/java/test/apache/kato/common/TestDataReader.java?rev=883384&r1=883383&r2=883384&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.hprof.reader/src/test/java/test/apache/kato/common/TestDataReader.java (original)
+++ incubator/kato/trunk/org.apache.kato/kato.hprof.reader/src/test/java/test/apache/kato/common/TestDataReader.java Mon Nov 23 15:53:48 2009
@@ -1,41 +1,41 @@
-/*******************************************************************************
- * 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 test.apache.kato.common;
-
-import org.apache.kato.common.DataReader;
-
-import junit.framework.TestCase;
-
-public class TestDataReader extends TestCase {
-
-	
-	public void testReadInt1() {
-		
-		byte[] data=new byte[]{0,0,0,0};
-		
-		assertEquals(0,DataReader.read4Bytes(data));
-	}
-	
-	public void testReadInt2() {
-		
-		byte[] data=new byte[]{0,0,0,1};
-		
-		assertEquals(1,DataReader.read4Bytes(data));
-	}
-	public void testReadInt3() {
-		
-		byte[] data=new byte[]{0,0,(byte)2,(byte) 0};
-		
-		assertEquals(512,DataReader.read4Bytes(data));
-	}
-}
+/*******************************************************************************
+ * 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 test.apache.kato.common;
+
+import org.apache.kato.common.DataReader;
+
+import junit.framework.TestCase;
+
+public class TestDataReader extends TestCase {
+
+	
+	public void testReadInt1() {
+		
+		byte[] data=new byte[]{0,0,0,0};
+		
+		assertEquals(0,DataReader.read4Bytes(data));
+	}
+	
+	public void testReadInt2() {
+		
+		byte[] data=new byte[]{0,0,0,1};
+		
+		assertEquals(1,DataReader.read4Bytes(data));
+	}
+	public void testReadInt3() {
+		
+		byte[] data=new byte[]{0,0,(byte)2,(byte) 0};
+		
+		assertEquals(512,DataReader.read4Bytes(data));
+	}
+}

Propchange: incubator/kato/trunk/org.apache.kato/kato.hprof.reader/src/test/java/test/apache/kato/common/TestDataReader.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/kato/trunk/org.apache.kato/kato.hprof.reader/src/test/java/test/apache/kato/common/TestSubsetDataProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/kato/trunk/org.apache.kato/kato.hprof.reader/src/test/java/test/apache/kato/hprof/TestHProf.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.hprof.reader/src/test/java/test/apache/kato/hprof/TestHProf.java?rev=883384&r1=883383&r2=883384&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.hprof.reader/src/test/java/test/apache/kato/hprof/TestHProf.java (original)
+++ incubator/kato/trunk/org.apache.kato/kato.hprof.reader/src/test/java/test/apache/kato/hprof/TestHProf.java Mon Nov 23 15:53:48 2009
@@ -1,82 +1,82 @@
-/*******************************************************************************
- * 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 test.apache.kato.hprof;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URI;
-import java.net.URL;
-
-import junit.framework.TestCase;
-
-import org.apache.kato.hprof.datalayer.HProfFile;
-import org.apache.kato.hprof.datalayer.HProfFactory;
-import org.apache.kato.hprof.datalayer.IHProfRecord;
-
-public class TestHProf extends TestCase {
-
-	
-	private static final String DUMP = "/data/java.hprof";
-	public void testHeader() throws IOException,java.net.URISyntaxException {
-		URL datafile=getClass().getResource(DUMP);
-		URI i=datafile.toURI();
-		File dump=new File(i);
-		HProfFile h=HProfFactory.createReader(dump);
-		
-		h.open();
-		
-		String header=h.getHeader();
-		int    idSize=h.getIdentifierSize();
-		long   timeStamp=h.getTimeStamp();
-		
-		IHProfRecord record=h.getRecord(0); 
-		assertNotNull(record);
-		
-		System.out.println("tag="+Integer.toHexString(record.getTag()));
-		h.close();
-		
-	}
-	public void testRead() throws IOException,java.net.URISyntaxException {
-		
-		URL datafile=getClass().getResource(DUMP);
-		URI i=datafile.toURI();
-		File dump=new File(i);
-		HProfFile h=HProfFactory.createReader(dump);
-		
-		h.open();
-		int records=h.getRecordCount();
-		h.close();
-		assertEquals(1526,records);
-		
-		
-	}
-	public void testReadTwice() throws IOException,java.net.URISyntaxException {
-		
-		URL datafile=getClass().getResource(DUMP);
-		URI uri=datafile.toURI();
-		File dump=new File(uri);
-		HProfFile h=HProfFactory.createReader(dump);
-		
-		h.open();
-		int records=h.getRecordCount();
-		for(int i=0;i<records;i++) {
-			Object o=h.getRecord(i);
-			assertNotNull("element "+i+" is null",o);
-		}
-		h.close();
-		
-		
-		
-	}
-}
+/*******************************************************************************
+ * 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 test.apache.kato.hprof;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URL;
+
+import junit.framework.TestCase;
+
+import org.apache.kato.hprof.datalayer.HProfFile;
+import org.apache.kato.hprof.datalayer.HProfFactory;
+import org.apache.kato.hprof.datalayer.IHProfRecord;
+
+public class TestHProf extends TestCase {
+
+	
+	private static final String DUMP = "/data/java.hprof";
+	public void testHeader() throws IOException,java.net.URISyntaxException {
+		URL datafile=getClass().getResource(DUMP);
+		URI i=datafile.toURI();
+		File dump=new File(i);
+		HProfFile h=HProfFactory.createReader(dump);
+		
+		h.open();
+		
+		String header=h.getHeader();
+		int    idSize=h.getIdentifierSize();
+		long   timeStamp=h.getTimeStamp();
+		
+		IHProfRecord record=h.getRecord(0); 
+		assertNotNull(record);
+		
+		System.out.println("tag="+Integer.toHexString(record.getTag()));
+		h.close();
+		
+	}
+	public void testRead() throws IOException,java.net.URISyntaxException {
+		
+		URL datafile=getClass().getResource(DUMP);
+		URI i=datafile.toURI();
+		File dump=new File(i);
+		HProfFile h=HProfFactory.createReader(dump);
+		
+		h.open();
+		int records=h.getRecordCount();
+		h.close();
+		assertEquals(1526,records);
+		
+		
+	}
+	public void testReadTwice() throws IOException,java.net.URISyntaxException {
+		
+		URL datafile=getClass().getResource(DUMP);
+		URI uri=datafile.toURI();
+		File dump=new File(uri);
+		HProfFile h=HProfFactory.createReader(dump);
+		
+		h.open();
+		int records=h.getRecordCount();
+		for(int i=0;i<records;i++) {
+			Object o=h.getRecord(i);
+			assertNotNull("element "+i+" is null",o);
+		}
+		h.close();
+		
+		
+		
+	}
+}

Propchange: incubator/kato/trunk/org.apache.kato/kato.hprof.reader/src/test/java/test/apache/kato/hprof/TestHProf.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/kato/trunk/org.apache.kato/kato.hprof.reader/src/test/java/test/apache/kato/hprof/TestSetup.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/CacheReader.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/CacheReader.java?rev=883384&r1=883383&r2=883384&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/CacheReader.java (original)
+++ incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/CacheReader.java Mon Nov 23 15:53:48 2009
@@ -1,33 +1,33 @@
-/*******************************************************************************
- * 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.kato.tools.jdi;
-
-public class CacheReader {
-	private JDICacher chsr; 
-	
-	public void setCache(JDICacher ichsr){
-		chsr = ichsr;
-	}
-	
-	public JDICacher getCache(){
-		return chsr;
-	}
-	
-	protected void closeCache(){
-		chsr = null;
-	}
-	
-	
-	
-}
+/*******************************************************************************
+ * 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.kato.tools.jdi;
+
+public class CacheReader {
+	private JDICacher chsr; 
+	
+	public void setCache(JDICacher ichsr){
+		chsr = ichsr;
+	}
+	
+	public JDICacher getCache(){
+		return chsr;
+	}
+	
+	protected void closeCache(){
+		chsr = null;
+	}
+	
+	
+	
+}

Propchange: incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/CacheReader.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/CacherProvider.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/CacherProvider.java?rev=883384&r1=883383&r2=883384&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/CacherProvider.java (original)
+++ incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/CacherProvider.java Mon Nov 23 15:53:48 2009
@@ -1,20 +1,20 @@
-/*******************************************************************************
- * 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.kato.tools.jdi;
-
-public interface CacherProvider {
-	public Packet query(Packet pckt) throws Exception;
-	public boolean isOk();	
-	public void stop();
-}
+/*******************************************************************************
+ * 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.kato.tools.jdi;
+
+public interface CacherProvider {
+	public Packet query(Packet pckt) throws Exception;
+	public boolean isOk();	
+	public void stop();
+}

Propchange: incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/CacherProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/CommandPacket.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/CommandPacket.java?rev=883384&r1=883383&r2=883384&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/CommandPacket.java (original)
+++ incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/CommandPacket.java Mon Nov 23 15:53:48 2009
@@ -1,69 +1,69 @@
-/*******************************************************************************
- * 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.kato.tools.jdi;
-
-import java.util.Vector;
-
-public class CommandPacket extends Packet {
-
-	private static final long serialVersionUID = 1L;
-	private int nCmdSet;
-	private int nCmd;
-	
-	public CommandPacket(int seq, int flags, int cmdset, int cmd){
-		nSeq = seq;
-		nFlags = flags;
-		nCmdSet = cmdset;
-		nCmd = cmd;
-	}
-	
-	public CommandPacket(int seq, int flags, int cmdset, int cmd, int cacheSettings){
-		nSeq = seq;
-		nFlags = flags;
-		nCmdSet = cmdset;
-		nCmd = cmd;
-		this.cacheSettings = cacheSettings;
-	}
-	
-	public int getCommandSet(){
-		return nCmdSet;
-	}
-	
-	public int getCommand(){
-		return nCmd;
-	}
-	
-	@Override
-	public byte[] toBytes(){
-		Vector<Byte> vctr = new Vector<Byte>();
-		int len = 11 + getByteData().length;
-		KatoReader.addIntToVector(vctr, len);
-		KatoReader.addIntToVector(vctr, nSeq);
-		vctr.add((byte)nFlags);
-		vctr.add((byte)nCmdSet);
-		vctr.add((byte)nCmd);
-		if (len > 11){
-			byte[] outData = getByteData();
-			for (int i = 0; i < outData.length; i++){
-				vctr.add(outData[i]);
-			}
-		}
-		
-		return KatoReader.vectorToByte(vctr);
-		
-		
-	}
-	
-	
-}
+/*******************************************************************************
+ * 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.kato.tools.jdi;
+
+import java.util.Vector;
+
+public class CommandPacket extends Packet {
+
+	private static final long serialVersionUID = 1L;
+	private int nCmdSet;
+	private int nCmd;
+	
+	public CommandPacket(int seq, int flags, int cmdset, int cmd){
+		nSeq = seq;
+		nFlags = flags;
+		nCmdSet = cmdset;
+		nCmd = cmd;
+	}
+	
+	public CommandPacket(int seq, int flags, int cmdset, int cmd, int cacheSettings){
+		nSeq = seq;
+		nFlags = flags;
+		nCmdSet = cmdset;
+		nCmd = cmd;
+		this.cacheSettings = cacheSettings;
+	}
+	
+	public int getCommandSet(){
+		return nCmdSet;
+	}
+	
+	public int getCommand(){
+		return nCmd;
+	}
+	
+	@Override
+	public byte[] toBytes(){
+		Vector<Byte> vctr = new Vector<Byte>();
+		int len = 11 + getByteData().length;
+		KatoReader.addIntToVector(vctr, len);
+		KatoReader.addIntToVector(vctr, nSeq);
+		vctr.add((byte)nFlags);
+		vctr.add((byte)nCmdSet);
+		vctr.add((byte)nCmd);
+		if (len > 11){
+			byte[] outData = getByteData();
+			for (int i = 0; i < outData.length; i++){
+				vctr.add(outData[i]);
+			}
+		}
+		
+		return KatoReader.vectorToByte(vctr);
+		
+		
+	}
+	
+	
+}

Propchange: incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/CommandPacket.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/CommandReplyPair.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/CommandReplyPair.java?rev=883384&r1=883383&r2=883384&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/CommandReplyPair.java (original)
+++ incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/CommandReplyPair.java Mon Nov 23 15:53:48 2009
@@ -1,34 +1,34 @@
-/*******************************************************************************
- * 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.kato.tools.jdi;
-
-public class CommandReplyPair implements java.io.Serializable{
-	private static final long serialVersionUID = 1L;
-	private ReplyPacket rpckt;
-	private CommandPacket cpckt;
-	
-	public CommandReplyPair(CommandPacket cpckt, ReplyPacket rpckt){
-		this.rpckt = rpckt;
-		this.cpckt = cpckt;
-	}
-	
-	public ReplyPacket getReplyPacket(){
-		return rpckt;
-	}
-	
-	public CommandPacket getCommandPacket(){
-		return cpckt;
-	}
-	
-}
+/*******************************************************************************
+ * 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.kato.tools.jdi;
+
+public class CommandReplyPair implements java.io.Serializable{
+	private static final long serialVersionUID = 1L;
+	private ReplyPacket rpckt;
+	private CommandPacket cpckt;
+	
+	public CommandReplyPair(CommandPacket cpckt, ReplyPacket rpckt){
+		this.rpckt = rpckt;
+		this.cpckt = cpckt;
+	}
+	
+	public ReplyPacket getReplyPacket(){
+		return rpckt;
+	}
+	
+	public CommandPacket getCommandPacket(){
+		return cpckt;
+	}
+	
+}

Propchange: incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/CommandReplyPair.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/JDICacher.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/JDICacher.java?rev=883384&r1=883383&r2=883384&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/JDICacher.java (original)
+++ incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/JDICacher.java Mon Nov 23 15:53:48 2009
@@ -1,310 +1,310 @@
-/*******************************************************************************
- * 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.kato.tools.jdi;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.PrintStream;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.util.Arrays;
-import java.util.Vector;
-
-/* JDICacher
- * 
- * JDICacher lies as a layer between the JDWPServer and the KatoReader.  It times the returns
- * from KatoReader, and if they're over a certain amount of time, it stores them in a vector
- * so that future calls return the vectorized version.  The actual class that's stored in the
- * Vector is a CommandReplyPair, which stores a command and it's reply.  On read, we search
- * all the pairs for a matching CommandPacket, and directly return it's ReplyPacket.  Most of
- * the time this isn't an issue, but sometimes it can be quite lengthy to do some of the
- * operations on larger core files.
- * 
- *   It should be noted that we always do an MD5 hash on the core file on our first cache request
- * (if and only if file caching is enabled).  This may be a large bottleneck any of:
- *  o No hashing
- *  o No file cache
- *  o No cache
- * will alleviate this problem.  It should be noted to use 'no hashing' with extreme care, because
- * if you load another cache from another file, you'll start serving out IDs which are invalid for
- * this core.
- * 
- *   Also, delay cache write is recommended for over-the-network cache saves, because by default we'll
- * re-write the cache to disk on every new packet added.  Most of the time this is what we want, but
- * if you don't properly shut down the server (the red square in the debugger), no cache will actually
- * be saved.
- */
-
-public class JDICacher{
-	private String coreFile;
-
-	//This caches everything set to cache
-	public static final int CACHE_CACHE = 0;
-	//Cache only things set to cache
-	public static final int CACHE_EXPLICIT = 1;
-	//Do not cache anything
-	public static final int CACHE_NOCACHE = 2;
-	//Cache everything
-	public static final int CACHE_FORCECACHE = 3;
-	private int cacheTime = 1000;
-
-	private JDILogger logr;
-	private int cacheSettings = CACHE_CACHE;
-	private CacherProvider provider;
-	Vector<CommandReplyPair> cache;
-	private boolean disableHash = false;
-	private boolean doDelay = false;
-	public final static int FILE_NOFILE = 0;
-	public final static int FILE_USEFILE = 1;
-	private int fileSettings = FILE_USEFILE;
-	private String hashCode;
-	
-	public JDICacher(String coreFile, JDWPServer svr, JDILogger logger) throws Exception{
-		logr = logger;
-		logr.log(JDILogger.LEVEL_VERYVERBOSE, "JDICacher 1.0"); //$NON-NLS-1$
-		this.coreFile = coreFile;
-		logr.log(JDILogger.LEVEL_VERYVERBOSE, "Creating KatoReader"); //$NON-NLS-1$
-		provider = new KatoReader(coreFile, svr, JDILogger.logger);
-		logr.log(JDILogger.LEVEL_VERYVERBOSE, "KatoReader created"); //$NON-NLS-1$
-
-
-
-
-	}
-
-	public void setProvider(CacherProvider pvdr){
-		provider = pvdr;
-	}
-
-	public void setCacheSettings(int cacheSettings){
-		this.cacheSettings = cacheSettings;
-	}
-
-	public int getCacheSettings(){
-		return this.cacheSettings;
-	}
-
-	public void commit(){
-		if (fileSettings == FILE_USEFILE){
-			resaveCache();
-		}
-	}
-
-	public void setFileAccess(int setting){
-		fileSettings = setting;
-	}
-
-	public void delayedWrites(boolean inDoDelay){
-		this.doDelay = inDoDelay;
-	}
-
-	public void disableHash(boolean noHash){
-		this.disableHash = noHash;
-	}
-
-	private ReplyPacket readCache(CommandPacket cmdpckt){
-
-		//If we need initing, init
-		if (this.hashCode == null){
-			this.hashCode = getHash();
-		}
-		if (cache == null){
-			if (fileSettings == FILE_USEFILE){
-				try{
-					FileInputStream bStream = new FileInputStream(hashCode + ".dat"); //$NON-NLS-1$
-					ObjectInputStream oStream = new ObjectInputStream(bStream);
-					logr.log(JDILogger.LEVEL_VERBOSE, "Reading class cache..."); //$NON-NLS-1$
-					cache = (Vector<CommandReplyPair>)oStream.readObject();
-					oStream.close();
-					bStream.close();
-				}
-				catch(FileNotFoundException exxy){
-				}
-				catch(Exception exxy){
-					logr.logError(JDILogger.LEVEL_VERBOSE, "Error reading class cache.  See stack trace."); //$NON-NLS-1$
-					exxy.printStackTrace(new PrintStream(logr.getErrorStream()));
-				}
-			}
-			if (cache == null){
-				cache = new Vector<CommandReplyPair>();
-			}
-			logr.log(JDILogger.LEVEL_VERBOSE, cache.size() + " objects cached"); //$NON-NLS-1$
-		}
-
-		//Search cache
-		for(int i = 0; i < cache.size(); i++){
-			CommandReplyPair crp = cache.elementAt(i);
-			CommandPacket cp = crp.getCommandPacket();
-			if (cp.getCommandSet() == cmdpckt.getCommandSet()){
-				if (cp.getCommand() == cmdpckt.getCommand()){
-					if (Arrays.equals(cp.getByteData(), cmdpckt.getByteData())){
-						ReplyPacket rp = crp.getReplyPacket();
-						rp.setSequence(cmdpckt.getSequence());
-						//Make sure this packet gets to the destination
-						rp.setVSock(cmdpckt.getVSock());
-						return rp;
-					}
-				}
-			}
-		}
-		return null;
-	}
-
-
-	public synchronized ReplyPacket query(CommandPacket cmdpckt){
-
-		if (this.cacheSettings != CACHE_NOCACHE){
-			ReplyPacket rply = readCache(cmdpckt);
-			if (rply != null){
-				return rply;
-			}
-
-
-		}
-
-		long ctime = System.currentTimeMillis();
-
-		ReplyPacket rpckt = null;
-		try{
-			rpckt = (ReplyPacket)provider.query(cmdpckt);
-		}catch(Exception exxy){
-			logr.logError(JDILogger.LEVEL_NORMAL, "Uncaught exception"); //$NON-NLS-1$
-			exxy.printStackTrace(new PrintStream(logr.getErrorStream()));
-			rpckt = new ReplyPacket(cmdpckt.getSequence(), KatoReader.FLAG_REPLY_PACKET, KatoReader.ERROR_INTERNAL);
-			return rpckt;
-		}
-		ctime = System.currentTimeMillis() - ctime;
-		//This skips cache stuff if we turned off caching here
-		//And if the packet is null
-		if (this.cacheSettings == CACHE_NOCACHE || rpckt == null){
-			return rpckt;
-		}
-
-		//If the reply packet didn't specify a cache setting
-		if (rpckt.getCacheSetting() == Packet.CACHE_UNSET){
-			//Use the command packet's
-			rpckt.setCacheSetting(cmdpckt.getCacheSetting());
-		}
-
-		//If we're forcing a cache, or was asked to cache, or the packet level cache request was unset and the cache is on
-		if (this.cacheSettings == CACHE_FORCECACHE || rpckt.getCacheSetting() == Packet.CACHE_CACHE || (this.cacheSettings == CACHE_CACHE && rpckt.getCacheSetting() == Packet.CACHE_UNSET)){
-			//If the time was too great and explicit cache is off (requires packets to ask for cache),
-			//We're forcing cache, or the packet requested to be cached.
-			if ((ctime >= cacheTime && this.cacheSettings != CACHE_EXPLICIT) || this.cacheSettings == CACHE_FORCECACHE || rpckt.getCacheSetting() == Packet.CACHE_CACHE){
-				cachePacket(cmdpckt, rpckt);
-				
-
-
-			}
-
-		}
-
-		return rpckt;
-	}
-	
-	private void cachePacket(CommandPacket cmdpckt, ReplyPacket rpckt){
-		logr.log(JDILogger.LEVEL_VERYVERBOSE, "Cacheing packet"); //$NON-NLS-1$
-		for(int i = 0; i < cache.size(); i++){
-			CommandReplyPair crp = cache.elementAt(i);
-			CommandPacket cp = crp.getCommandPacket();
-			if (cp.getCommandSet() == cmdpckt.getCommandSet()){
-				if (cp.getCommand() == cmdpckt.getCommand()){
-					if (Arrays.equals(cp.getByteData(), cmdpckt.getByteData())){
-						//This means we already have it, don't add it again
-						return;
-					}
-				}
-			}
-
-		}
-		CommandReplyPair ncrp = new CommandReplyPair(cmdpckt, rpckt);
-		cache.add(ncrp);
-		if (!doDelay){
-			resaveCache();
-		}
-	}
-
-	public void tweakCacheTime(int inTime){
-		cacheTime = inTime;
-	}
-
-	private void resaveCache(){
-		if (fileSettings == FILE_USEFILE && cache != null){
-			try{
-				logr.log(JDILogger.LEVEL_VERBOSE, "Writing " + cache.size() + " packets to file cache"); //$NON-NLS-1$ //$NON-NLS-2$
-				FileOutputStream bStream = new FileOutputStream(hashCode + ".dat"); //$NON-NLS-1$
-				ObjectOutputStream oStream = new ObjectOutputStream(bStream);
-				oStream.writeObject(cache);
-				oStream.close();
-				bStream.close();
-			}catch(Exception exxy){
-				exxy.printStackTrace();
-			}
-		}
-	}
-	public String getHash(){
-		if (this.hashCode != null){
-			return this.hashCode;
-		}
-
-		String fullHash;
-		if (disableHash || fileSettings != FILE_USEFILE || cacheSettings == CACHE_NOCACHE){
-			return "JDICache"; //$NON-NLS-1$
-		}
-		try{
-			MessageDigest md5er = MessageDigest.getInstance("md5"); //$NON-NLS-1$
-			try{
-				FileInputStream fi = new FileInputStream(coreFile);
-				while (fi.available() > 0){
-					byte []buff = new byte[256];
-					fi.read(buff);
-					md5er.update(buff);
-				}
-				fi.close();
-				byte []digest = md5er.digest();
-
-				StringBuffer strbld = new StringBuffer();
-				for(int i = 0; i < digest.length; i++){
-					String temp = Integer.toHexString(digest[i] & 0xFF);
-					if (temp.length() < 2){
-						temp = "0" + temp; //$NON-NLS-1$
-					}
-					strbld.append(temp);
-				}
-				fullHash = strbld.toString();
-			}
-			catch(IOException exxy){
-				JDILogger.logger.logError(JDILogger.LEVEL_NORMAL, "Problem processing hash for core file"); //$NON-NLS-1$
-				fullHash = "JDICache"; //$NON-NLS-1$
-			}
-
-		}catch(NoSuchAlgorithmException exxy){
-			JDILogger.logger.logError(JDILogger.LEVEL_NORMAL, "No MD5 Algorithm"); //$NON-NLS-1$
-			fullHash = "JDICache"; //$NON-NLS-1$
-		}
-		logr.log(JDILogger.LEVEL_VERYVERBOSE, "Dump hash: " + fullHash); //$NON-NLS-1$
-		return fullHash;
-
-	}
-
-	public CacherProvider getProvider(){
-		return provider;
-	}
-
-
-
-}
+/*******************************************************************************
+ * 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.kato.tools.jdi;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.PrintStream;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.Arrays;
+import java.util.Vector;
+
+/* JDICacher
+ * 
+ * JDICacher lies as a layer between the JDWPServer and the KatoReader.  It times the returns
+ * from KatoReader, and if they're over a certain amount of time, it stores them in a vector
+ * so that future calls return the vectorized version.  The actual class that's stored in the
+ * Vector is a CommandReplyPair, which stores a command and it's reply.  On read, we search
+ * all the pairs for a matching CommandPacket, and directly return it's ReplyPacket.  Most of
+ * the time this isn't an issue, but sometimes it can be quite lengthy to do some of the
+ * operations on larger core files.
+ * 
+ *   It should be noted that we always do an MD5 hash on the core file on our first cache request
+ * (if and only if file caching is enabled).  This may be a large bottleneck any of:
+ *  o No hashing
+ *  o No file cache
+ *  o No cache
+ * will alleviate this problem.  It should be noted to use 'no hashing' with extreme care, because
+ * if you load another cache from another file, you'll start serving out IDs which are invalid for
+ * this core.
+ * 
+ *   Also, delay cache write is recommended for over-the-network cache saves, because by default we'll
+ * re-write the cache to disk on every new packet added.  Most of the time this is what we want, but
+ * if you don't properly shut down the server (the red square in the debugger), no cache will actually
+ * be saved.
+ */
+
+public class JDICacher{
+	private String coreFile;
+
+	//This caches everything set to cache
+	public static final int CACHE_CACHE = 0;
+	//Cache only things set to cache
+	public static final int CACHE_EXPLICIT = 1;
+	//Do not cache anything
+	public static final int CACHE_NOCACHE = 2;
+	//Cache everything
+	public static final int CACHE_FORCECACHE = 3;
+	private int cacheTime = 1000;
+
+	private JDILogger logr;
+	private int cacheSettings = CACHE_CACHE;
+	private CacherProvider provider;
+	Vector<CommandReplyPair> cache;
+	private boolean disableHash = false;
+	private boolean doDelay = false;
+	public final static int FILE_NOFILE = 0;
+	public final static int FILE_USEFILE = 1;
+	private int fileSettings = FILE_USEFILE;
+	private String hashCode;
+	
+	public JDICacher(String coreFile, JDWPServer svr, JDILogger logger) throws Exception{
+		logr = logger;
+		logr.log(JDILogger.LEVEL_VERYVERBOSE, "JDICacher 1.0"); //$NON-NLS-1$
+		this.coreFile = coreFile;
+		logr.log(JDILogger.LEVEL_VERYVERBOSE, "Creating KatoReader"); //$NON-NLS-1$
+		provider = new KatoReader(coreFile, svr, JDILogger.logger);
+		logr.log(JDILogger.LEVEL_VERYVERBOSE, "KatoReader created"); //$NON-NLS-1$
+
+
+
+
+	}
+
+	public void setProvider(CacherProvider pvdr){
+		provider = pvdr;
+	}
+
+	public void setCacheSettings(int cacheSettings){
+		this.cacheSettings = cacheSettings;
+	}
+
+	public int getCacheSettings(){
+		return this.cacheSettings;
+	}
+
+	public void commit(){
+		if (fileSettings == FILE_USEFILE){
+			resaveCache();
+		}
+	}
+
+	public void setFileAccess(int setting){
+		fileSettings = setting;
+	}
+
+	public void delayedWrites(boolean inDoDelay){
+		this.doDelay = inDoDelay;
+	}
+
+	public void disableHash(boolean noHash){
+		this.disableHash = noHash;
+	}
+
+	private ReplyPacket readCache(CommandPacket cmdpckt){
+
+		//If we need initing, init
+		if (this.hashCode == null){
+			this.hashCode = getHash();
+		}
+		if (cache == null){
+			if (fileSettings == FILE_USEFILE){
+				try{
+					FileInputStream bStream = new FileInputStream(hashCode + ".dat"); //$NON-NLS-1$
+					ObjectInputStream oStream = new ObjectInputStream(bStream);
+					logr.log(JDILogger.LEVEL_VERBOSE, "Reading class cache..."); //$NON-NLS-1$
+					cache = (Vector<CommandReplyPair>)oStream.readObject();
+					oStream.close();
+					bStream.close();
+				}
+				catch(FileNotFoundException exxy){
+				}
+				catch(Exception exxy){
+					logr.logError(JDILogger.LEVEL_VERBOSE, "Error reading class cache.  See stack trace."); //$NON-NLS-1$
+					exxy.printStackTrace(new PrintStream(logr.getErrorStream()));
+				}
+			}
+			if (cache == null){
+				cache = new Vector<CommandReplyPair>();
+			}
+			logr.log(JDILogger.LEVEL_VERBOSE, cache.size() + " objects cached"); //$NON-NLS-1$
+		}
+
+		//Search cache
+		for(int i = 0; i < cache.size(); i++){
+			CommandReplyPair crp = cache.elementAt(i);
+			CommandPacket cp = crp.getCommandPacket();
+			if (cp.getCommandSet() == cmdpckt.getCommandSet()){
+				if (cp.getCommand() == cmdpckt.getCommand()){
+					if (Arrays.equals(cp.getByteData(), cmdpckt.getByteData())){
+						ReplyPacket rp = crp.getReplyPacket();
+						rp.setSequence(cmdpckt.getSequence());
+						//Make sure this packet gets to the destination
+						rp.setVSock(cmdpckt.getVSock());
+						return rp;
+					}
+				}
+			}
+		}
+		return null;
+	}
+
+
+	public synchronized ReplyPacket query(CommandPacket cmdpckt){
+
+		if (this.cacheSettings != CACHE_NOCACHE){
+			ReplyPacket rply = readCache(cmdpckt);
+			if (rply != null){
+				return rply;
+			}
+
+
+		}
+
+		long ctime = System.currentTimeMillis();
+
+		ReplyPacket rpckt = null;
+		try{
+			rpckt = (ReplyPacket)provider.query(cmdpckt);
+		}catch(Exception exxy){
+			logr.logError(JDILogger.LEVEL_NORMAL, "Uncaught exception"); //$NON-NLS-1$
+			exxy.printStackTrace(new PrintStream(logr.getErrorStream()));
+			rpckt = new ReplyPacket(cmdpckt.getSequence(), KatoReader.FLAG_REPLY_PACKET, KatoReader.ERROR_INTERNAL);
+			return rpckt;
+		}
+		ctime = System.currentTimeMillis() - ctime;
+		//This skips cache stuff if we turned off caching here
+		//And if the packet is null
+		if (this.cacheSettings == CACHE_NOCACHE || rpckt == null){
+			return rpckt;
+		}
+
+		//If the reply packet didn't specify a cache setting
+		if (rpckt.getCacheSetting() == Packet.CACHE_UNSET){
+			//Use the command packet's
+			rpckt.setCacheSetting(cmdpckt.getCacheSetting());
+		}
+
+		//If we're forcing a cache, or was asked to cache, or the packet level cache request was unset and the cache is on
+		if (this.cacheSettings == CACHE_FORCECACHE || rpckt.getCacheSetting() == Packet.CACHE_CACHE || (this.cacheSettings == CACHE_CACHE && rpckt.getCacheSetting() == Packet.CACHE_UNSET)){
+			//If the time was too great and explicit cache is off (requires packets to ask for cache),
+			//We're forcing cache, or the packet requested to be cached.
+			if ((ctime >= cacheTime && this.cacheSettings != CACHE_EXPLICIT) || this.cacheSettings == CACHE_FORCECACHE || rpckt.getCacheSetting() == Packet.CACHE_CACHE){
+				cachePacket(cmdpckt, rpckt);
+				
+
+
+			}
+
+		}
+
+		return rpckt;
+	}
+	
+	private void cachePacket(CommandPacket cmdpckt, ReplyPacket rpckt){
+		logr.log(JDILogger.LEVEL_VERYVERBOSE, "Cacheing packet"); //$NON-NLS-1$
+		for(int i = 0; i < cache.size(); i++){
+			CommandReplyPair crp = cache.elementAt(i);
+			CommandPacket cp = crp.getCommandPacket();
+			if (cp.getCommandSet() == cmdpckt.getCommandSet()){
+				if (cp.getCommand() == cmdpckt.getCommand()){
+					if (Arrays.equals(cp.getByteData(), cmdpckt.getByteData())){
+						//This means we already have it, don't add it again
+						return;
+					}
+				}
+			}
+
+		}
+		CommandReplyPair ncrp = new CommandReplyPair(cmdpckt, rpckt);
+		cache.add(ncrp);
+		if (!doDelay){
+			resaveCache();
+		}
+	}
+
+	public void tweakCacheTime(int inTime){
+		cacheTime = inTime;
+	}
+
+	private void resaveCache(){
+		if (fileSettings == FILE_USEFILE && cache != null){
+			try{
+				logr.log(JDILogger.LEVEL_VERBOSE, "Writing " + cache.size() + " packets to file cache"); //$NON-NLS-1$ //$NON-NLS-2$
+				FileOutputStream bStream = new FileOutputStream(hashCode + ".dat"); //$NON-NLS-1$
+				ObjectOutputStream oStream = new ObjectOutputStream(bStream);
+				oStream.writeObject(cache);
+				oStream.close();
+				bStream.close();
+			}catch(Exception exxy){
+				exxy.printStackTrace();
+			}
+		}
+	}
+	public String getHash(){
+		if (this.hashCode != null){
+			return this.hashCode;
+		}
+
+		String fullHash;
+		if (disableHash || fileSettings != FILE_USEFILE || cacheSettings == CACHE_NOCACHE){
+			return "JDICache"; //$NON-NLS-1$
+		}
+		try{
+			MessageDigest md5er = MessageDigest.getInstance("md5"); //$NON-NLS-1$
+			try{
+				FileInputStream fi = new FileInputStream(coreFile);
+				while (fi.available() > 0){
+					byte []buff = new byte[256];
+					fi.read(buff);
+					md5er.update(buff);
+				}
+				fi.close();
+				byte []digest = md5er.digest();
+
+				StringBuffer strbld = new StringBuffer();
+				for(int i = 0; i < digest.length; i++){
+					String temp = Integer.toHexString(digest[i] & 0xFF);
+					if (temp.length() < 2){
+						temp = "0" + temp; //$NON-NLS-1$
+					}
+					strbld.append(temp);
+				}
+				fullHash = strbld.toString();
+			}
+			catch(IOException exxy){
+				JDILogger.logger.logError(JDILogger.LEVEL_NORMAL, "Problem processing hash for core file"); //$NON-NLS-1$
+				fullHash = "JDICache"; //$NON-NLS-1$
+			}
+
+		}catch(NoSuchAlgorithmException exxy){
+			JDILogger.logger.logError(JDILogger.LEVEL_NORMAL, "No MD5 Algorithm"); //$NON-NLS-1$
+			fullHash = "JDICache"; //$NON-NLS-1$
+		}
+		logr.log(JDILogger.LEVEL_VERYVERBOSE, "Dump hash: " + fullHash); //$NON-NLS-1$
+		return fullHash;
+
+	}
+
+	public CacherProvider getProvider(){
+		return provider;
+	}
+
+
+
+}

Propchange: incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/JDICacher.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/JDIController.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/JDIController.java?rev=883384&r1=883383&r2=883384&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/JDIController.java (original)
+++ incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/JDIController.java Mon Nov 23 15:53:48 2009
@@ -1,191 +1,191 @@
-/*******************************************************************************
- * 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.kato.tools.jdi;
-import java.util.concurrent.CountDownLatch;
-
-public class JDIController {
-	
-	private static CountDownLatch readyToGo;
-	
-	public static void jdbLaunch(String args[], CountDownLatch readyToGo){
-		JDIController.readyToGo = readyToGo;
-		JDIController.main(args);
-	}
-
-	public static void main(String args[]){
-		long baselineMemory = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
-
-		int cacheTime = -1;
-		boolean useFiles = true;
-		boolean delayWrite = true;
-		boolean disableHash = false;
-		boolean autoTerm = false;
-		int port = 8000;
-
-
-		JDILogger.logger = new JDILogger();
-		JDILogger logr = JDILogger.logger;
-
-		String coreFile = ""; //$NON-NLS-1$
-		if (args.length == 1){
-			coreFile = args[0];
-		}else if (args.length > 0){
-			try{
-				for(int i = 0; i < args.length; i++){
-					if (args[i].equalsIgnoreCase("-v")){ //$NON-NLS-1$
-						logr.setVerbosity(logr.getVerbosity() + 1);
-					}else if (args[i].equalsIgnoreCase("-q")){ //$NON-NLS-1$
-						logr.setVerbosity(logr.getVerbosity() - 1);
-					}else if (args[i].equalsIgnoreCase("--nofile")){ //$NON-NLS-1$
-						useFiles = false;
-					}else if (args[i].equalsIgnoreCase("-a")){ //$NON-NLS-1$
-						autoTerm = true;
-					}else if (args[i].equalsIgnoreCase("-p")){ //$NON-NLS-1$
-						try{
-							port = Integer.parseInt(args[i + 1]);
-							i++;
-						}catch(NumberFormatException exxy){
-							System.err.println("Port number (-p) is not a number, or malformed"); //$NON-NLS-1$
-							printUsage();
-							System.exit(1);
-						}
-					}else if (args[i].equalsIgnoreCase("--nohash")){ //$NON-NLS-1$
-						disableHash = true;
-					}else if (args[i].equalsIgnoreCase("--delaywrite")){ //$NON-NLS-1$
-						delayWrite = true;
-					}else if (args[i].equalsIgnoreCase("-t")){ //$NON-NLS-1$
-						try{
-							cacheTime = Integer.parseInt(args[i + 1]);
-							i++;
-						}catch(NumberFormatException exxy){
-							System.err.println("Cache time (-t) is not a number, or malformed"); //$NON-NLS-1$
-							printUsage();
-							System.exit(1);
-						}
-					}else if (args[i].equalsIgnoreCase("--nocache")){ //$NON-NLS-1$
-						cacheTime = -2;
-					}
-				}
-				coreFile = args[args.length - 1];
-			}catch(Exception exxy){
-				System.err.println("Malformed command line"); //$NON-NLS-1$
-				printUsage();
-				System.exit(1);
-			}
-
-		}else{
-			printUsage();
-			System.exit(1);
-		}
-
-		//Used for loading times
-		long time = System.currentTimeMillis();
-
-		//Useful information
-		logr.log(JDILogger.LEVEL_VERBOSE, "# Procs:" + Runtime.getRuntime().availableProcessors()); //$NON-NLS-1$
-		logr.log(JDILogger.LEVEL_VERBOSE, "Bytes free: " + Runtime.getRuntime().freeMemory()); //$NON-NLS-1$
-		logr.log(JDILogger.LEVEL_VERBOSE, "Bytes total: " + Runtime.getRuntime().totalMemory()); //$NON-NLS-1$
-
-		//The JDWP server converts:
-		//bytes <---> Packets
-		JDWPServer svr = null;
-		try{
-			svr = new JDWPServer(JDILogger.logger, port);
-			if (readyToGo!=null)svr.setTerminateLastClient(true);
-		}catch(Exception exxy){
-			System.err.println("Unrecoverable error:"); //$NON-NLS-1$
-			exxy.printStackTrace();
-			System.exit(1);
-		}
-		
-
-		//Intermediate Cache
-		JDICacher chsr = null;
-		try{
-			chsr = new JDICacher(coreFile, svr, JDILogger.logger);
-		}catch(Exception exxy){
-			System.err.println("Unrecoverable error:"); //$NON-NLS-1$
-			exxy.printStackTrace();
-			System.exit(1);
-		}
-		if (chsr == null || svr == null){
-			System.err.println("Unrecoverable error, please check previous errors (and/or turn up verbosity)"); //$NON-NLS-1$
-			System.exit(1);
-			return;
-		}
-		
-		chsr.disableHash(disableHash);
-		chsr.delayedWrites(delayWrite);
-		if (!useFiles){
-			chsr.setFileAccess(JDICacher.FILE_NOFILE);
-		}
-		
-		if (cacheTime == -2){
-			chsr.setCacheSettings(JDICacher.CACHE_NOCACHE);
-		}else if (cacheTime >= 0){
-			chsr.tweakCacheTime(cacheTime);	
-		}else{
-			chsr.tweakCacheTime(1000);
-		}
-
-		svr.setTerminateLastClient(autoTerm);
-		
-		//Rather than keep making the same requests to the Kato reader
-		//Use an intermediate cache
-		svr.setCache(chsr);
-
-		//Save the old settings
-		svr.askPacket(new CommandPacket(0, 0, 1, 3, Packet.CACHE_CACHE));
-
-
-		long memory = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
-		logr.log(JDILogger.LEVEL_VERYVERBOSE, "Loading took " + (System.currentTimeMillis() - time) + "ms (" + (memory - baselineMemory) + "B used)"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
-		//Start the JDWP server.  This call blocks until the JDISocketServer is done.
-		//This also starts the JDISocketServer
-		try{
-			svr.start();
-		}catch(Exception exxy){
-			
-		}
-		
-		
-		memory = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
-		chsr.commit();
-		// Notify jdb connector if it is listening...
-		if (readyToGo != null){
-			readyToGo.countDown();
-		}
-		logr.log(JDILogger.LEVEL_VERBOSE, "Goodbye! (Uptime: " + (System.currentTimeMillis() - time) + "ms) (" + (memory - baselineMemory) + "B used)"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-		try{Thread.sleep(5000);}catch(Exception exxy){}
-	}
-
-	public static void printUsage(){
-		System.out.println(" JDI Command Line Post-Mortem Debugger"); //$NON-NLS-1$
-		System.out.println("------------------------------------------"); //$NON-NLS-1$
-		System.out.println("-v           Increase verbosity (for each instance)"); //$NON-NLS-1$
-		System.out.println("-q           Decrease verbosity (for each instance)"); //$NON-NLS-1$
-		System.out.println("-t           Set cache time"); //$NON-NLS-1$
-		System.out.println("-a           Terminate server after last client disconnects"); //$NON-NLS-1$
-		System.out.println("-p           TCPIP port number."); //$NON-NLS-1$
-		System.out.println("--nohash     Do not MD5 hash core. (!USE WITH CAUTION!)*"); //$NON-NLS-1$
-		System.out.println("--nofile     File cache is no loaded or saved, caches still happen*"); //$NON-NLS-1$
-		System.out.println("--delaywrite Resave cache file only on shutdown*"); //$NON-NLS-1$
-		System.out.println("--nocache    Disable cache"); //$NON-NLS-1$
-		System.out.println("Last argument is path to dump file"); //$NON-NLS-1$
-		System.out.println("Default TCPIP port is 8000."); //$NON-NLS-1$
-		System.out.println("* May improve speed over a network"); //$NON-NLS-1$
-
-	}
-}
+/*******************************************************************************
+ * 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.kato.tools.jdi;
+import java.util.concurrent.CountDownLatch;
+
+public class JDIController {
+	
+	private static CountDownLatch readyToGo;
+	
+	public static void jdbLaunch(String args[], CountDownLatch readyToGo){
+		JDIController.readyToGo = readyToGo;
+		JDIController.main(args);
+	}
+
+	public static void main(String args[]){
+		long baselineMemory = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
+
+		int cacheTime = -1;
+		boolean useFiles = true;
+		boolean delayWrite = true;
+		boolean disableHash = false;
+		boolean autoTerm = false;
+		int port = 8000;
+
+
+		JDILogger.logger = new JDILogger();
+		JDILogger logr = JDILogger.logger;
+
+		String coreFile = ""; //$NON-NLS-1$
+		if (args.length == 1){
+			coreFile = args[0];
+		}else if (args.length > 0){
+			try{
+				for(int i = 0; i < args.length; i++){
+					if (args[i].equalsIgnoreCase("-v")){ //$NON-NLS-1$
+						logr.setVerbosity(logr.getVerbosity() + 1);
+					}else if (args[i].equalsIgnoreCase("-q")){ //$NON-NLS-1$
+						logr.setVerbosity(logr.getVerbosity() - 1);
+					}else if (args[i].equalsIgnoreCase("--nofile")){ //$NON-NLS-1$
+						useFiles = false;
+					}else if (args[i].equalsIgnoreCase("-a")){ //$NON-NLS-1$
+						autoTerm = true;
+					}else if (args[i].equalsIgnoreCase("-p")){ //$NON-NLS-1$
+						try{
+							port = Integer.parseInt(args[i + 1]);
+							i++;
+						}catch(NumberFormatException exxy){
+							System.err.println("Port number (-p) is not a number, or malformed"); //$NON-NLS-1$
+							printUsage();
+							System.exit(1);
+						}
+					}else if (args[i].equalsIgnoreCase("--nohash")){ //$NON-NLS-1$
+						disableHash = true;
+					}else if (args[i].equalsIgnoreCase("--delaywrite")){ //$NON-NLS-1$
+						delayWrite = true;
+					}else if (args[i].equalsIgnoreCase("-t")){ //$NON-NLS-1$
+						try{
+							cacheTime = Integer.parseInt(args[i + 1]);
+							i++;
+						}catch(NumberFormatException exxy){
+							System.err.println("Cache time (-t) is not a number, or malformed"); //$NON-NLS-1$
+							printUsage();
+							System.exit(1);
+						}
+					}else if (args[i].equalsIgnoreCase("--nocache")){ //$NON-NLS-1$
+						cacheTime = -2;
+					}
+				}
+				coreFile = args[args.length - 1];
+			}catch(Exception exxy){
+				System.err.println("Malformed command line"); //$NON-NLS-1$
+				printUsage();
+				System.exit(1);
+			}
+
+		}else{
+			printUsage();
+			System.exit(1);
+		}
+
+		//Used for loading times
+		long time = System.currentTimeMillis();
+
+		//Useful information
+		logr.log(JDILogger.LEVEL_VERBOSE, "# Procs:" + Runtime.getRuntime().availableProcessors()); //$NON-NLS-1$
+		logr.log(JDILogger.LEVEL_VERBOSE, "Bytes free: " + Runtime.getRuntime().freeMemory()); //$NON-NLS-1$
+		logr.log(JDILogger.LEVEL_VERBOSE, "Bytes total: " + Runtime.getRuntime().totalMemory()); //$NON-NLS-1$
+
+		//The JDWP server converts:
+		//bytes <---> Packets
+		JDWPServer svr = null;
+		try{
+			svr = new JDWPServer(JDILogger.logger, port);
+			if (readyToGo!=null)svr.setTerminateLastClient(true);
+		}catch(Exception exxy){
+			System.err.println("Unrecoverable error:"); //$NON-NLS-1$
+			exxy.printStackTrace();
+			System.exit(1);
+		}
+		
+
+		//Intermediate Cache
+		JDICacher chsr = null;
+		try{
+			chsr = new JDICacher(coreFile, svr, JDILogger.logger);
+		}catch(Exception exxy){
+			System.err.println("Unrecoverable error:"); //$NON-NLS-1$
+			exxy.printStackTrace();
+			System.exit(1);
+		}
+		if (chsr == null || svr == null){
+			System.err.println("Unrecoverable error, please check previous errors (and/or turn up verbosity)"); //$NON-NLS-1$
+			System.exit(1);
+			return;
+		}
+		
+		chsr.disableHash(disableHash);
+		chsr.delayedWrites(delayWrite);
+		if (!useFiles){
+			chsr.setFileAccess(JDICacher.FILE_NOFILE);
+		}
+		
+		if (cacheTime == -2){
+			chsr.setCacheSettings(JDICacher.CACHE_NOCACHE);
+		}else if (cacheTime >= 0){
+			chsr.tweakCacheTime(cacheTime);	
+		}else{
+			chsr.tweakCacheTime(1000);
+		}
+
+		svr.setTerminateLastClient(autoTerm);
+		
+		//Rather than keep making the same requests to the Kato reader
+		//Use an intermediate cache
+		svr.setCache(chsr);
+
+		//Save the old settings
+		svr.askPacket(new CommandPacket(0, 0, 1, 3, Packet.CACHE_CACHE));
+
+
+		long memory = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
+		logr.log(JDILogger.LEVEL_VERYVERBOSE, "Loading took " + (System.currentTimeMillis() - time) + "ms (" + (memory - baselineMemory) + "B used)"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
+		//Start the JDWP server.  This call blocks until the JDISocketServer is done.
+		//This also starts the JDISocketServer
+		try{
+			svr.start();
+		}catch(Exception exxy){
+			
+		}
+		
+		
+		memory = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
+		chsr.commit();
+		// Notify jdb connector if it is listening...
+		if (readyToGo != null){
+			readyToGo.countDown();
+		}
+		logr.log(JDILogger.LEVEL_VERBOSE, "Goodbye! (Uptime: " + (System.currentTimeMillis() - time) + "ms) (" + (memory - baselineMemory) + "B used)"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+		try{Thread.sleep(5000);}catch(Exception exxy){}
+	}
+
+	public static void printUsage(){
+		System.out.println(" JDI Command Line Post-Mortem Debugger"); //$NON-NLS-1$
+		System.out.println("------------------------------------------"); //$NON-NLS-1$
+		System.out.println("-v           Increase verbosity (for each instance)"); //$NON-NLS-1$
+		System.out.println("-q           Decrease verbosity (for each instance)"); //$NON-NLS-1$
+		System.out.println("-t           Set cache time"); //$NON-NLS-1$
+		System.out.println("-a           Terminate server after last client disconnects"); //$NON-NLS-1$
+		System.out.println("-p           TCPIP port number."); //$NON-NLS-1$
+		System.out.println("--nohash     Do not MD5 hash core. (!USE WITH CAUTION!)*"); //$NON-NLS-1$
+		System.out.println("--nofile     File cache is no loaded or saved, caches still happen*"); //$NON-NLS-1$
+		System.out.println("--delaywrite Resave cache file only on shutdown*"); //$NON-NLS-1$
+		System.out.println("--nocache    Disable cache"); //$NON-NLS-1$
+		System.out.println("Last argument is path to dump file"); //$NON-NLS-1$
+		System.out.println("Default TCPIP port is 8000."); //$NON-NLS-1$
+		System.out.println("* May improve speed over a network"); //$NON-NLS-1$
+
+	}
+}

Propchange: incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/JDIController.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/JDILogger.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/JDILogger.java?rev=883384&r1=883383&r2=883384&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/JDILogger.java (original)
+++ incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/JDILogger.java Mon Nov 23 15:53:48 2009
@@ -1,96 +1,96 @@
-/*******************************************************************************
- * 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.kato.tools.jdi;
-import java.io.OutputStream;
-import java.io.PrintStream;
-
-public class JDILogger {
-	private JDIOutputStream verrorStream;
-	private JDIOutputStream voutStream;
-	public static final int LEVEL_QUIET = 0;
-	public static final int LEVEL_NORMAL = 1;
-	public static final int LEVEL_VERBOSE = 2;
-	public static final int LEVEL_VERYVERBOSE = 3;
-	private int verbosityLevel;
-	public static JDILogger logger;
-	
-	public JDILogger(){
-		verbosityLevel = LEVEL_NORMAL;
-		verrorStream = new JDIOutputStream(System.err);
-		voutStream = new JDIOutputStream(System.out);
-	}
-
-	public void setVerbosity(int level){
-		synchronized (this) {
-
-			verbosityLevel = level;
-		}
-	}
-
-	public int getVerbosity(){
-		return verbosityLevel;
-	}
-
-	public void setOutputStream(OutputStream out){
-		synchronized (this) {
-			voutStream.setStream(out);
-		}
-	}
-
-	public void setErrorStream(OutputStream out){
-		synchronized (this) {
-			verrorStream.setStream(out);
-		}
-	}
-
-	public void logError(int level, String inString){
-		synchronized (this) {
-
-			try{
-				if (level <= verbosityLevel){
-					PrintStream ps = new PrintStream(verrorStream);
-					ps.println(inString);
-					ps.flush();
-				}
-			}catch(Exception exxy){
-				exxy.printStackTrace();
-			}
-		}
-	}
-
-	public void log(int level, String inString){
-		synchronized (this) {
-			try{
-				if (level <= verbosityLevel){
-					PrintStream ps = new PrintStream(voutStream);
-					ps.println(inString);
-					ps.flush();
-				}
-				
-			}catch(Exception exxy){
-				exxy.printStackTrace();
-			}
-		}
-	}
-
-	public OutputStream getErrorStream(){
-		return verrorStream;
-	}
-
-	public OutputStream getOutputStream(){
-		return voutStream;
-	}
-
-
-}
+/*******************************************************************************
+ * 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.kato.tools.jdi;
+import java.io.OutputStream;
+import java.io.PrintStream;
+
+public class JDILogger {
+	private JDIOutputStream verrorStream;
+	private JDIOutputStream voutStream;
+	public static final int LEVEL_QUIET = 0;
+	public static final int LEVEL_NORMAL = 1;
+	public static final int LEVEL_VERBOSE = 2;
+	public static final int LEVEL_VERYVERBOSE = 3;
+	private int verbosityLevel;
+	public static JDILogger logger;
+	
+	public JDILogger(){
+		verbosityLevel = LEVEL_NORMAL;
+		verrorStream = new JDIOutputStream(System.err);
+		voutStream = new JDIOutputStream(System.out);
+	}
+
+	public void setVerbosity(int level){
+		synchronized (this) {
+
+			verbosityLevel = level;
+		}
+	}
+
+	public int getVerbosity(){
+		return verbosityLevel;
+	}
+
+	public void setOutputStream(OutputStream out){
+		synchronized (this) {
+			voutStream.setStream(out);
+		}
+	}
+
+	public void setErrorStream(OutputStream out){
+		synchronized (this) {
+			verrorStream.setStream(out);
+		}
+	}
+
+	public void logError(int level, String inString){
+		synchronized (this) {
+
+			try{
+				if (level <= verbosityLevel){
+					PrintStream ps = new PrintStream(verrorStream);
+					ps.println(inString);
+					ps.flush();
+				}
+			}catch(Exception exxy){
+				exxy.printStackTrace();
+			}
+		}
+	}
+
+	public void log(int level, String inString){
+		synchronized (this) {
+			try{
+				if (level <= verbosityLevel){
+					PrintStream ps = new PrintStream(voutStream);
+					ps.println(inString);
+					ps.flush();
+				}
+				
+			}catch(Exception exxy){
+				exxy.printStackTrace();
+			}
+		}
+	}
+
+	public OutputStream getErrorStream(){
+		return verrorStream;
+	}
+
+	public OutputStream getOutputStream(){
+		return voutStream;
+	}
+
+
+}

Propchange: incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/JDILogger.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/JDINotifier.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/JDINotifier.java?rev=883384&r1=883383&r2=883384&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/JDINotifier.java (original)
+++ incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/JDINotifier.java Mon Nov 23 15:53:48 2009
@@ -1,25 +1,25 @@
-/*******************************************************************************
- * 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.kato.tools.jdi;
-
-/**
- * JDINotifier is built execute code whenever something happens inside the JDIServerContainer,
- * and preventing continuous polling, and to avoid extra threads from being created.
- * 
- * To use the interface, simply implement the update() method, which is called when something happens
- *
- */
-public interface JDINotifier {
-	public void update(JDIServerContainer vsc);
-}
+/*******************************************************************************
+ * 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.kato.tools.jdi;
+
+/**
+ * JDINotifier is built execute code whenever something happens inside the JDIServerContainer,
+ * and preventing continuous polling, and to avoid extra threads from being created.
+ * 
+ * To use the interface, simply implement the update() method, which is called when something happens
+ *
+ */
+public interface JDINotifier {
+	public void update(JDIServerContainer vsc);
+}

Propchange: incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/JDINotifier.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/JDIOutputStream.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/JDIOutputStream.java?rev=883384&r1=883383&r2=883384&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/JDIOutputStream.java (original)
+++ incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/JDIOutputStream.java Mon Nov 23 15:53:48 2009
@@ -1,64 +1,64 @@
-/*******************************************************************************
- * 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.kato.tools.jdi;
-import java.io.IOException;
-import java.io.OutputStream;
-
-
-public class JDIOutputStream extends OutputStream {
-	private OutputStream outStream;
-	
-	public JDIOutputStream(OutputStream outStream){
-		this.outStream = outStream;
-	}
-	
-	@Override
-	public synchronized void write(int arg0) throws IOException {
-		outStream.write(arg0);
-			
-	}
-	
-	@Override
-	public void flush() throws IOException{
-		outStream.flush();
-	}
-	
-	@Override
-	public void write(byte [] b) throws IOException{
-		outStream.write(b);
-		
-	}
-	
-	@Override
-	public void write(byte [] b, int off, int len) throws IOException{
-		outStream.write(b, off, len);
-	}
-	
-	@Override
-	public void close() throws IOException{
-		outStream.close();
-	}
-	
-	public OutputStream getStream(){
-		return outStream;
-	}
-	
-	public void setStream(OutputStream outStream){
-		this.outStream = outStream;
-	}
-	
-	
-	
-
-}
+/*******************************************************************************
+ * 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.kato.tools.jdi;
+import java.io.IOException;
+import java.io.OutputStream;
+
+
+public class JDIOutputStream extends OutputStream {
+	private OutputStream outStream;
+	
+	public JDIOutputStream(OutputStream outStream){
+		this.outStream = outStream;
+	}
+	
+	@Override
+	public synchronized void write(int arg0) throws IOException {
+		outStream.write(arg0);
+			
+	}
+	
+	@Override
+	public void flush() throws IOException{
+		outStream.flush();
+	}
+	
+	@Override
+	public void write(byte [] b) throws IOException{
+		outStream.write(b);
+		
+	}
+	
+	@Override
+	public void write(byte [] b, int off, int len) throws IOException{
+		outStream.write(b, off, len);
+	}
+	
+	@Override
+	public void close() throws IOException{
+		outStream.close();
+	}
+	
+	public OutputStream getStream(){
+		return outStream;
+	}
+	
+	public void setStream(OutputStream outStream){
+		this.outStream = outStream;
+	}
+	
+	
+	
+
+}

Propchange: incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/JDIOutputStream.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/JDIServerContainer.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/JDIServerContainer.java?rev=883384&r1=883383&r2=883384&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/JDIServerContainer.java (original)
+++ incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/JDIServerContainer.java Mon Nov 23 15:53:48 2009
@@ -1,119 +1,119 @@
-/*******************************************************************************
- * 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.kato.tools.jdi;
-
-
-import org.apache.kato.tools.jdi.JDINotifier;
-
-/** JDIServerContainer
- * 
- * The JDIServerContainer is a thread that launches the JDI stuff.  It provides a status back to
- * the JDIServerController of it's status.  Since JDWPServer.start() waits until the VadderSocketServer
- * has stopped running, we need to hold it inside it's own thread.  We provide a pass through to allow the
- * controller to shut down the thread (kill()), and grab any errors (getLastException()).  JDWPServer.stop()
- * calls through to the JDISocketServer and manually shuts it down.  On shut down, the socket server closes
- * all known connections, and returns.  The join() with the server thread eventually returns into this thread,
- * which quits.
- */
-
-
-public class JDIServerContainer extends Thread {
-	private JDWPServer svr;
-	private JDICacher chsr;
-	private boolean isRunning = false;
-	private Exception exxy;
-	private JDINotifier notifier = null;
-	private boolean hasStarted = false;
-
-	public boolean isRunning(){
-		return isRunning;
-	}
-
-
-	public JDWPServer getJDWPServer(){
-		return svr;
-	}
-
-	public JDIServerContainer(JDWPServer svrin, JDICacher chsrin, JDINotifier not){
-		svr = svrin;
-		chsr = chsrin;
-		notifier = not;
-	}
-
-	@Override
-	public void start(){
-		//Reset exception
-		exxy = null;
-		isRunning = true;
-		//Start the socket stuff
-		try{
-			svr.start();
-
-			//Now start the thread
-			super.start();
-
-			//Wait for thread to start
-			while(!hasStarted()){}
-		}catch(Exception exxy){
-			isRunning = false;
-		}
-	}
-
-	public void	kill(){
-		if (isRunning){
-			svr.stop();
-			//If we have a notifier, tell them we've stopped running
-			if (notifier != null){
-				notifier.update(this);
-			}
-
-			//Wait to shut down
-			while(isRunning){}
-		}
-	}
-
-	public Exception getLastException(){
-		return exxy;
-	}
-
-	public boolean hasStarted(){
-		return hasStarted;
-	}
-
-	@Override
-	public void run(){
-		//If we have a notifier, tell them we've stopped running
-		if (notifier != null){
-			notifier.update(this);
-		}
-		hasStarted = true;
-
-		try{
-			//Start the JDWPServer
-			svr.getSocketServer().join();
-		}catch(Exception lexxy){
-			svr.stop();
-		}
-
-		//Make sure the cache gets written
-		chsr.commit();
-		chsr = null;
-		svr = null;
-		isRunning = false;
-		//If we have a notifier, tell them we've stopped running
-		if (notifier != null){
-			notifier.update(this);
-		}
-	}
-}
+/*******************************************************************************
+ * 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.kato.tools.jdi;
+
+
+import org.apache.kato.tools.jdi.JDINotifier;
+
+/** JDIServerContainer
+ * 
+ * The JDIServerContainer is a thread that launches the JDI stuff.  It provides a status back to
+ * the JDIServerController of it's status.  Since JDWPServer.start() waits until the VadderSocketServer
+ * has stopped running, we need to hold it inside it's own thread.  We provide a pass through to allow the
+ * controller to shut down the thread (kill()), and grab any errors (getLastException()).  JDWPServer.stop()
+ * calls through to the JDISocketServer and manually shuts it down.  On shut down, the socket server closes
+ * all known connections, and returns.  The join() with the server thread eventually returns into this thread,
+ * which quits.
+ */
+
+
+public class JDIServerContainer extends Thread {
+	private JDWPServer svr;
+	private JDICacher chsr;
+	private boolean isRunning = false;
+	private Exception exxy;
+	private JDINotifier notifier = null;
+	private boolean hasStarted = false;
+
+	public boolean isRunning(){
+		return isRunning;
+	}
+
+
+	public JDWPServer getJDWPServer(){
+		return svr;
+	}
+
+	public JDIServerContainer(JDWPServer svrin, JDICacher chsrin, JDINotifier not){
+		svr = svrin;
+		chsr = chsrin;
+		notifier = not;
+	}
+
+	@Override
+	public void start(){
+		//Reset exception
+		exxy = null;
+		isRunning = true;
+		//Start the socket stuff
+		try{
+			svr.start();
+
+			//Now start the thread
+			super.start();
+
+			//Wait for thread to start
+			while(!hasStarted()){}
+		}catch(Exception exxy){
+			isRunning = false;
+		}
+	}
+
+	public void	kill(){
+		if (isRunning){
+			svr.stop();
+			//If we have a notifier, tell them we've stopped running
+			if (notifier != null){
+				notifier.update(this);
+			}
+
+			//Wait to shut down
+			while(isRunning){}
+		}
+	}
+
+	public Exception getLastException(){
+		return exxy;
+	}
+
+	public boolean hasStarted(){
+		return hasStarted;
+	}
+
+	@Override
+	public void run(){
+		//If we have a notifier, tell them we've stopped running
+		if (notifier != null){
+			notifier.update(this);
+		}
+		hasStarted = true;
+
+		try{
+			//Start the JDWPServer
+			svr.getSocketServer().join();
+		}catch(Exception lexxy){
+			svr.stop();
+		}
+
+		//Make sure the cache gets written
+		chsr.commit();
+		chsr = null;
+		svr = null;
+		isRunning = false;
+		//If we have a notifier, tell them we've stopped running
+		if (notifier != null){
+			notifier.update(this);
+		}
+	}
+}

Propchange: incubator/kato/trunk/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/JDIServerContainer.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message