This is an automated email from the ASF dual-hosted git repository.
rmannibucau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwebbeans.git
The following commit(s) were added to refs/heads/master by this push:
new 50a9746 OWB-1316 make event bus faster when using Event class
50a9746 is described below
commit 50a97460d3e824f298c52f98195a7d7ea5ac52af
Author: Romain Manni-Bucau
AuthorDate: Wed Mar 11 16:09:26 2020 +0100
OWB-1316 make event bus faster when using Event class
---
.../webbeans/annotation/AnnotationManager.java | 1 +
.../apache/webbeans/config/WebBeansContext.java| 12 ++
.../webbeans/context/AbstractContextsService.java | 19 ++
.../webbeans/corespi/se/BaseSeContextsService.java | 33 +++-
.../java/org/apache/webbeans/event/EventImpl.java | 174 -
.../apache/webbeans/event/NotificationManager.java | 215 -
.../apache/webbeans/event/ObserverMethodImpl.java | 43 +++--
.../webbeans/web/context/WebContextsService.java | 17 --
8 files changed, 379 insertions(+), 135 deletions(-)
diff --git
a/webbeans-impl/src/main/java/org/apache/webbeans/annotation/AnnotationManager.java
b/webbeans-impl/src/main/java/org/apache/webbeans/annotation/AnnotationManager.java
index 771be4b..24033f4 100644
---
a/webbeans-impl/src/main/java/org/apache/webbeans/annotation/AnnotationManager.java
+++
b/webbeans-impl/src/main/java/org/apache/webbeans/annotation/AnnotationManager.java
@@ -417,6 +417,7 @@ public final class AnnotationManager
{
// performance hack to avoid Set creation
checkQualifierConditions(qualifierAnnots[0]);
+return;
}
Set annSet = ArrayUtil.asSet(qualifierAnnots);
diff --git
a/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java
b/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java
index 848162f..c12eff6 100644
---
a/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java
+++
b/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java
@@ -66,6 +66,7 @@ import org.apache.webbeans.spi.ConversationService;
import org.apache.webbeans.spi.LoaderService;
import org.apache.webbeans.spi.ScannerService;
import org.apache.webbeans.spi.SecurityService;
+import org.apache.webbeans.spi.TransactionService;
import org.apache.webbeans.spi.plugins.OpenWebBeansPlugin;
import org.apache.webbeans.util.ClassUtil;
import org.apache.webbeans.util.WebBeansUtil;
@@ -114,6 +115,7 @@ public class WebBeansContext
private ConversationService conversationService;
private final ApplicationBoundaryService applicationBoundaryService;
private final NotificationManager notificationManager;
+private TransactionService transactionService;
public WebBeansContext()
@@ -342,6 +344,16 @@ public class WebBeansContext
return subclassProxyFactory;
}
+public TransactionService getTransactionService() // used in event bus so
ensure it is a plain getter at runtime
+{
+if (transactionService == null)
+{
+// lazy init
+transactionService = getService(TransactionService.class);
+}
+return transactionService;
+}
+
public ScannerService getScannerService()
{
if (scannerService == null)
diff --git
a/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContextsService.java
b/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContextsService.java
index a1f2033..43ec3c0 100644
---
a/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContextsService.java
+++
b/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContextsService.java
@@ -26,9 +26,13 @@ import javax.enterprise.context.ContextException;
import javax.enterprise.context.SessionScoped;
import javax.enterprise.context.spi.Context;
+import org.apache.webbeans.annotation.BeforeDestroyedLiteral;
+import org.apache.webbeans.annotation.DestroyedLiteral;
+import org.apache.webbeans.annotation.InitializedLiteral;
import org.apache.webbeans.config.WebBeansContext;
import org.apache.webbeans.conversation.ConversationImpl;
import org.apache.webbeans.conversation.ConversationManager;
+import org.apache.webbeans.event.NotificationManager;
import org.apache.webbeans.spi.ContextsService;
public abstract class AbstractContextsService implements ContextsService
@@ -37,6 +41,7 @@ public abstract class AbstractContextsService implements
ContextsService
protected boolean supportsConversation;
+protected Boolean fireRequestLifecycleEvents;
protected AbstractContextsService(WebBeansContext webBeansContext)
{
@@ -137,4 +142,18 @@ public abstract class AbstractContextsService implements
ContextsService
{
return supportsConversation;
}
+
+protected boolean shouldFireRequestLifecycleEvents()
+{
+