openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject svn commit: r1734842 - /openwebbeans/cms-site/trunk/content/owbconfig.mdtext
Date Sun, 13 Mar 2016 19:20:35 GMT
Author: struberg
Date: Sun Mar 13 19:20:35 2016
New Revision: 1734842

add allowProxying and proxy mapping documentation


Modified: openwebbeans/cms-site/trunk/content/owbconfig.mdtext
--- openwebbeans/cms-site/trunk/content/owbconfig.mdtext (original)
+++ openwebbeans/cms-site/trunk/content/owbconfig.mdtext Sun Mar 13 19:20:35 2016
@@ -141,15 +141,58 @@ Boolean values can either be <code>true<
             cannot properly handle Java8 (mostly due to older Eclipse JDT versions).
+    <li style="border-bottom: dashed; border-width: 1px">
+        <p><code>javax.enterprise.inject.allowProxying.classes</code></p>
+        <p>
+            Environment property which comma separated list of classes which
+            should NOT fail with an UnproxyableResolutionException.
+            You only have to configure additional classes in your
+            All the configured values get added together into a big List.
+        </p>
+        <p>By default we allow the following classes: <code>java.util.HashMap</code>
and <code>java.util.Calendar</code>
+        </p>
+    </li>
 ## Proxy Mapping
 OpenWebBeans enables the user to define the NormalScope handlers for specific scopes.
-This allows for more aggressive caching than with the generic ``NormalScopedBeanInterceptorHandler``.
+This allows for more aggressive caching than with the generic ``NormalScopedBeanInterceptorHandler``
which is the default.
+The default NormalScope handler will look up the Contextual Instance in the respective Context
for each and every
+method invocation on the proxy.
+But sometimes we can much more aggressively cache the instances.
+E.g. for ``@ApplicationScoped`` beans we can keep
+the contextual instance inside the proxy, making it as fast as a pure Java instance - but
still gaining
+all the benefits of CDI!
+For ``@RequestScoped`` and ``@SessionScoped`` we can use a NormalScope handler which caches
the Contextual Instance
+in a ThreadLocal.
+By default the following NormalScope handlers get used:
+    =org.apache.webbeans.intercept.ApplicationScopedBeanInterceptorHandler
+    =org.apache.webbeans.intercept.RequestScopedBeanInterceptorHandler
+    =org.apache.webbeans.intercept.SessionScopedBeanInterceptorHandler
+As you can see we use a prefix ``org.apache.webbeans.proxy.mapping.`` followed by the fully
+scope name as key. The value represents the fully qualified name of the handler class. This
class must extend
+``org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler`` and implement the
+``Object getContextualInstance()`` method.
+If you have a custom scope which spans a Request or longer then you can simply reuse the
+``RequestScopedBeanInterceptorHandler`` as shown in the following example:
+    =org.apache.webbeans.intercept.RequestScopedBeanInterceptorHandler
 ##Enable FailOver / Session Replication support

View raw message