openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gerdo...@apache.org
Subject svn commit: r786831 - in /incubator/openwebbeans/trunk/webbeans-api: ./ src/main/java/javax/enterprise/context/ src/main/java/javax/enterprise/inject/ src/main/java/javax/enterprise/inject/spi/ src/main/java/javax/inject/
Date Sat, 20 Jun 2009 14:41:06 GMT
Author: gerdogdu
Date: Sat Jun 20 14:41:05 2009
New Revision: 786831

URL: http://svn.apache.org/viewvc?rev=786831&view=rev
Log:
Update for last draft spec.

Removed:
    incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/inject/Realizes.java
Modified:
    incubator/openwebbeans/trunk/webbeans-api/pom.xml
    incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/context/ContextException.java
    incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/InjectionException.java
    incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/ResolutionException.java
    incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/spi/Bean.java
    incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/spi/BeanManager.java
    incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/spi/Decorator.java
    incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/spi/Interceptor.java

Modified: incubator/openwebbeans/trunk/webbeans-api/pom.xml
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-api/pom.xml?rev=786831&r1=786830&r2=786831&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-api/pom.xml (original)
+++ incubator/openwebbeans/trunk/webbeans-api/pom.xml Sat Jun 20 14:41:05 2009
@@ -27,4 +27,12 @@
 	<name>Apache OpenWebBeans :: WebBeans-API</name>
 	<packaging>jar</packaging>
 	<description>JSR-299 Application Programming Interface</description>
+	<dependencies>
+		<dependency>
+			<groupId>org.apache.geronimo.specs</groupId>
+			<artifactId>geronimo-interceptor_3.0_spec</artifactId>
+			<version>1.0.1</version>
+			<scope>provided</scope>
+		</dependency>
+	</dependencies>
 </project>

Modified: incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/context/ContextException.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/context/ContextException.java?rev=786831&r1=786830&r2=786831&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/context/ContextException.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/context/ContextException.java
Sat Jun 20 14:41:05 2009
@@ -15,6 +15,8 @@
 
 public class ContextException extends RuntimeException 
 {
+	private static final long serialVersionUID = 3338309667037125674L;
+
 	public ContextException()
 	{
 		

Modified: incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/InjectionException.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/InjectionException.java?rev=786831&r1=786830&r2=786831&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/InjectionException.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/InjectionException.java
Sat Jun 20 14:41:05 2009
@@ -20,8 +20,9 @@
  */
 public class InjectionException extends RuntimeException
 {
+	private static final long serialVersionUID = -1311377696674849873L;
 
-    public InjectionException()
+	public InjectionException()
     {
         
     }

Modified: incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/ResolutionException.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/ResolutionException.java?rev=786831&r1=786830&r2=786831&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/ResolutionException.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/ResolutionException.java
Sat Jun 20 14:41:05 2009
@@ -24,7 +24,9 @@
 public class ResolutionException extends InjectionException
 {
 
-    public ResolutionException()
+	private static final long serialVersionUID = 625364090562381779L;
+
+	public ResolutionException()
     {
         
     }

Modified: incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/spi/Bean.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/spi/Bean.java?rev=786831&r1=786830&r2=786831&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/spi/Bean.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/spi/Bean.java
Sat Jun 20 14:41:05 2009
@@ -19,36 +19,95 @@
 
 import javax.enterprise.context.spi.Contextual;
 
-public abstract class Bean<T> implements Contextual<T>
+/**
+ * Reprensts bean instances that are contextual
+ * and injectable by the container.
+ * 
+ * @version $Rev$ $Date$
+ *
+ * @param <T> bean representation type
+ */
+public interface Bean<T> extends Contextual<T>
 {
-    private final BeanManager manager;
-
-    protected Bean(BeanManager manager)
-    {
-        this.manager = manager;
-    }
-
-    protected BeanManager getManager()
-    {
-        return manager;
-    }
-
+	
+    /**
+     * Returns api types of a bean.
+     * 
+     * @return api types of a bean
+     */
     public abstract Set<Type> getTypes();
 
+    /**
+     * Returns binding types of a bean.
+     * 
+     * @return binding types of a bean
+     */
     public abstract Set<Annotation> getBindings();
 
-    public abstract Class<? extends Annotation> getScopeType();
 
+    /**
+     * Returns bean deployment type.
+     * 
+     * @return bean's deployment type.
+     */
     public abstract Class<? extends Annotation> getDeploymentType();
+    
+    
+    /**
+     * Returns scope types of a bean.
+     * 
+     * @return scope type
+     */
+    public abstract Class<? extends Annotation> getScopeType();
 
+    /**
+     * Returns name of a bean.
+     * 
+     * @return name of a bean
+     */
     public abstract String getName();
 
+    /**
+     * Returns true if bean is capable of
+     * serializable, false otherwise.
+     * 
+     * @return true if bean is serializable
+     */
     public abstract boolean isSerializable();
 
+    /**
+     * If bean is nullable return true, false
+     * otherwise. 
+     * 
+     * <p>
+     * Nullable means that if producer
+     * bean api type is primitive, its nullable property
+     * will be false.
+     * </p>
+     * 
+     * @return true if bean is nullable.
+     */
     public abstract boolean isNullable();
 
+    /**
+     * Returns all injection points of this bean.
+     * 
+     * @return injection points
+     */
     public abstract Set<InjectionPoint> getInjectionPoints();
     
+    /**
+     * Returns class of bean.
+     * 
+     * @return class of bean that it represents
+     */
     public abstract Class<?> getBeanClass();
+    
+    /**
+     * Returns bean stereotypes.
+     * 
+     * @return bean stereotypes
+     */
+    public abstract Set<Annotation> getStereotypes();
 
 }
\ No newline at end of file

Modified: incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/spi/BeanManager.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/spi/BeanManager.java?rev=786831&r1=786830&r2=786831&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/spi/BeanManager.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/spi/BeanManager.java
Sat Jun 20 14:41:05 2009
@@ -133,9 +133,9 @@
      * @param interceptor new interceptor
      * @return the manager instance that this interceptor is added
      */
-    public BeanManager addInterceptor(Interceptor interceptor);
+    public BeanManager addInterceptor(Interceptor<?> interceptor);
 
-    public BeanManager addDecorator(Decorator decorator);
+    public BeanManager addDecorator(Decorator<?> decorator);
 
     public <T> BeanManager addObserver(Observer<T> observer, Class<T> eventType,
Annotation... bindings);
 
@@ -147,9 +147,9 @@
 
     public <T> Set<Observer<T>> resolveObservers(T event, Annotation...
bindings);
 
-    public List<Interceptor> resolveInterceptors(InterceptionType type, Annotation...
interceptorBindings);
+    public List<Interceptor<?>> resolveInterceptors(InterceptionType type, Annotation...
interceptorBindings);
 
-    public List<Decorator> resolveDecorators(Set<Type> types, Annotation... bindingTypes);
+    public List<Decorator<?>> resolveDecorators(Set<Type> types, Annotation...
bindingTypes);
     
     public BeanManager parse(InputStream xmlStream);
     

Modified: incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/spi/Decorator.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/spi/Decorator.java?rev=786831&r1=786830&r2=786831&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/spi/Decorator.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/spi/Decorator.java
Sat Jun 20 14:41:05 2009
@@ -14,20 +14,16 @@
 package javax.enterprise.inject.spi;
 
 import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
 import java.util.Set;
 
-public abstract class Decorator extends Bean<Object>
+public interface Decorator<T> extends Bean<T>
 {
 
-    protected Decorator(BeanManager manager)
-    {
-        super(manager);
-    }
-
-    public abstract Class<?> getDelegateType();
+    public abstract Set<Type> getDecoratedTypes();
+    
+    public abstract Type getDelegateType();
 
     public abstract Set<Annotation> getDelegateBindingTypes();
 
-    public abstract void setDelegate(Object instance, Object delegate);
-
 }

Modified: incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/spi/Interceptor.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/spi/Interceptor.java?rev=786831&r1=786830&r2=786831&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/spi/Interceptor.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-api/src/main/java/javax/enterprise/inject/spi/Interceptor.java
Sat Jun 20 14:41:05 2009
@@ -14,20 +14,17 @@
 package javax.enterprise.inject.spi;
 
 import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
 import java.util.Set;
 
+import javax.interceptor.InvocationContext;
 
-public abstract class Interceptor extends Bean<Object>
-{
-
-    protected Interceptor(BeanManager manager)
-    {
-        super(manager);
-    }
 
+public interface Interceptor<T> extends Bean<T>
+{
     public abstract Set<Annotation> getInterceptorBindingTypes();
+    
+    public boolean intercepts(InterceptionType type);
 
-    public abstract Method getMethod(InterceptionType type);
+    public Object intercept(InterceptionType type, T instance, InvocationContext ctx);
 
 }



Mime
View raw message