Author: ron.sigal(a)jboss.com
Date: 2008-02-22 17:32:34 -0500 (Fri, 22 Feb 2008)
New Revision: 3489
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java
Log:
JBREM-900: (1) In invoke() put marshaller set up in synchronized block; (2) removed
synchronization from getUnMarshaller(), setUnMarshaller().
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java
===================================================================
---
remoting2/branches/2.x/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java 2008-02-22
22:24:19 UTC (rev 3488)
+++
remoting2/branches/2.x/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java 2008-02-22
22:32:34 UTC (rev 3489)
@@ -68,31 +68,31 @@
if (trace) { log.trace(this + "(" + (++invokeCount) + ") invoking
" + invocationReq); }
- // Set up marshaller.
- Marshaller marshaller = getMarshaller();
- if (marshaller == null)
+ // Set up marshaller and unmarshaller.
+ Marshaller marshaller = null;
+ UnMarshaller unmarshaller = null;
+ RemotingClassLoader rcl = null;
+ synchronized (MicroRemoteClientInvoker.class)
{
- // try by locator (in case marshaller class name specified)
- marshaller = MarshalFactory.getMarshaller(getLocator(), getClassLoader());
+ marshaller = getMarshaller();
if (marshaller == null)
{
- // need to have a marshaller, so create a default one
- marshaller = MarshalFactory.getMarshaller(getDataType(),
getSerializationType());
+ // try by locator (in case marshaller class name specified)
+ marshaller = MarshalFactory.getMarshaller(getLocator(), getClassLoader());
if (marshaller == null)
{
- // went as far as possible to find a marshaller, will have to give up
- throw new InvalidMarshallingResource(
- "Can not find a valid marshaller for data type: " +
getDataType());
+ // need to have a marshaller, so create a default one
+ marshaller = MarshalFactory.getMarshaller(getDataType(),
getSerializationType());
+ if (marshaller == null)
+ {
+ // went as far as possible to find a marshaller, will have to give up
+ throw new InvalidMarshallingResource(
+ "Can not find a valid marshaller for data type: " +
getDataType());
+ }
}
+ setMarshaller(marshaller);
}
- setMarshaller(marshaller);
- }
-
- // Set up unmarshaller.
- UnMarshaller unmarshaller = null;
- RemotingClassLoader rcl = null;
- synchronized (unmarshallers)
- {
+
unmarshaller = getUnMarshaller();
if (unmarshaller == null)
{
@@ -350,18 +350,12 @@
public void setUnMarshaller(UnMarshaller unmarshaller)
{
- synchronized (unmarshallers)
- {
- unmarshallers.put(Thread.currentThread().getContextClassLoader(),
unmarshaller);
- }
+ unmarshallers.put(Thread.currentThread().getContextClassLoader(), unmarshaller);
}
public UnMarshaller getUnMarshaller()
{
- synchronized (unmarshallers)
- {
- return
(UnMarshaller)unmarshallers.get(Thread.currentThread().getContextClassLoader());
- }
+ return
(UnMarshaller)unmarshallers.get(Thread.currentThread().getContextClassLoader());
}
public String getSessionId()
Show replies by date