geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1796216 - in /geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise: event/ImmutableNotificationOptions.java event/NotificationOptions.java inject/spi/BeforeBeanDiscovery.java
Date Thu, 25 May 2017 22:17:31 GMT
Author: struberg
Date: Thu May 25 22:17:30 2017
New Revision: 1796216

URL: http://svn.apache.org/viewvc?rev=1796216&view=rev
Log:
GERONIMO-6553 add NotificationOptions et al

Added:
    geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/event/ImmutableNotificationOptions.java
  (with props)
    geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/event/NotificationOptions.java
  (with props)
Modified:
    geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/BeforeBeanDiscovery.java

Added: geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/event/ImmutableNotificationOptions.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/event/ImmutableNotificationOptions.java?rev=1796216&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/event/ImmutableNotificationOptions.java
(added)
+++ geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/event/ImmutableNotificationOptions.java
Thu May 25 22:17:30 2017
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package javax.enterprise.event;
+
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.Executor;
+
+/**
+ * Used to configure ObserverMethod notifications
+ */
+class ImmutableNotificationOptions implements NotificationOptions
+{
+    private final Executor executor;
+    private final Map<String, Object> options;
+
+    private ImmutableNotificationOptions(Executor executor, Map<String, Object> options)
+    {
+        this.executor = executor;
+        this.options = options;
+    }
+
+    @Override
+    public Executor getExecutor()
+    {
+        return executor;
+    }
+
+    @Override
+    public Object get(String optionKey)
+    {
+        return options.get(optionKey);
+    }
+
+    static class Builder implements NotificationOptions.Builder
+    {
+        private Executor executor;
+        private Map<String, Object> options = new HashMap<>();
+
+        @Override
+        public NotificationOptions.Builder setExecutor(Executor executor)
+        {
+            this.executor = executor;
+            return this;
+        }
+
+        @Override
+        public NotificationOptions.Builder set(String optionKey, Object value)
+        {
+            options.put(optionKey, value);
+            return this;
+        }
+
+        @Override
+        public NotificationOptions build()
+        {
+            return new ImmutableNotificationOptions(executor, options);
+        }
+    }
+}

Propchange: geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/event/ImmutableNotificationOptions.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/event/NotificationOptions.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/event/NotificationOptions.java?rev=1796216&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/event/NotificationOptions.java
(added)
+++ geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/event/NotificationOptions.java
Thu May 25 22:17:30 2017
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package javax.enterprise.event;
+
+import java.util.concurrent.Executor;
+
+/**
+ * Used to configure ObserverMethod notifications
+ */
+public interface NotificationOptions
+{
+
+    /**
+     * @return the Executor used for async events
+     */
+    Executor getExecutor();
+
+
+    Object get(String optionKey);
+
+    static NotificationOptions ofExecutor(Executor executor)
+    {
+        return builder().setExecutor(executor).build();
+    }
+
+
+    static Builder builder()
+    {
+        return new ImmutableNotificationOptions.Builder();
+    }
+
+
+    interface Builder
+    {
+        Builder setExecutor(Executor executor);
+
+        Builder set(String optionKey, Object value);
+
+        NotificationOptions build();
+    }
+}

Propchange: geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/event/NotificationOptions.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/BeforeBeanDiscovery.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/BeforeBeanDiscovery.java?rev=1796216&r1=1796215&r2=1796216&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/BeforeBeanDiscovery.java
(original)
+++ geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/BeforeBeanDiscovery.java
Thu May 25 22:17:30 2017
@@ -106,12 +106,12 @@ public interface BeforeBeanDiscovery
      * @param <T>
      * @return a new annotated type configurator to create an InterceptorBinding
      */
-    <T> AnnotatedTypeConfigurator<T> configureInterceptorBinding(Class<T>
interceptorBindingType);
+    <T extends Annotation> AnnotatedTypeConfigurator<T> configureInterceptorBinding(Class<T>
interceptorBindingType);
 
     /**
      * @param qualifier
      * @param <T>
      * @return a new annotated type configurator to create a Qualifier
      */
-    <T> AnnotatedTypeConfigurator<T> configureQualifier(Class<T> qualifier);
+    <T extends Annotation> AnnotatedTypeConfigurator<T> configureQualifier(Class<T>
qualifier);
 }



Mime
View raw message