+
+ String driverBundleName = null;
+ if (bundleContext != null)
+ driverBundleName = bundleContext.getBundle()
+ .getSymbolicName();
+
+ if (applicationContext != null && cacheObjects) {
+ try {
+ String ref = request.getRef();
+ if (applicationContext.containsBean(ref)) {
+ Object obj = applicationContext
+ .getBean(request.getRef());
+ request.setCachedObject(obj);
+ if (log.isTraceEnabled())
+ log.trace("Cached bean '" + ref
+ + "' in request " + request);
+ } else {
+ log
+ .warn("Cannot cache object in request because no bean '"
+ + ref
+ + "' was found in application context"
+ + (driverBundleName != null ? " (driver bundle "
+ + driverBundleName
+ + ")"
+ : ""));
+ }
+ } catch (Exception e) {
+ if (log.isTraceEnabled())
+ log
+ .trace("Could not retrieve "
+ + request.getRef()
+ + " from driver application context because of "
+ + e);
+ driverBundleName = null;// do not publish bundle
+ // name
+ }
+ }
+
+ if (driverBundleName != null)
+ request.getProperties().put(
+ Constants.BUNDLE_SYMBOLICNAME,
+ driverBundleName);
+