openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1734847 - /openwebbeans/cms-site/trunk/content/owbconfig.mdtext
Date Sun, 13 Mar 2016 19:47:50 GMT
Author: struberg
Date: Sun Mar 13 19:47:50 2016
New Revision: 1734847

URL: http://svn.apache.org/viewvc?rev=1734847&view=rev
Log:
improve proxy mapping docs

Modified:
    openwebbeans/cms-site/trunk/content/owbconfig.mdtext

Modified: openwebbeans/cms-site/trunk/content/owbconfig.mdtext
URL: http://svn.apache.org/viewvc/openwebbeans/cms-site/trunk/content/owbconfig.mdtext?rev=1734847&r1=1734846&r2=1734847&view=diff
==============================================================================
--- openwebbeans/cms-site/trunk/content/owbconfig.mdtext (original)
+++ openwebbeans/cms-site/trunk/content/owbconfig.mdtext Sun Mar 13 19:47:50 2016
@@ -158,18 +158,23 @@ Boolean values can either be <code>true<
 ## Proxy Mapping
 
 OpenWebBeans enables the user to define the NormalScope handlers for specific scopes.
+
+NormalScope handlers are used by OpenWebBeans' proxies to resolve the 'Contextual Instance'.
+E.g. for a ``@SessionScoped User`` injected into some other class, this is exactly the piece
of code
+which goes into the current Http Session and gets the User instance from there.
+This class must extend ``org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler``
and overwrite the
+``Object getContextualInstance()`` method.
+
 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!
+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.
+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:
 <pre>
@@ -181,21 +186,18 @@ org.apache.webbeans.proxy.mapping.javax.
     =org.apache.webbeans.intercept.SessionScopedBeanInterceptorHandler
 </pre>
 
-As you can see we use a prefix ``org.apache.webbeans.proxy.mapping.`` followed by the fully
qualified
-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.
+As you can see we use a prefix ``org.apache.webbeans.proxy.mapping.`` followed by the fully
qualified scope name as key.
+The value represents the fully qualified name of the handler class.
 
-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:
+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:
 
 <pre>
 org.apache.webbeans.proxy.mapping.org.apache.deltaspike.core.api.scope.ViewAccessScoped
     =org.apache.webbeans.intercept.RequestScopedBeanInterceptorHandler
 </pre>
 
-##Enable FailOver / Session Replication support
 
+##Enable FailOver / Session Replication support
 
 #### Since OpenWebBeans-1.5.0
 



Mime
View raw message