Kaydet (Commit) fd4b5571 authored tarafından Kay Ramme's avatar Kay Ramme

removed unnecessary synchronizeds; correct _message_count (#84611#)

üst 8fa11b23
......@@ -2,9 +2,9 @@
*
* $RCSfile: urp.java,v $
*
* $Revision: 1.4 $
* $Revision: 1.5 $
*
* last change: $Author: kr $ $Date: 2001-02-02 09:01:04 $
* last change: $Author: kr $ $Date: 2001-03-12 15:46:07 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -95,7 +95,7 @@ import com.sun.star.uno.Type;
* from uno. The functionality is reachable through
* the <code>IProtocol</code> interface.
* <p>
* @version $Revision: 1.4 $ $ $Date: 2001-02-02 09:01:04 $
* @version $Revision: 1.5 $ $ $Date: 2001-03-12 15:46:07 $
* @author Kay Ramme
* @see com.sun.star.lib.uno.environments.remote.IProtocol
* @since UDK1.0
......@@ -342,7 +342,6 @@ public class urp extends Protocol {
return result;
}
public void writeRequest(String oid,
TypeDescription zInterface,
String operation,
......@@ -355,7 +354,7 @@ public class urp extends Protocol {
++ _requestsSend;
++ _message_count;
synchronized(_marshal) {
MethodDescription methodDescription = zInterface.getMethodDescription(operation);
byte header = 0;
......@@ -472,12 +471,12 @@ public class urp extends Protocol {
if(synchron[0].booleanValue()) // if we are waiting for a reply, the reply is pending
putPendingRequest(_out_threadId, new Object[]{params, out_sig, methodDescription.getReturnSig()});
}
}
public void writeReply(boolean exception, ThreadID threadId, Object result) throws Exception {
if(DEBUG) System.err.println("##### " + getClass().getName() + ".writeReply:" + exception + " " + threadId + " " + result);
synchronized(_marshal) {
++ _message_count;
Object objects[] = (Object[])removePendingReply(threadId);
Object params[] = (Object[])objects[0];
TypeDescription signature[] = (TypeDescription[])objects[1];
......@@ -513,7 +512,6 @@ public class urp extends Protocol {
if(signature[i] != null)
_marshal.writeObject(signature[i].getComponentType(), Array.get(params[i], 0));
}
}
private byte []readBlock(DataInput dataInput) throws Exception {
......@@ -532,6 +530,9 @@ public class urp extends Protocol {
private void writeBlock(DataOutput dataOutput, byte bytes[], int message_count) throws Exception {
if(DEBUG) System.err.println("##### " + getClass().getName() + ".writeBlock: size:" + bytes.length + " message_count:" + message_count);
if(message_count != 1)
System.err.println("##### " + getClass().getName() + ".writeBlock: size:" + bytes.length + " message_count:" + message_count);
dataOutput.writeInt(bytes.length);
dataOutput.writeInt(message_count);
......@@ -667,9 +668,12 @@ public class urp extends Protocol {
public void flush(DataOutput dataOutput) throws Exception {
if(_message_count > 0) {
writeBlock(dataOutput, _marshal.reset(), _message_count);
_message_count = 0;
}
}
public IMarshal createMarshal() {
return new Marshal(_iBridge, __cache_size);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment