geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1796257 - in /geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi: InterceptionFactory.java ProcessObserverMethod.java ProcessSyntheticObserverMethod.java
Date Fri, 26 May 2017 08:53:38 GMT
Author: struberg
Date: Fri May 26 08:53:38 2017
New Revision: 1796257

URL: http://svn.apache.org/viewvc?rev=1796257&view=rev
Log:
GERONIMO-6553 add more new interfaces

Added:
    geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/InterceptionFactory.java
  (with props)
    geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/ProcessSyntheticObserverMethod.java
  (with props)
Modified:
    geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/ProcessObserverMethod.java

Added: geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/InterceptionFactory.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/InterceptionFactory.java?rev=1796257&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/InterceptionFactory.java
(added)
+++ geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/InterceptionFactory.java
Fri May 26 08:53:38 2017
@@ -0,0 +1,56 @@
+/*
+ * 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.inject.spi;
+
+import javax.enterprise.inject.spi.configurator.AnnotatedTypeConfigurator;
+
+/**
+ * An InterceptionFactory allows to apply CDI proxies for custom beans and
+ * Contextual Instances manually created in producer methods.
+ *
+ * @param <T> the type of the proxy to be created
+ */
+public interface InterceptionFactory<T>
+{
+    /**
+     * Usually having a non-static final field with any modifier other than private leads
to a
+     * DeploymentException. This is to prevent user failures as those fields cannot be proxied.
+     *
+     * In certain situations one want's to provide a CDI bean for such a class nonetheless.
+     * By invoking this method on a Bean wich such a class we can effectively prevent the
container
+     * from treating this situation as a Deployment error.
+     */
+    InterceptionFactory<T> ignoreFinalMethods();
+
+    /**
+     * You can e.g. add an InterceptorBinding annotation, etc
+     *
+     * @return a Configurator to provide information for the proxy to create
+     */
+    AnnotatedTypeConfigurator<T> configure();
+
+    /**
+     * Wrapps the given originalInstance with a CDI proxy.
+     * This will use the CreationalContext of the Bean it got created for.
+     *
+     * @param originalInstance
+     * @return the CDI proxy (Contextual Reference) wrapped around the originalInstance.
+     */
+    T createInterceptedInstance(T originalInstance);
+}

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

Modified: geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/ProcessObserverMethod.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/ProcessObserverMethod.java?rev=1796257&r1=1796256&r2=1796257&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/ProcessObserverMethod.java
(original)
+++ geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/ProcessObserverMethod.java
Fri May 26 08:53:38 2017
@@ -25,17 +25,17 @@ import javax.enterprise.inject.spi.confi
  * 
  * @version $Rev$ $Date$
  *
- * @param <T> observed event type
- * @param <X> bean class
+ * @param <EVENTTYPE> observed event type
+ * @param <BEANCLASS> bean class
  */
-public interface ProcessObserverMethod<T, X>
+public interface ProcessObserverMethod<EVENTTYPE, BEANCLASS>
 {
     /**
      * Returns annotated method.
      * 
      * @return annotated method
      */
-    AnnotatedMethod<X> getAnnotatedMethod();
+    AnnotatedMethod<BEANCLASS> getAnnotatedMethod();
     
     /**
      * Returns observer method instance that
@@ -43,13 +43,13 @@ public interface ProcessObserverMethod<T
      * 
      * @return observer method instance
      */
-    ObserverMethod<T> getObserverMethod();
+    ObserverMethod<EVENTTYPE> getObserverMethod();
 
 
     /**
      * @param observerMethod to replace the original one
      */
-    void setObserverMethod(ObserverMethod<T> observerMethod);
+    void setObserverMethod(ObserverMethod<EVENTTYPE> observerMethod);
 
     /**
      * Tell the container to ignore the current ObserverMethod.
@@ -67,7 +67,7 @@ public interface ProcessObserverMethod<T
     * Creates a configurator for this observer method
     * @return
     */
-    ObserverMethodConfigurator<T> configureObserverMethod();
+    ObserverMethodConfigurator<EVENTTYPE> configureObserverMethod();
 
 
     

Added: geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/ProcessSyntheticObserverMethod.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/ProcessSyntheticObserverMethod.java?rev=1796257&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/ProcessSyntheticObserverMethod.java
(added)
+++ geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/ProcessSyntheticObserverMethod.java
Fri May 26 08:53:38 2017
@@ -0,0 +1,36 @@
+/*
+ * 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.inject.spi;
+
+/**
+ * This event only gets fired for custom ObserverMethod added via {@link AfterBeanDiscovery}.
+ * The event gets fired before registering the ObserverMethod with the container.
+ * 
+ * @version $Rev: 1796096 $ $Date: 2017-05-24 22:27:18 +0200 (Wed, 24 May 2017) $
+ *
+ * @param <EVENTTYPE> observed event type
+ * @param <BEANCLASS> bean class
+ */
+public interface ProcessSyntheticObserverMethod<EVENTTYPE, BEANCLASS> extends ProcessObserverMethod<EVENTTYPE,
BEANCLASS>
+{
+    /**
+     * @return the Extension instance adding the very ObserverMethod
+     */
+    Extension getSource();
+}
\ No newline at end of file

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



Mime
View raw message