Return-Path: X-Original-To: apmail-openwebbeans-commits-archive@www.apache.org Delivered-To: apmail-openwebbeans-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BC09C18ACD for ; Sun, 13 Mar 2016 19:47:58 +0000 (UTC) Received: (qmail 45761 invoked by uid 500); 13 Mar 2016 19:47:58 -0000 Delivered-To: apmail-openwebbeans-commits-archive@openwebbeans.apache.org Received: (qmail 45733 invoked by uid 500); 13 Mar 2016 19:47:58 -0000 Mailing-List: contact commits-help@openwebbeans.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openwebbeans.apache.org Delivered-To: mailing list commits@openwebbeans.apache.org Received: (qmail 45720 invoked by uid 99); 13 Mar 2016 19:47:58 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Mar 2016 19:47:58 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 3E5BB180315 for ; Sun, 13 Mar 2016 19:47:58 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.471 X-Spam-Level: * X-Spam-Status: No, score=1.471 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-0.329] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 0gH6-vhbb8w2 for ; Sun, 13 Mar 2016 19:47:57 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id A7C915F620 for ; Sun, 13 Mar 2016 19:47:56 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id E708BE0313 for ; Sun, 13 Mar 2016 19:47:55 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id E88C33A0249 for ; Sun, 13 Mar 2016 19:47:55 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r982671 - in /websites/staging/openwebbeans/trunk/content: ./ owbconfig.html Date: Sun, 13 Mar 2016 19:47:55 -0000 To: commits@openwebbeans.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20160313194755.E88C33A0249@svn01-us-west.apache.org> Author: buildbot Date: Sun Mar 13 19:47:55 2016 New Revision: 982671 Log: Staging update by buildbot for openwebbeans Modified: websites/staging/openwebbeans/trunk/content/ (props changed) websites/staging/openwebbeans/trunk/content/owbconfig.html Propchange: websites/staging/openwebbeans/trunk/content/ ------------------------------------------------------------------------------ --- cms:source-revision (original) +++ cms:source-revision Sun Mar 13 19:47:55 2016 @@ -1 +1 @@ -1734842 +1734847 Modified: websites/staging/openwebbeans/trunk/content/owbconfig.html ============================================================================== --- websites/staging/openwebbeans/trunk/content/owbconfig.html (original) +++ websites/staging/openwebbeans/trunk/content/owbconfig.html Sun Mar 13 19:47:55 2016 @@ -204,16 +204,19 @@ by the integration regarding to the spec

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 which is the default. +

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!

-

For @RequestScoped and @SessionScoped we can use a NormalScope handler which caches the Contextual Instance -in a ThreadLocal.

+

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.proxy.mapping.javax.enterprise.context.ApplicationScoped
@@ -223,12 +226,9 @@ org.apache.webbeans.proxy.mapping.javax.
 org.apache.webbeans.proxy.mapping.javax.enterprise.context.SessionScoped
     =org.apache.webbeans.intercept.SessionScopedBeanInterceptorHandler
 

-

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.

-

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:

+

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:

 org.apache.webbeans.proxy.mapping.org.apache.deltaspike.core.api.scope.ViewAccessScoped
     =org.apache.webbeans.intercept.RequestScopedBeanInterceptorHandler