summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES6
-rw-r--r--config/PropertyNames.xml2
-rw-r--r--cpp/src/Ice/PropertyNames.cpp3
-rw-r--r--cpp/src/Ice/PropertyNames.h2
-rw-r--r--cs/src/Ice/PropertyNames.cs3
-rw-r--r--java/src/Ice/AsyncResult.java36
-rw-r--r--java/src/IceInternal/Incoming.java4
-rw-r--r--java/src/IceInternal/Instance.java8
-rw-r--r--java/src/IceInternal/PropertyNames.java3
9 files changed, 53 insertions, 14 deletions
diff --git a/CHANGES b/CHANGES
index ea3ebfeb9f8..7488783ce45 100644
--- a/CHANGES
+++ b/CHANGES
@@ -77,10 +77,10 @@ General Changes
Java Changes
============
-- Added support for Ice.UseServantClassLoader configuration
+- Added support for Ice.UseApplicationClassLoader configuration
property. When set to 1, the Ice core will set the thread context
- class loader to the class loader of the servant before dispatching
- the call.
+ class loader to the class loader of the servant or AMI callback
+ before dispatching the call.
======================================================================
diff --git a/config/PropertyNames.xml b/config/PropertyNames.xml
index 40c3c8555db..9fe7f38b2bb 100644
--- a/config/PropertyNames.xml
+++ b/config/PropertyNames.xml
@@ -370,7 +370,7 @@ generated from the section label.
<property name="TCP.Backlog" />
<property name="TCP.RcvSize" />
<property name="TCP.SndSize" />
- <property name="UseServantClassLoader" />
+ <property name="UseApplicationClassLoader" />
<property name="UseSyslog" />
<property name="Warn.AMICallback" />
<property name="Warn.Connections" />
diff --git a/cpp/src/Ice/PropertyNames.cpp b/cpp/src/Ice/PropertyNames.cpp
index 856149c1da0..6fe0c633e4e 100644
--- a/cpp/src/Ice/PropertyNames.cpp
+++ b/cpp/src/Ice/PropertyNames.cpp
@@ -8,7 +8,7 @@
// **********************************************************************
//
-// Generated by makeprops.py from file ../config/PropertyNames.xml, Tue Nov 20 23:07:17 2012
+// Generated by makeprops.py from file ./config/PropertyNames.xml, Fri Jan 18 14:06:41 2013
// IMPORTANT: Do not edit this file -- any edits made here will be lost!
@@ -140,6 +140,7 @@ const IceInternal::Property IcePropsData[] =
IceInternal::Property("Ice.TCP.Backlog", false, 0),
IceInternal::Property("Ice.TCP.RcvSize", false, 0),
IceInternal::Property("Ice.TCP.SndSize", false, 0),
+ IceInternal::Property("Ice.UseUserClassLoader", false, 0),
IceInternal::Property("Ice.UseSyslog", false, 0),
IceInternal::Property("Ice.Warn.AMICallback", false, 0),
IceInternal::Property("Ice.Warn.Connections", false, 0),
diff --git a/cpp/src/Ice/PropertyNames.h b/cpp/src/Ice/PropertyNames.h
index 9afe5a21c9f..6567bae2c0c 100644
--- a/cpp/src/Ice/PropertyNames.h
+++ b/cpp/src/Ice/PropertyNames.h
@@ -8,7 +8,7 @@
// **********************************************************************
//
-// Generated by makeprops.py from file ../config/PropertyNames.xml, Tue Nov 20 23:07:17 2012
+// Generated by makeprops.py from file ./config/PropertyNames.xml, Fri Jan 18 14:06:41 2013
// IMPORTANT: Do not edit this file -- any edits made here will be lost!
diff --git a/cs/src/Ice/PropertyNames.cs b/cs/src/Ice/PropertyNames.cs
index 593be11d702..26570ad95d9 100644
--- a/cs/src/Ice/PropertyNames.cs
+++ b/cs/src/Ice/PropertyNames.cs
@@ -8,7 +8,7 @@
// **********************************************************************
//
-// Generated by makeprops.py from file ../config/PropertyNames.xml, Tue Nov 20 23:07:17 2012
+// Generated by makeprops.py from file ./config/PropertyNames.xml, Fri Jan 18 14:06:41 2013
// IMPORTANT: Do not edit this file -- any edits made here will be lost!
@@ -142,6 +142,7 @@ namespace IceInternal
new Property(@"^Ice\.TCP\.Backlog$", false, null),
new Property(@"^Ice\.TCP\.RcvSize$", false, null),
new Property(@"^Ice\.TCP\.SndSize$", false, null),
+ new Property(@"^Ice\.UseUserClassLoader$", false, null),
new Property(@"^Ice\.UseSyslog$", false, null),
new Property(@"^Ice\.Warn\.AMICallback$", false, null),
new Property(@"^Ice\.Warn\.Connections$", false, null),
diff --git a/java/src/Ice/AsyncResult.java b/java/src/Ice/AsyncResult.java
index dbde144ddef..8d70697c944 100644
--- a/java/src/Ice/AsyncResult.java
+++ b/java/src/Ice/AsyncResult.java
@@ -278,6 +278,11 @@ public class AsyncResult
if(_callback != null)
{
+ if(_instance.useApplicationClassLoader())
+ {
+ Thread.currentThread().setContextClassLoader(_callback.getClass().getClassLoader());
+ }
+
try
{
_callback.__completed(this);
@@ -294,6 +299,13 @@ public class AsyncResult
{
__error(exc);
}
+ finally
+ {
+ if(_instance.useApplicationClassLoader())
+ {
+ Thread.currentThread().setContextClassLoader(null);
+ }
+ }
}
if(_observer != null)
@@ -312,6 +324,11 @@ public class AsyncResult
if(_callback != null)
{
+ if(_instance.useApplicationClassLoader())
+ {
+ Thread.currentThread().setContextClassLoader(_callback.getClass().getClassLoader());
+ }
+
try
{
_callback.__sent(this);
@@ -328,6 +345,13 @@ public class AsyncResult
{
__error(exc);
}
+ finally
+ {
+ if(_instance.useApplicationClassLoader())
+ {
+ Thread.currentThread().setContextClassLoader(null);
+ }
+ }
}
if(_observer != null)
@@ -436,6 +460,11 @@ public class AsyncResult
if(_callback != null)
{
+ if(_instance.useApplicationClassLoader())
+ {
+ Thread.currentThread().setContextClassLoader(_callback.getClass().getClassLoader());
+ }
+
try
{
_callback.__completed(this);
@@ -452,6 +481,13 @@ public class AsyncResult
{
__error(exc);
}
+ finally
+ {
+ if(_instance.useApplicationClassLoader())
+ {
+ Thread.currentThread().setContextClassLoader(null);
+ }
+ }
}
if(_observer != null)
diff --git a/java/src/IceInternal/Incoming.java b/java/src/IceInternal/Incoming.java
index 1bb01d0ef68..f9c194b89f8 100644
--- a/java/src/IceInternal/Incoming.java
+++ b/java/src/IceInternal/Incoming.java
@@ -208,7 +208,7 @@ final public class Incoming extends IncomingBase implements Ice.Request
{
if(_servant != null)
{
- if(_instance.useServantClassLoader())
+ if(_instance.useApplicationClassLoader())
{
Thread.currentThread().setContextClassLoader(_servant.getClass().getClassLoader());
}
@@ -229,7 +229,7 @@ final public class Incoming extends IncomingBase implements Ice.Request
}
finally
{
- if(_instance.useServantClassLoader())
+ if(_instance.useApplicationClassLoader())
{
Thread.currentThread().setContextClassLoader(null);
}
diff --git a/java/src/IceInternal/Instance.java b/java/src/IceInternal/Instance.java
index 3f21329b6d9..c21c40337b0 100644
--- a/java/src/IceInternal/Instance.java
+++ b/java/src/IceInternal/Instance.java
@@ -616,9 +616,9 @@ public final class Instance
}
public boolean
- useServantClassLoader()
+ useApplicationClassLoader()
{
- return _useServantClassLoader;
+ return _useApplicationClassLoader;
}
//
@@ -717,7 +717,7 @@ public final class Instance
_packages = validatePackages();
- _useServantClassLoader = _initData.properties.getPropertyAsInt("Ice.UseServantClassLoader") > 0;
+ _useApplicationClassLoader = _initData.properties.getPropertyAsInt("Ice.UseApplicationClassLoader") > 0;
_traceLevels = new TraceLevels(_initData.properties);
@@ -1218,7 +1218,7 @@ public final class Instance
private java.util.Map<String, String> _typeToClassMap = new java.util.HashMap<String, String>();
final private String[] _packages;
- final private boolean _useServantClassLoader;
+ final private boolean _useApplicationClassLoader;
private static boolean _oneOffDone = false;
}
diff --git a/java/src/IceInternal/PropertyNames.java b/java/src/IceInternal/PropertyNames.java
index 00836e59a4c..30d8bc6b11c 100644
--- a/java/src/IceInternal/PropertyNames.java
+++ b/java/src/IceInternal/PropertyNames.java
@@ -8,7 +8,7 @@
// **********************************************************************
//
-// Generated by makeprops.py from file ../config/PropertyNames.xml, Tue Nov 20 23:07:17 2012
+// Generated by makeprops.py from file ./config/PropertyNames.xml, Fri Jan 18 14:06:41 2013
// IMPORTANT: Do not edit this file -- any edits made here will be lost!
@@ -142,6 +142,7 @@ public final class PropertyNames
new Property("Ice\\.TCP\\.Backlog", false, null),
new Property("Ice\\.TCP\\.RcvSize", false, null),
new Property("Ice\\.TCP\\.SndSize", false, null),
+ new Property("Ice\\.UseUserClassLoader", false, null),
new Property("Ice\\.UseSyslog", false, null),
new Property("Ice\\.Warn\\.AMICallback", false, null),
new Property("Ice\\.Warn\\.Connections", false, null),