Author: ron.sigal(a)jboss.com
Date: 2008-08-05 23:47:08 -0400 (Tue, 05 Aug 2008)
New Revision: 4468
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java
Log:
JBREM-1019: Moved retrieval of parent first classloading parameter to new init() method.
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java
===================================================================
---
remoting2/branches/2.x/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java 2008-08-05
23:28:58 UTC (rev 4467)
+++
remoting2/branches/2.x/src/main/org/jboss/remoting/MicroRemoteClientInvoker.java 2008-08-06
03:47:08 UTC (rev 4468)
@@ -45,17 +45,20 @@
private final Object clientLeaseLock = new Object();
private LeasePinger leasePinger = null;
private String invokerSessionID = new GUID().toString();
+ protected boolean parentFirstClassLoading = true;
protected List connectHomes;
public MicroRemoteClientInvoker(InvokerLocator locator)
{
super(locator);
+ init();
}
public MicroRemoteClientInvoker(InvokerLocator locator, Map configuration)
{
super(locator, configuration);
+ init();
}
/**
@@ -117,19 +120,6 @@
// classes. If possible, will simply reset context classloader on existing
// RemotingClassLoader.
final ClassLoader contextClassLoader =
SecurityUtility.getContextClassLoader(Thread.currentThread());
- // Get the parent delegation order flag, default is parent first
- Object flag =
super.getConfiguration().get(Remoting.CLASSLOADING_PARENT_FIRST_DELEGATION);
- if(flag == null)
- {
- // Fallback to the system property
- flag =
SecurityUtility.getSystemProperty(Remoting.CLASSLOADING_PARENT_FIRST_DELEGATION_PROP);
- }
- boolean parentFirst = true;
- if (flag != null)
- {
- String sflag = flag.toString();
- parentFirst = Boolean.valueOf(sflag).booleanValue();
- }
if (unmarshaller instanceof UpdateableClassloaderUnMarshaller)
{
UpdateableClassloaderUnMarshaller uclum = (UpdateableClassloaderUnMarshaller)
unmarshaller;
@@ -141,13 +131,13 @@
}
else
{
- rcl = SecurityUtility.createRemotingClassLoader(getClassLoader(),
contextClassLoader, parentFirst);
+ rcl = SecurityUtility.createRemotingClassLoader(getClassLoader(),
contextClassLoader, parentFirstClassLoading);
unmarshaller.setClassLoader(rcl);
}
}
else
{
- rcl = SecurityUtility.createRemotingClassLoader(getClassLoader(),
contextClassLoader, parentFirst);
+ rcl = SecurityUtility.createRemotingClassLoader(getClassLoader(),
contextClassLoader, parentFirstClassLoading);
unmarshaller.setClassLoader(rcl);
}
}
@@ -535,6 +525,24 @@
}
return type;
}
+
+ protected void init()
+ {
+ // Get the parent delegation order flag, default is parent first
+ Object flag =
super.getConfiguration().get(Remoting.CLASSLOADING_PARENT_FIRST_DELEGATION);
+ if(flag == null)
+ {
+ // Fallback to the system property
+ flag =
SecurityUtility.getSystemProperty(Remoting.CLASSLOADING_PARENT_FIRST_DELEGATION_PROP);
+ }
+ boolean parentFirst = true;
+ if (flag != null)
+ {
+ String sflag = flag.toString();
+ parentFirst = Boolean.valueOf(sflag).booleanValue();
+ }
+ parentFirstClassLoading = parentFirst;
+ }
/**
* Each implementation of the remote client invoker should have
Show replies by date