[webbeans-commits] Webbeans SVN: r122 - in ri/trunk/webbeans-ri/src: main/java/org/jboss/webbeans/ejb and 3 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-10-20 14:32:52 -0400 (Mon, 20 Oct 2008)
New Revision: 122
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BasicContext.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BeanImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/EjbManager.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/DeferredEventNotification.…
[View More]java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventBus.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverImpl.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ClassAnnotatedItemTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ConstructorModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DeferredEventNotificationTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseComponentModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventComponentModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ObserverTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/StereotypeModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockObserverImpl.java
Log:
Fix compile problems from API update
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BasicContext.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BasicContext.java 2008-10-20 18:15:46 UTC (rev 121)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BasicContext.java 2008-10-20 18:32:52 UTC (rev 122)
@@ -26,7 +26,7 @@
}
@SuppressWarnings("unchecked")
- public <T> T get(Manager container, Bean<T> component, boolean create)
+ public <T> T get(Bean<T> component, boolean create)
{
T instance = (T) values.get(component);
if (instance != null)
@@ -41,7 +41,7 @@
// TODO should component creation be synchronized?
- instance = component.create(container);
+ instance = component.create();
values.put(component, instance);
return instance;
@@ -60,7 +60,7 @@
if (instance != null)
{
values.remove(component);
- component.destroy(container, instance);
+ component.destroy(instance);
}
else
{
@@ -77,10 +77,15 @@
for (Bean c : values.keySet())
{
- c.destroy(container, values.get(c));
+ c.destroy(values.get(c));
}
values.clear();
}
+
+ public boolean isActive() {
+ // TODO Auto-generated method stub
+ return false;
+ }
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BeanImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BeanImpl.java 2008-10-20 18:15:46 UTC (rev 121)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BeanImpl.java 2008-10-20 18:32:52 UTC (rev 122)
@@ -26,13 +26,13 @@
}
@Override
- public T create(Manager container)
+ public T create()
{
- return componentMetaModel.getConstructor().invoke(container);
+ return componentMetaModel.getConstructor().invoke(getManager());
}
@Override
- public void destroy(Manager container, T instance)
+ public void destroy(T instance)
{
// TODO Auto-generated method stub
@@ -45,9 +45,9 @@
}
@Override
- public Annotation getDeploymentType()
+ public Class<Annotation> getDeploymentType()
{
- return componentMetaModel.getDeploymentType();
+ return null; // componentMetaModel.getDeploymentType();
}
@Override
@@ -57,13 +57,13 @@
}
@Override
- public Annotation getScopeType()
+ public Class<Annotation> getScopeType()
{
- return componentMetaModel.getScopeType();
+ return null; //componentMetaModel.getScopeType();
}
@Override
- public Set<Class> getTypes()
+ public Set<Class<?>> getTypes()
{
// TODO Auto-generated method stub
return null;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-10-20 18:15:46 UTC (rev 121)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-10-20 18:32:52 UTC (rev 122)
@@ -8,191 +8,201 @@
import java.util.Map;
import java.util.Set;
-import javax.webbeans.ContextNotActiveException;
import javax.webbeans.Standard;
import javax.webbeans.TypeLiteral;
import javax.webbeans.manager.Bean;
import javax.webbeans.manager.Context;
+import javax.webbeans.manager.Decorator;
+import javax.webbeans.manager.InterceptionType;
+import javax.webbeans.manager.Interceptor;
import javax.webbeans.manager.Manager;
-import javax.webbeans.manager.Observer;
+import javax.webbeans.Observer;
import org.jboss.webbeans.bindings.ProductionAnnotationLiteral;
import org.jboss.webbeans.bindings.StandardAnnotationLiteral;
import org.jboss.webbeans.ejb.EjbManager;
import org.jboss.webbeans.event.EventBus;
-import org.jboss.webbeans.injectable.Injectable;
import org.jboss.webbeans.injectable.SimpleInjectable;
-public class ManagerImpl implements Manager
-{
-
- private List<Annotation> enabledDeploymentTypes;
- private ModelManager modelManager;
- private EjbManager ejbLookupManager;
- private EventBus eventBus;
- private ResolutionManager resolutionManager;
-
- private boolean containerInitialized = false;
+public class ManagerImpl implements Manager {
-
- private ThreadLocal<Map<Class<Annotation>, Context>> contexts =
- new ThreadLocal<Map<Class<Annotation>, Context>>();
+ private List<Annotation> enabledDeploymentTypes;
+ private ModelManager modelManager;
+ private EjbManager ejbLookupManager;
+ private EventBus eventBus;
+ private ResolutionManager resolutionManager;
- private Set<Bean<?>> beans;
-
- public ManagerImpl(List<Annotation> enabledDeploymentTypes)
- {
- initEnabledDeploymentTypes(enabledDeploymentTypes);
- this.modelManager = new ModelManager();
- this.ejbLookupManager = new EjbManager();
- this.beans = new HashSet<Bean<?>>();
- this.eventBus = new EventBus();
- resolutionManager = new ResolutionManager(this);
- }
-
- private void initEnabledDeploymentTypes(List<Annotation> enabledDeploymentTypes)
- {
- this.enabledDeploymentTypes = new ArrayList<Annotation>();
- if (enabledDeploymentTypes == null)
- {
- this.enabledDeploymentTypes.add(0, new StandardAnnotationLiteral());
- this.enabledDeploymentTypes.add(1, new ProductionAnnotationLiteral());
- }
- else
- {
- this.enabledDeploymentTypes.addAll(enabledDeploymentTypes);
- if (!this.enabledDeploymentTypes.get(0).annotationType().equals(Standard.class))
- {
- throw new RuntimeException("@Standard must be the lowest precedence deployment type");
- }
- }
- }
+ private boolean containerInitialized = false;
- public Manager addBean(Bean<?> bean)
- {
- beans.add(bean);
- if (containerInitialized)
- {
- // TODO Somehow deal with dynamically reigstered components
- }
- return this;
- }
+ private ThreadLocal<Map<Class<Annotation>, Context>> contexts = new ThreadLocal<Map<Class<Annotation>, Context>>();
- public void addContext(Context context)
- {
- // TODO Auto-generated method stub
-
- }
+ private Set<Bean<?>> beans;
- public <T> void addObserver(Observer<T> observer)
- {
- eventBus.addObserver(observer);
- }
+ public ManagerImpl(List<Annotation> enabledDeploymentTypes) {
+ initEnabledDeploymentTypes(enabledDeploymentTypes);
+ this.modelManager = new ModelManager();
+ this.ejbLookupManager = new EjbManager();
+ this.beans = new HashSet<Bean<?>>();
+ this.eventBus = new EventBus();
+ resolutionManager = new ResolutionManager(this);
+ }
- public void fireEvent(Object event, Annotation... bindings)
- {
- // TODO Auto-generated method stub
-
- }
+ private void initEnabledDeploymentTypes(
+ List<Annotation> enabledDeploymentTypes) {
+ this.enabledDeploymentTypes = new ArrayList<Annotation>();
+ if (enabledDeploymentTypes == null) {
+ this.enabledDeploymentTypes.add(0, new StandardAnnotationLiteral());
+ this.enabledDeploymentTypes.add(1,
+ new ProductionAnnotationLiteral());
+ } else {
+ this.enabledDeploymentTypes.addAll(enabledDeploymentTypes);
+ if (!this.enabledDeploymentTypes.get(0).annotationType().equals(
+ Standard.class)) {
+ throw new RuntimeException(
+ "@Standard must be the lowest precedence deployment type");
+ }
+ }
+ }
- public Context getContext(Class<Annotation> scopeType)
- {
- Context context = contexts.get().get(scopeType);
-
- if (context == null)
- {
- // If context can't be found throw an exception (section 9.4 of spec)
- throw new ContextNotActiveException();
- }
- else
- {
- return context;
- }
- }
+ public Manager addBean(Bean<?> bean) {
+ beans.add(bean);
+ if (containerInitialized) {
+ // TODO Somehow deal with dynamically reigstered components
+ }
+ return this;
+ }
- public Object getInstanceByName(String name)
- {
- // TODO Auto-generated method stub
- return null;
- }
+ public <T> void removeObserver(Observer<T> observer) {
- public <T> T getInstanceByType(Class<T> type, Annotation... bindingTypes)
- {
- // TODO Auto-generated method stub
- return null;
- }
+ }
- public <T> T getInstanceByType(TypeLiteral<T> type,
- Annotation... bindingTypes)
- {
- // TODO Auto-generated method stub
- return null;
- }
+ public <T> Set<Method> resolveDisposalMethods(Class<T> apiType,
+ Annotation... bindingTypes) {
+ return new HashSet<Method>();
+ }
- public<T> void removeObserver(Observer<T> observer)
- {
- eventBus.removeObserver(observer);
- }
+ public <T> Set<Observer<T>> resolveObservers(T event,
+ Annotation... bindings) {
+ return (Set<Observer<T>>) eventBus.getObservers(event, bindings);
+ }
- public Set<Bean<?>> resolveByName(String name)
- {
- // TODO Auto-generated method stub
- return null;
- }
+ public List<Annotation> getEnabledDeploymentTypes() {
+ return enabledDeploymentTypes;
+ }
-
-
- public <T> Set<Method> resolveDisposalMethods(Class<T> apiType, Annotation... bindingTypes)
- {
- return new HashSet<Method>();
- }
+ public ModelManager getModelManager() {
+ return this.modelManager;
+ }
- public <T> Set<Observer<T>> resolveObservers(T event, Annotation... bindings)
- {
- return (Set<Observer<T>>) eventBus.getObservers(event, bindings);
- }
-
- public List<Annotation> getEnabledDeploymentTypes()
- {
- return enabledDeploymentTypes;
- }
-
- public ModelManager getModelManager()
- {
- return this.modelManager;
- }
-
- public EjbManager getEjbManager()
- {
- return ejbLookupManager;
- }
+ public EjbManager getEjbManager() {
+ return ejbLookupManager;
+ }
- public <T> T getInstance(Bean<T> bean)
- {
- // TODO Auto-generated method stub
- return null;
- }
+ public <T> Set<Bean<T>> resolveByType(Class<T> apiType,
+ Annotation... bindingTypes) {
+ return getResolutionManager().get(
+ new SimpleInjectable<T>(apiType, bindingTypes));
+ }
- public <T> Set<Bean<T>> resolveByType(Class<T> apiType,
- Annotation... bindingTypes)
- {
- return getResolutionManager().get(new SimpleInjectable<T>(apiType, bindingTypes));
- }
+ public <T> Set<Bean<T>> resolveByType(TypeLiteral<T> apiType,
+ Annotation... bindingTypes) {
+ return resolveByType(apiType.getRawType(), bindingTypes);
+ }
- public <T> Set<Bean<T>> resolveByType(TypeLiteral<T> apiType,
- Annotation... bindingTypes)
- {
- return resolveByType(apiType.getRawType(), bindingTypes);
- }
-
- public ResolutionManager getResolutionManager()
- {
- return resolutionManager;
- }
-
- public Set<Bean<?>> getBeans()
- {
- return beans;
- }
-
+ public ResolutionManager getResolutionManager() {
+ return resolutionManager;
+ }
+
+ public Set<Bean<?>> getBeans() {
+ return beans;
+ }
+
+ public void addContext(Context context) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public Manager addDecorator(Decorator decorator) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Manager addInterceptor(Interceptor interceptor) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public <T> void addObserver(Observer<T> observer, Class<T> eventType,
+ Annotation... bindings) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public <T> void addObserver(Observer<T> observer, TypeLiteral<T> eventType,
+ Annotation... bindings) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void fireEvent(Object event, Annotation... bindings) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public Context getContext(Class<Annotation> scopeType) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public <T> T getInstance(Bean<T> bean) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Object getInstanceByName(String name) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public <T> T getInstanceByType(Class<T> type, Annotation... bindingTypes) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public <T> T getInstanceByType(TypeLiteral<T> type,
+ Annotation... bindingTypes) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public <T> void removeObserver(Observer<T> observer, Class<T> eventType,
+ Annotation... bindings) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public <T> void removeObserver(Observer<T> observer,
+ TypeLiteral<T> eventType, Annotation... bindings) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public Set<Bean<?>> resolveByName(String name) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List<Decorator> resolveDecorators(Set<Class<?>> types,
+ Annotation... bindingTypes) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List<Interceptor> resolveInterceptors(InterceptionType type,
+ Annotation... interceptorBindings) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/EjbManager.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/EjbManager.java 2008-10-20 18:15:46 UTC (rev 121)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/EjbManager.java 2008-10-20 18:32:52 UTC (rev 122)
@@ -3,7 +3,7 @@
import java.util.HashMap;
import java.util.Map;
-import javax.webbeans.EnterpriseBeanLookup;
+import javax.webbeans.manager.EnterpriseBeanLookup;
import org.jboss.webbeans.util.JNDI;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/DeferredEventNotification.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/DeferredEventNotification.java 2008-10-20 18:15:46 UTC (rev 121)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/DeferredEventNotification.java 2008-10-20 18:32:52 UTC (rev 122)
@@ -2,7 +2,7 @@
import javax.transaction.Synchronization;
import javax.webbeans.manager.Manager;
-import javax.webbeans.manager.Observer;
+import javax.webbeans.Observer;
/**
* A synchronization object which will deliver the event to the observer
@@ -13,7 +13,6 @@
*/
public class DeferredEventNotification implements Synchronization
{
- private Manager manager;
private Observer<Object> observer;
private Object event;
@@ -25,9 +24,8 @@
* @param event The event being fired
*/
@SuppressWarnings("unchecked")
- public DeferredEventNotification(Manager manager, Object event, Observer observer)
+ public DeferredEventNotification(Object event, Observer observer)
{
- this.manager = manager;
this.observer = observer;
this.event = event;
}
@@ -40,7 +38,7 @@
public void beforeCompletion()
{
// Execute the observer method on the event
- observer.notify(manager, event);
+ observer.notify(event);
}
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventBus.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventBus.java 2008-10-20 18:15:46 UTC (rev 121)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventBus.java 2008-10-20 18:32:52 UTC (rev 122)
@@ -12,8 +12,7 @@
import javax.transaction.SystemException;
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
-import javax.webbeans.manager.Manager;
-import javax.webbeans.manager.Observer;
+import javax.webbeans.Observer;
import org.jboss.webbeans.util.JNDI;
@@ -67,13 +66,13 @@
* @throws IllegalStateException
* @throws RollbackException
*/
- public void deferEvent(Manager container, Object event, Observer<?> o) throws SystemException, IllegalStateException, RollbackException
+ public void deferEvent(Object event, Observer<?> o) throws SystemException, IllegalStateException, RollbackException
{
if (tm != null) {
// Get the current transaction associated with the thread
Transaction t = tm.getTransaction();
if (t != null)
- t.registerSynchronization(new DeferredEventNotification(container, event, o));
+ t.registerSynchronization(new DeferredEventNotification(event, o));
}
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java 2008-10-20 18:15:46 UTC (rev 121)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java 2008-10-20 18:32:52 UTC (rev 122)
@@ -11,7 +11,7 @@
import javax.webbeans.DuplicateBindingTypeException;
import javax.webbeans.Event;
import javax.webbeans.manager.Manager;
-import javax.webbeans.manager.Observer;
+import javax.webbeans.Observer;
/**
* Implementation of the {@link Event} interface used for the container provided
@@ -55,7 +55,7 @@
.fireEvent(event, eventBindings.toArray(new Annotation[0]));
}
- public void observes(Observer<T> observe, Annotation... bindings)
+ public void observe(Observer<T> observe, Annotation... bindings)
{
// TODO Auto-generated method stub
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverImpl.java 2008-10-20 18:15:46 UTC (rev 121)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverImpl.java 2008-10-20 18:32:52 UTC (rev 122)
@@ -3,7 +3,7 @@
import java.lang.annotation.Annotation;
import javax.webbeans.manager.Manager;
-import javax.webbeans.manager.Observer;
+import javax.webbeans.Observer;
import org.jboss.webbeans.injectable.InjectableMethod;
import org.jboss.webbeans.injectable.InjectableParameter;
@@ -67,10 +67,10 @@
* java.lang.Object)
*/
@SuppressWarnings("unchecked")
- public void notify(Manager manager, final T event)
+ public void notify(final T event)
{
// Get the most specialized instance of the component
- Object instance = getInstance(manager);
+ Object instance = null /*getInstance(manager)*/;
if (instance != null)
{
// Let the super class get the parameter values, but substitute the event
@@ -91,7 +91,7 @@
observerMethod.getParameters().set(i, newParameter);
}
}
- this.observerMethod.invoke(manager, instance);
+ // this.observerMethod.invoke(manager, instance);
}
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ClassAnnotatedItemTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ClassAnnotatedItemTest.java 2008-10-20 18:15:46 UTC (rev 121)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ClassAnnotatedItemTest.java 2008-10-20 18:32:52 UTC (rev 122)
@@ -8,7 +8,6 @@
import javax.webbeans.Production;
import javax.webbeans.Stereotype;
-import org.jboss.webbeans.introspector.AnnotatedItem;
import org.jboss.webbeans.introspector.AnnotatedType;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
import org.jboss.webbeans.test.components.Antelope;
@@ -21,7 +20,7 @@
@Test
public void testDeclaredAnnotations()
{
- AnnotatedType annotatedElement = new SimpleAnnotatedType(Order.class);
+ AnnotatedType<Order> annotatedElement = new SimpleAnnotatedType<Order>(Order.class);
assert annotatedElement.getAnnotations().size() == 1;
assert annotatedElement.getAnnotation(Production.class) != null;
assert annotatedElement.getAnnotatedClass().equals(Order.class);
@@ -30,7 +29,7 @@
@Test
public void testMetaAnnotations()
{
- AnnotatedItem annotatedElement = new SimpleAnnotatedType(Order.class);
+ AnnotatedType<Order> annotatedElement = new SimpleAnnotatedType<Order>(Order.class);
Set<Annotation> annotations = annotatedElement.getAnnotations(DeploymentType.class);
assert annotations.size() == 1;
Iterator<Annotation> it = annotations.iterator();
@@ -41,10 +40,10 @@
@Test
public void testEmpty()
{
- AnnotatedItem annotatedElement = new SimpleAnnotatedType(Order.class);
+ AnnotatedType<Order> annotatedElement = new SimpleAnnotatedType<Order>(Order.class);
assert annotatedElement.getAnnotation(Stereotype.class) == null;
assert annotatedElement.getAnnotations(Stereotype.class).size() == 0;
- AnnotatedItem classWithNoAnnotations = new SimpleAnnotatedType(Antelope.class);
+ AnnotatedType<Antelope> classWithNoAnnotations = new SimpleAnnotatedType<Antelope>(Antelope.class);
assert classWithNoAnnotations.getAnnotations().size() == 0;
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ConstructorModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ConstructorModelTest.java 2008-10-20 18:15:46 UTC (rev 121)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ConstructorModelTest.java 2008-10-20 18:32:52 UTC (rev 122)
@@ -29,12 +29,12 @@
private ManagerImpl container;
- private AnnotatedType emptyAnnotatedItem;
+ private AnnotatedType<Object> emptyAnnotatedItem;
@BeforeMethod
public void before()
{
- emptyAnnotatedItem = new SimpleAnnotatedType(null, new HashMap<Class<? extends Annotation>, Annotation>());
+ emptyAnnotatedItem = new SimpleAnnotatedType<Object>(null, new HashMap<Class<? extends Annotation>, Annotation>());
container = new MockContainerImpl(null);
}
@@ -43,18 +43,18 @@
public void testImplicitConstructor()
{
SimpleConstructor<Order> constructor = new SimpleComponentModel<Order>(new SimpleAnnotatedType<Order>(Order.class), emptyAnnotatedItem, container).getConstructor();
- assert constructor.getConstructor().getDeclaringClass().equals(Order.class);
- assert constructor.getConstructor().getParameterTypes().length == 0;
+ assert constructor.getAnnotatedItem().getDelegate().getDeclaringClass().equals(Order.class);
+ assert constructor.getAnnotatedItem().getDelegate().getParameterTypes().length == 0;
assert constructor.getParameters().size() == 0;
}
@Test
public void testSingleConstructor()
{
- SimpleConstructor<Donkey> constructor = new SimpleComponentModel<Donkey>(new SimpleAnnotatedType(Donkey.class), emptyAnnotatedItem, container).getConstructor();
- assert constructor.getConstructor().getDeclaringClass().equals(Donkey.class);
- assert constructor.getConstructor().getParameterTypes().length == 1;
- assert constructor.getConstructor().getParameterTypes()[0].equals(String.class);
+ SimpleConstructor<Donkey> constructor = new SimpleComponentModel<Donkey>(new SimpleAnnotatedType<Donkey>(Donkey.class), emptyAnnotatedItem, container).getConstructor();
+ assert constructor.getAnnotatedItem().getDelegate().getDeclaringClass().equals(Donkey.class);
+ assert constructor.getAnnotatedItem().getDelegate().getParameterTypes().length == 1;
+ assert constructor.getAnnotatedItem().getDelegate().getParameterTypes()[0].equals(String.class);
assert constructor.getParameters().size() == 1;
assert constructor.getParameters().get(0).getType().equals(String.class);
assert constructor.getParameters().get(0).getBindingTypes().length == 1;
@@ -64,11 +64,11 @@
@Test
public void testInitializerAnnotatedConstructor()
{
- SimpleConstructor<Sheep> constructor = new SimpleComponentModel<Sheep>(new SimpleAnnotatedType(Sheep.class), emptyAnnotatedItem, container).getConstructor();
- assert constructor.getConstructor().getDeclaringClass().equals(Sheep.class);
- assert constructor.getConstructor().getParameterTypes().length == 2;
- assert constructor.getConstructor().getParameterTypes()[0].equals(String.class);
- assert constructor.getConstructor().getParameterTypes()[1].equals(Double.class);
+ SimpleConstructor<Sheep> constructor = new SimpleComponentModel<Sheep>(new SimpleAnnotatedType<Sheep>(Sheep.class), emptyAnnotatedItem, container).getConstructor();
+ assert constructor.getAnnotatedItem().getDelegate().getDeclaringClass().equals(Sheep.class);
+ assert constructor.getAnnotatedItem().getDelegate().getParameterTypes().length == 2;
+ assert constructor.getAnnotatedItem().getDelegate().getParameterTypes()[0].equals(String.class);
+ assert constructor.getAnnotatedItem().getDelegate().getParameterTypes()[1].equals(Double.class);
assert constructor.getParameters().size() == 2;
assert constructor.getParameters().get(0).getType().equals(String.class);
assert constructor.getParameters().get(1).getType().equals(Double.class);
@@ -81,11 +81,11 @@
@Test
public void testBindingTypeAnnotatedConstructor()
{
- SimpleConstructor<Duck> constructor = new SimpleComponentModel<Duck>(new SimpleAnnotatedType(Duck.class), emptyAnnotatedItem, container).getConstructor();
- assert constructor.getConstructor().getDeclaringClass().equals(Duck.class);
- assert constructor.getConstructor().getParameterTypes().length == 2;
- assert constructor.getConstructor().getParameterTypes()[0].equals(String.class);
- assert constructor.getConstructor().getParameterTypes()[1].equals(Integer.class);
+ SimpleConstructor<Duck> constructor = new SimpleComponentModel<Duck>(new SimpleAnnotatedType<Duck>(Duck.class), emptyAnnotatedItem, container).getConstructor();
+ assert constructor.getAnnotatedItem().getDelegate().getDeclaringClass().equals(Duck.class);
+ assert constructor.getAnnotatedItem().getDelegate().getParameterTypes().length == 2;
+ assert constructor.getAnnotatedItem().getDelegate().getParameterTypes()[0].equals(String.class);
+ assert constructor.getAnnotatedItem().getDelegate().getParameterTypes()[1].equals(Integer.class);
assert constructor.getParameters().size() == 2;
assert constructor.getParameters().get(0).getType().equals(String.class);
assert constructor.getParameters().get(1).getType().equals(Integer.class);
@@ -101,7 +101,7 @@
boolean exception = false;
try
{
- new SimpleComponentModel<Chicken>(new SimpleAnnotatedType(Chicken.class), emptyAnnotatedItem, container);
+ new SimpleComponentModel<Chicken>(new SimpleAnnotatedType<Chicken>(Chicken.class), emptyAnnotatedItem, container);
}
catch (Exception e)
{
@@ -117,7 +117,7 @@
boolean exception = false;
try
{
- new SimpleComponentModel<Turkey>(new SimpleAnnotatedType(Turkey.class), emptyAnnotatedItem, container);
+ new SimpleComponentModel<Turkey>(new SimpleAnnotatedType<Turkey>(Turkey.class), emptyAnnotatedItem, container);
}
catch (Exception e)
{
@@ -133,7 +133,7 @@
boolean exception = false;
try
{
- new SimpleComponentModel<Goat>(new SimpleAnnotatedType(Goat.class), emptyAnnotatedItem, container);
+ new SimpleComponentModel<Goat>(new SimpleAnnotatedType<Goat>(Goat.class), emptyAnnotatedItem, container);
}
catch (Exception e)
{
@@ -149,7 +149,7 @@
boolean exception = false;
try
{
- new SimpleComponentModel<Goose>(new SimpleAnnotatedType(Goose.class), emptyAnnotatedItem, container);
+ new SimpleComponentModel<Goose>(new SimpleAnnotatedType<Goose>(Goose.class), emptyAnnotatedItem, container);
}
catch (Exception e)
{
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DeferredEventNotificationTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DeferredEventNotificationTest.java 2008-10-20 18:15:46 UTC (rev 121)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DeferredEventNotificationTest.java 2008-10-20 18:32:52 UTC (rev 122)
@@ -6,13 +6,13 @@
import java.util.List;
import java.util.Map;
-import javax.webbeans.manager.Observer;
+import javax.webbeans.Observer;
import javax.webbeans.Observes;
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.bindings.StandardAnnotationLiteral;
import org.jboss.webbeans.event.DeferredEventNotification;
-import org.jboss.webbeans.event.ObserverMethod;
+import org.jboss.webbeans.injectable.InjectableMethod;
import org.jboss.webbeans.introspector.AnnotatedType;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
import org.jboss.webbeans.model.SimpleComponentModel;
@@ -63,7 +63,7 @@
// is used to keep track of the event being fired.
ManagerImpl manager;
SimpleComponentModel<Tuna> tuna;
- ObserverMethod om;
+ InjectableMethod<Object> om;
List<Annotation> enabledDeploymentTypes = new ArrayList<Annotation>();
enabledDeploymentTypes.add(new StandardAnnotationLiteral());
enabledDeploymentTypes.add(new AnotherDeploymentTypeAnnotationLiteral());
@@ -74,13 +74,13 @@
annotations.put(Asynchronous.class, new AsynchronousAnnotationLiteral());
AnnotatedType<Tuna> annotatedItem = new SimpleAnnotatedType<Tuna>(Tuna.class, annotations);
tuna = new SimpleComponentModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), annotatedItem, manager);
- om = new ObserverMethod(AnObserver.class.getMethod("observe", new Class[] { Event.class }));
+ om = new InjectableMethod<Object>(AnObserver.class.getMethod("observe", new Class[] { Event.class }));
AnObserver observerInstance = new AnObserver();
Observer<Event> observer = new MockObserverImpl<Event>(tuna, om, Event.class);
((MockObserverImpl<Event>) observer).setInstance(observerInstance);
Event event = new Event();
- DeferredEventNotification deferredNotification = new DeferredEventNotification(manager, event, observer);
+ DeferredEventNotification deferredNotification = new DeferredEventNotification(event, observer);
deferredNotification.beforeCompletion();
assert observerInstance.notified;
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseComponentModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseComponentModelTest.java 2008-10-20 18:15:46 UTC (rev 121)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseComponentModelTest.java 2008-10-20 18:32:52 UTC (rev 122)
@@ -31,14 +31,14 @@
public class EnterpriseComponentModelTest
{
-private ManagerImpl container;
+ private ManagerImpl container;
private AnnotatedType emptyAnnotatedItem;
@BeforeMethod
public void before()
{
- emptyAnnotatedItem = new SimpleAnnotatedType(null, new HashMap<Class<? extends Annotation>, Annotation>());
+ emptyAnnotatedItem = new SimpleAnnotatedType<Object>(null, new HashMap<Class<? extends Annotation>, Annotation>());
container = new MockContainerImpl(null);
}
@@ -52,7 +52,7 @@
@Test
public void testStateless()
{
- EnterpriseComponentModel<Lion> lion = new EnterpriseComponentModel<Lion>(new SimpleAnnotatedType(Lion.class), emptyAnnotatedItem, container);
+ EnterpriseComponentModel<Lion> lion = new EnterpriseComponentModel<Lion>(new SimpleAnnotatedType<Lion>(Lion.class), emptyAnnotatedItem, container);
assert lion.getScopeType().annotationType().equals(Dependent.class);
Reflections.annotationSetMatches(lion.getBindingTypes(), Current.class);
assert lion.getName().equals("lion");
@@ -108,7 +108,7 @@
AbstractEnterpriseComponentModel<Tiger> tiger = new EnterpriseComponentModel<Tiger>(new SimpleAnnotatedType(Tiger.class), emptyAnnotatedItem, container);
Reflections.annotationSetMatches(tiger.getBindingTypes(), Synchronous.class);
- assert tiger.getRemoveMethod().getMethod().getName().equals("remove");
+ assert tiger.getRemoveMethod().getAnnotatedItem().getDelegate().getName().equals("remove");
assert tiger.getName() == null;
}
@@ -118,7 +118,7 @@
{
AbstractEnterpriseComponentModel<Elephant> elephant = new EnterpriseComponentModel<Elephant>(new SimpleAnnotatedType(Elephant.class), emptyAnnotatedItem, container);
- assert elephant.getRemoveMethod().getMethod().getName().equals("remove2");
+ assert elephant.getRemoveMethod().getAnnotatedItem().getDelegate().getName().equals("remove2");
}
@SuppressWarnings("unchecked")
@@ -175,7 +175,7 @@
AbstractEnterpriseComponentModel<Panther> panther = new EnterpriseComponentModel<Panther>(new SimpleAnnotatedType(Panther.class), emptyAnnotatedItem, container);
- assert panther.getRemoveMethod().getMethod().getName().equals("remove");
+ assert panther.getRemoveMethod().getAnnotatedItem().getDelegate().getName().equals("remove");
assert panther.getRemoveMethod().getParameters().size() == 1;
assert panther.getRemoveMethod().getParameters().get(0).getType().equals(String.class);
assert panther.getRemoveMethod().getParameters().get(0).getBindingTypes().length == 1;
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventComponentModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventComponentModelTest.java 2008-10-20 18:15:46 UTC (rev 121)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventComponentModelTest.java 2008-10-20 18:32:52 UTC (rev 122)
@@ -39,9 +39,9 @@
enabledDeploymentTypes.add(new AnotherDeploymentTypeAnnotationLiteral());
manager = new MockContainerImpl(enabledDeploymentTypes);
eventComponentModel = new EventComponentModel<Event<? extends Object>>(
- new SimpleAnnotatedItem<Object>(
+ new SimpleAnnotatedItem<Event<? extends Object>, Object>(
new HashMap<Class<? extends Annotation>, Annotation>()),
- new SimpleAnnotatedItem<Object>(
+ new SimpleAnnotatedItem<Event<? extends Object>, Object>(
new HashMap<Class<? extends Annotation>, Annotation>()),
manager);
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ObserverTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ObserverTest.java 2008-10-20 18:15:46 UTC (rev 121)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ObserverTest.java 2008-10-20 18:32:52 UTC (rev 122)
@@ -7,12 +7,12 @@
import java.util.Map;
import javax.webbeans.Observes;
-import javax.webbeans.manager.Observer;
+import javax.webbeans.Observer;
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.bindings.StandardAnnotationLiteral;
import org.jboss.webbeans.event.ObserverImpl;
-import org.jboss.webbeans.event.ObserverMethod;
+import org.jboss.webbeans.injectable.InjectableMethod;
import org.jboss.webbeans.introspector.AnnotatedType;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
import org.jboss.webbeans.model.SimpleComponentModel;
@@ -36,7 +36,7 @@
{
private ManagerImpl manager;
private SimpleComponentModel<Tuna> tuna;
- private ObserverMethod om;
+ private InjectableMethod<?> om;
public class Event
{
@@ -67,7 +67,7 @@
annotations.put(Asynchronous.class, new AsynchronousAnnotationLiteral());
AnnotatedType<Tuna> annotatedItem = new SimpleAnnotatedType<Tuna>(Tuna.class, annotations);
tuna = new SimpleComponentModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), annotatedItem, manager);
- om = new ObserverMethod(AnObserver.class.getMethod("observe", new Class[] { Event.class }));
+ om = new InjectableMethod<Object>(AnObserver.class.getMethod("observe", new Class[] { Event.class }));
}
/**
@@ -79,9 +79,9 @@
public final void testGetEventBindingTypes() throws Exception
{
Observer<Event> o = new ObserverImpl<Event>(tuna, om, Event.class);
- assert o.getEventBindingTypes().size() == 1;
- assert Reflections.annotationSetMatches(o.getEventBindingTypes(), Asynchronous.class);
- assert o.getEventType().equals(Event.class);
+ //assert o.getEventBindingTypes().size() == 1;
+ //assert Reflections.annotationSetMatches(o.getEventBindingTypes(), Asynchronous.class);
+ //assert o.getEventType().equals(Event.class);
}
/**
@@ -95,7 +95,7 @@
public final void testGetEventType() throws Exception
{
Observer<Event> o = new ObserverImpl<Event>(tuna, om, Event.class);
- assert o.getEventType().equals(Event.class);
+ //assert o.getEventType().equals(Event.class);
}
/**
@@ -110,7 +110,7 @@
Observer<Event> observer = new MockObserverImpl<Event>(tuna, om, Event.class);
((MockObserverImpl<Event>) observer).setInstance(observerInstance);
Event event = new Event();
- observer.notify(manager, event);
+ observer.notify(event);
assert observerInstance.notified;
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/StereotypeModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/StereotypeModelTest.java 2008-10-20 18:15:46 UTC (rev 121)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/StereotypeModelTest.java 2008-10-20 18:32:52 UTC (rev 122)
@@ -2,8 +2,6 @@
import java.util.Arrays;
-import javax.webbeans.Model;
-import javax.webbeans.Production;
import javax.webbeans.RequestScoped;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
@@ -42,18 +40,6 @@
assert false;
}
- @Test @SpecAssertion(section="2.7.5")
- public void testModelStereotype()
- {
- StereotypeModel<Model> modelStereotype = new StereotypeModel<Model>(new SimpleAnnotatedType<Model>(Model.class));
- assert Production.class.equals(modelStereotype.getDefaultDeploymentType().annotationType());
- assert RequestScoped.class.equals(modelStereotype.getDefaultScopeType().annotationType());
- assert modelStereotype.isComponentNameDefaulted();
- assert modelStereotype.getInterceptorBindings().size() == 0;
- assert modelStereotype.getRequiredTypes().size() == 0;
- assert modelStereotype.getSupportedScopes().size() == 0;
- }
-
@Test
public void testAnimalStereotype()
{
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockObserverImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockObserverImpl.java 2008-10-20 18:15:46 UTC (rev 121)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockObserverImpl.java 2008-10-20 18:32:52 UTC (rev 122)
@@ -3,7 +3,7 @@
import javax.webbeans.manager.Manager;
import org.jboss.webbeans.event.ObserverImpl;
-import org.jboss.webbeans.event.ObserverMethod;
+import org.jboss.webbeans.injectable.InjectableMethod;
import org.jboss.webbeans.model.AbstractComponentModel;
/**
@@ -15,12 +15,15 @@
private Object specializedInstance;
+
+
public MockObserverImpl(AbstractComponentModel<?, ?> componentModel,
- ObserverMethod observer, Class<T> eventType) {
- super(componentModel, observer, eventType);
- }
+ InjectableMethod<?> observer, Class<T> eventType)
+ {
+ super(componentModel, observer, eventType);
+ }
- @Override
+ @Override
protected final Object getInstance(Manager manager) {
return specializedInstance;
}
[View Less]
16 years, 3 months
[webbeans-commits] Webbeans SVN: r121 - in ri/trunk/webbeans-api/src/main/java/javax/webbeans: manager and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-10-20 14:15:46 -0400 (Mon, 20 Oct 2008)
New Revision: 121
Added:
ri/trunk/webbeans-api/src/main/java/javax/webbeans/Observer.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Decorator.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/EnterpriseBeanLookup.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Initialized.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/InterceptionType.…
[View More]java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Interceptor.java
Removed:
ri/trunk/webbeans-api/src/main/java/javax/webbeans/EnterpriseBeanLookup.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/Model.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Conversation.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Observer.java
Modified:
ri/trunk/webbeans-api/src/main/java/javax/webbeans/AfterTransactionCompletion.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/AfterTransactionFailure.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/AfterTransactionSuccess.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/AnnotationLiteral.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/ApplicationScoped.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/BeforeTransactionCompletion.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/BindingType.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/ConversationScoped.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/Current.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/Decorates.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/Decorator.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/Dependent.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/DeploymentType.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/Destructor.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/Disposes.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/Event.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/IfExists.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/Initializer.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/Interceptor.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/InterceptorBindingType.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/Named.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/New.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/NonBinding.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/Observable.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/Observes.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/Produces.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/Production.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/RequestScoped.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/ScopeType.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/SessionScoped.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/Specializes.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/Standard.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/TypeLiteral.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Bean.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Context.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Manager.java
Log:
Lots of API updates, Gavin is now going to keep this up to date :-)
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/AfterTransactionCompletion.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/AfterTransactionCompletion.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/AfterTransactionCompletion.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -1,19 +1,19 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* Licensed 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.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.webbeans;
@@ -31,5 +31,6 @@
*/
@Retention(RUNTIME)
@Target(PARAMETER)
-public @interface AfterTransactionCompletion {
+public @interface AfterTransactionCompletion
+{
}
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/AfterTransactionFailure.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/AfterTransactionFailure.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/AfterTransactionFailure.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -1,19 +1,19 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* Licensed 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.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.webbeans;
@@ -31,5 +31,6 @@
*/
@Retention(RUNTIME)
@Target(PARAMETER)
-public @interface AfterTransactionFailure {
+public @interface AfterTransactionFailure
+{
}
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/AfterTransactionSuccess.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/AfterTransactionSuccess.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/AfterTransactionSuccess.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -1,19 +1,19 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* Licensed 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.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.webbeans;
@@ -31,5 +31,6 @@
*/
@Retention(RUNTIME)
@Target(PARAMETER)
-public @interface AfterTransactionSuccess {
+public @interface AfterTransactionSuccess
+{
}
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/AnnotationLiteral.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/AnnotationLiteral.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/AnnotationLiteral.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -18,8 +18,13 @@
package javax.webbeans;
/**
+ * Supports inline instantiation of annotation types.
+ *
* @author Pete Muir
- * @author Gavin King
+ * @author Gavin King
+ *
+ * @param <T>
+ * the annotation type
*/
import java.lang.annotation.Annotation;
import java.lang.reflect.ParameterizedType;
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/ApplicationScoped.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/ApplicationScoped.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/ApplicationScoped.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -26,7 +26,10 @@
import java.lang.annotation.Target;
/**
+ * Specifies that a Web Bean is application scoped.
*
+ * @author Gavin King
+ *
* @author Pete Muir
*/
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/BeforeTransactionCompletion.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/BeforeTransactionCompletion.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/BeforeTransactionCompletion.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -31,5 +31,6 @@
*/
@Retention(RUNTIME)
@Target(PARAMETER)
-public @interface BeforeTransactionCompletion {
+public @interface BeforeTransactionCompletion
+{
}
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/BindingType.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/BindingType.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/BindingType.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -26,8 +26,7 @@
/**
*
- * Specifies that an annotation type is a Web Beans
- * binding type.
+ * Specifies that an annotation type is a Web Beans binding type.
*
* @author Pete Muir
* @author Gavin King
@@ -38,5 +37,4 @@
@Documented
public @interface BindingType
{
-
}
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/ConversationScoped.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/ConversationScoped.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/ConversationScoped.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -26,15 +26,16 @@
import java.lang.annotation.Target;
/**
+ * Specifies that a Web Bean is conversation scoped.
*
+ * @author Gavin King
* @author Pete Muir
*/
@Target( { TYPE, METHOD })
@Retention(RUNTIME)
@Documented
-@ScopeType
+@ScopeType(passivating = true)
public @interface ConversationScoped
{
-
}
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/Current.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/Current.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/Current.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -28,6 +28,7 @@
import java.lang.annotation.Target;
/**
+ * The default binding type.
*
* @author Pete Muir
*/
@@ -38,5 +39,4 @@
@BindingType
public @interface Current
{
-
}
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/Decorates.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/Decorates.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/Decorates.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -25,7 +25,7 @@
import java.lang.annotation.Target;
/**
- * Specifies that a field of a decorator class is the delegate.
+ * Specifies that a field of a decorator class is the delegate attribute.
*
* @author Gavin King
* @author Pete Muir
@@ -36,5 +36,4 @@
@Documented
public @interface Decorates
{
-
}
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/Decorator.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/Decorator.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/Decorator.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -25,7 +25,7 @@
import java.lang.annotation.Target;
/**
- * Specifies that a class is a decorator.
+ * Specifies that a class is a Web Beans decorator.
*
* @author Gavin King
* @author Pete Muir
@@ -34,7 +34,7 @@
@Target(TYPE)
@Retention(RUNTIME)
@Documented
+@Stereotype
public @interface Decorator
{
-
}
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/Dependent.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/Dependent.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/Dependent.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -26,15 +26,16 @@
import java.lang.annotation.Target;
/**
+ * Specifies that a Web Bean is dependent scoped.
*
+ * @author Gavin King
* @author Pete Muir
*/
@Target( { METHOD, TYPE })
@Retention(RUNTIME)
@Documented
-@ScopeType
+@ScopeType(normal = false)
public @interface Dependent
{
-
}
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/DeploymentType.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/DeploymentType.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/DeploymentType.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -25,8 +25,7 @@
import java.lang.annotation.Target;
/**
- * Specifies that an annotation type is a Web Beans
- * component type.
+ * Specifies that an annotation type is a Web Beans deployment type.
*
* @author Gavin King
* @author Pete Muir
@@ -37,5 +36,4 @@
@Documented
public @interface DeploymentType
{
-
}
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/Destructor.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/Destructor.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/Destructor.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -1,21 +1,20 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* Licensed 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.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.webbeans;
import static java.lang.annotation.ElementType.METHOD;
@@ -25,13 +24,14 @@
import java.lang.annotation.Target;
/**
- * Specifies that a method of a Web Bean component implementation class is a Web
- * Beans remove method.
+ * Specifies that a method of a Web Bean implementation class is a Web Beans
+ * remove method.
*
* @author Gavin King
*
*/
@Retention(RUNTIME)
@Target(METHOD)
-public @interface Destructor {
+public @interface Destructor
+{
}
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/Disposes.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/Disposes.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/Disposes.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -25,9 +25,8 @@
import java.lang.annotation.Target;
/**
- * Specifies that a parameter of a method of a Web Bean
- * component implementation class is the parameter of
- * a disposal method.
+ * Specifies that a parameter of a method of a Web Bean implementation class
+ * class is the disposed parameter of a disposal method.
*
* @author Gavin King
* @author Pete Muir
Deleted: ri/trunk/webbeans-api/src/main/java/javax/webbeans/EnterpriseBeanLookup.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/EnterpriseBeanLookup.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/EnterpriseBeanLookup.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -1,8 +0,0 @@
-package javax.webbeans;
-
-public interface EnterpriseBeanLookup
-{
-
- public Object lookup(String ejbName);
-
-}
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/Event.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/Event.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/Event.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -19,11 +19,15 @@
import java.lang.annotation.Annotation;
-import javax.webbeans.manager.Observer;
-
/**
+ * An interface for firing events of a particular type, and registering
+ * observers for events of that type.
*
+ * @author Gavin King
* @author Pete Muir
+ *
+ * @param <T>
+* the type of the event object
*/
public interface Event<T>
@@ -31,6 +35,6 @@
public void fire(T event, Annotation... bindings);
- public void observes(Observer<T> observe, Annotation... bindings);
+ public void observe(Observer<T> observer, Annotation... bindings);
}
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/IfExists.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/IfExists.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/IfExists.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -37,5 +37,4 @@
@Documented
public @interface IfExists
{
-
}
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/Initializer.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/Initializer.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/Initializer.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -1,19 +1,19 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* Licensed 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.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.webbeans;
@@ -26,18 +26,16 @@
import java.lang.annotation.Target;
/**
- * Specifies that a method of a Web Bean component
- * implementation class is a Web Beans initializer method,
- * or that a constructor is the Web Bean component constructor.
+ * Specifies that a method of a Web Bean implementation class is a Web Beans
+ * initializer method, or that a constructor is the Web Bean constructor.
*
* @author Gavin King
* @author Pete Muir
*/
-@Target({METHOD,CONSTRUCTOR})
+@Target( { METHOD, CONSTRUCTOR })
@Retention(RUNTIME)
@Documented
public @interface Initializer
{
-
}
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/Interceptor.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/Interceptor.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/Interceptor.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -1,21 +1,20 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* Licensed 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.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.webbeans;
import static java.lang.annotation.ElementType.TYPE;
@@ -25,12 +24,14 @@
import java.lang.annotation.Target;
/**
- * Specifies that a class is an interceptor.
+ * Specifies that a class is a Web Beans interceptor.
*
* @author Gavin King
*
*/
@Retention(RUNTIME)
@Target(TYPE)
-public @interface Interceptor {
+@Stereotype
+public @interface Interceptor
+{
}
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/InterceptorBindingType.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/InterceptorBindingType.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/InterceptorBindingType.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -37,5 +37,4 @@
@Documented
public @interface InterceptorBindingType
{
-
}
Deleted: ri/trunk/webbeans-api/src/main/java/javax/webbeans/Model.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/Model.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/Model.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -1,43 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* Licensed 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.webbeans;
-
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- *
- * @author Pete Muir
- */
-
-@Named
-@RequestScoped
-@Production
-@Stereotype
-@Target( { TYPE, METHOD })
-@Retention(RUNTIME)
-@Documented
-public @interface Model
-{
-
-}
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/Named.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/Named.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/Named.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -1,19 +1,19 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* Licensed 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.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.webbeans;
@@ -26,7 +26,7 @@
import java.lang.annotation.Target;
/**
- * Specifies the Web Beans component name.
+ * Specifies the name of a Web Bean.
*
* @author Gavin King
* @author Pete Muir
@@ -38,6 +38,12 @@
public @interface Named
{
+ /**
+ * If no name is explicitly specified, the default name is used.
+ *
+ * @return the component name
+ */
+
public String value() default "";
}
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/New.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/New.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/New.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -18,9 +18,7 @@
package javax.webbeans;
import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Documented;
@@ -34,11 +32,10 @@
* @author Pete Muir
*/
-@Target( { METHOD, FIELD, PARAMETER, TYPE })
+@Target( { FIELD, PARAMETER, })
@Retention(RUNTIME)
@Documented
@BindingType
public @interface New
{
-
}
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/NonBinding.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/NonBinding.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/NonBinding.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -1,21 +1,20 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* Licensed 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.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.webbeans;
import static java.lang.annotation.ElementType.METHOD;
@@ -33,5 +32,6 @@
*/
@Retention(RUNTIME)
@Target(METHOD)
-public @interface NonBinding {
+public @interface NonBinding
+{
}
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/Observable.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/Observable.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/Observable.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -40,5 +40,4 @@
@Documented
public @interface Observable
{
-
}
Added: ri/trunk/webbeans-api/src/main/java/javax/webbeans/Observer.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/Observer.java (rev 0)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/Observer.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -0,0 +1,13 @@
+package javax.webbeans;
+
+/**
+ * The contract between the Web Bean manager and a Web Beans observer object.
+ * This interface should not be called directly by the application.
+ *
+ * @author Gavin King
+ *
+ */
+public interface Observer<T>
+{
+ public void notify(T event);
+}
\ No newline at end of file
Property changes on: ri/trunk/webbeans-api/src/main/java/javax/webbeans/Observer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/Observes.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/Observes.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/Observes.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -26,7 +26,7 @@
/**
* Specifies that a parameter of a method of a Web Bean
- * component implementation class is the event parameter
+ * implementation class is the event parameter
* of an observer method.
*
* @author Gavin King
@@ -38,5 +38,4 @@
@Documented
public @interface Observes
{
-
}
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/Produces.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/Produces.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/Produces.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -1,19 +1,19 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* Licensed 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.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.webbeans;
@@ -26,8 +26,8 @@
/**
*
- * Specifies that a method of a Web Bean component
- * implementation class is a Web Beans producer method.
+ * Specifies that a method of a Web Bean implementation class is a producer
+ * method.
*
* @author Gavin King
* @author Pete Muir
@@ -38,5 +38,4 @@
@Documented
public @interface Produces
{
-
}
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/Production.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/Production.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/Production.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -26,7 +26,7 @@
import java.lang.annotation.Target;
/**
- * Component type for application components.
+ * The default deployment type.
*
* @author Gavin King
* @author Pete Muir
@@ -38,5 +38,4 @@
@DeploymentType
public @interface Production
{
-
}
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/RequestScoped.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/RequestScoped.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/RequestScoped.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -26,7 +26,9 @@
import java.lang.annotation.Target;
/**
+ * Specifies that a Web Bean is request scoped.
*
+ * @author Gavin King
* @author Pete Muir
*/
@@ -36,5 +38,4 @@
@ScopeType
public @interface RequestScoped
{
-
}
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/ScopeType.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/ScopeType.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/ScopeType.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -1,19 +1,19 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* Licensed 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.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.webbeans;
@@ -25,8 +25,8 @@
import java.lang.annotation.Target;
/**
- * Specifies that an annotation type is a Web Beans
- * scope type.
+ * Specifies that an annotation type is a Web Beans scope type.
+ *
* @author Gavin King
* @author Pete Muir
*/
@@ -37,4 +37,15 @@
public @interface ScopeType
{
+ /**
+ * @return true if this is a normal scope
+ */
+ boolean normal() default true;
+
+ /**
+ * @return true if this is a passivating scope (Web Beans with this scope
+ * type must be serializable)
+ */
+ boolean passivating() default false;
+
}
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/SessionScoped.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/SessionScoped.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/SessionScoped.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -26,15 +26,16 @@
import java.lang.annotation.Target;
/**
+ * Specifies that a Web Bean is session scoped.
*
+ * @author Gavin King
* @author Pete Muir
*/
@Target( { TYPE, METHOD })
@Retention(RUNTIME)
@Documented
-@ScopeType
+@ScopeType(passivating = true)
public @interface SessionScoped
{
-
}
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/Specializes.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/Specializes.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/Specializes.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -25,7 +25,8 @@
import java.lang.annotation.Target;
/**
- * Specifies that an implementation class directly specializes its superclass.
+ * Specifies that an implementation class directly specializes its superclass,
+ * of that a producer method directly specializes the method it overrides.
*
* @author Gavin King
* @author Pete Muir
@@ -36,5 +37,4 @@
@Documented
public @interface Specializes
{
-
}
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/Standard.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/Standard.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/Standard.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -26,7 +26,8 @@
import java.lang.annotation.Target;
/**
- * Component type for standard components.
+ * Deployment type for standard components defined by the Web Beans
+ * specification.
*
* @author Gavin King
* @author Pete Muir
@@ -38,5 +39,4 @@
@DeploymentType
public @interface Standard
{
-
}
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/TypeLiteral.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/TypeLiteral.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/TypeLiteral.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -22,42 +22,43 @@
import java.lang.reflect.Type;
/**
+ * Supports inline instantiation of objects that represent parameterized types
+ * with actual type parameters.
*
- * @author Pete Muir
* @author Gavin King
+ *
+ * @param <T>
+ * the type, including all actual type parameters
*/
+public abstract class TypeLiteral<T> {
-public class TypeLiteral<T>
-{
-
- protected TypeLiteral() {
- if (!(getClass().getSuperclass() == TypeLiteral.class)) {
- throw new RuntimeException("Not a direct subclass of TypeLiteral");
- }
- if (!(getClass().getGenericSuperclass() instanceof ParameterizedType)) {
- throw new RuntimeException("Missing type parameter in TypeLiteral");
- }
- }
+ protected TypeLiteral() {
+ if (!(getClass().getSuperclass() == TypeLiteral.class)) {
+ throw new RuntimeException("Not a direct subclass of TypeLiteral");
+ }
+ if (!(getClass().getGenericSuperclass() instanceof ParameterizedType)) {
+ throw new RuntimeException("Missing type parameter in TypeLiteral");
+ }
+ }
- public final Type getType() {
- ParameterizedType parameterized = (ParameterizedType) getClass()
- .getGenericSuperclass();
- return parameterized.getActualTypeArguments()[0];
- }
+ public final Type getType() {
+ ParameterizedType parameterized = (ParameterizedType) getClass()
+ .getGenericSuperclass();
+ return parameterized.getActualTypeArguments()[0];
+ }
- @SuppressWarnings("unchecked")
- public final Class<T> getRawType() {
- Type type = getType();
- if (type instanceof Class) {
- return (Class<T>) type;
- } else if (type instanceof ParameterizedType) {
- return (Class<T>) ((ParameterizedType) type).getRawType();
- } else if (type instanceof GenericArrayType) {
- return (Class<T>) Object[].class;
- } else {
- throw new RuntimeException("Illegal type");
- }
- }
- // TODO: equals(), hashCode()
-
+ @SuppressWarnings("unchecked")
+ public final Class<T> getRawType() {
+ Type type = getType();
+ if (type instanceof Class) {
+ return (Class<T>) type;
+ } else if (type instanceof ParameterizedType) {
+ return (Class<T>) ((ParameterizedType) type).getRawType();
+ } else if (type instanceof GenericArrayType) {
+ return (Class<T>) Object[].class;
+ } else {
+ throw new RuntimeException("Illegal type");
+ }
+ }
+ // TODO: equals(), hashCode()
}
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Bean.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Bean.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Bean.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -1,56 +1,65 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* Licensed 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.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.webbeans.manager;
import java.lang.annotation.Annotation;
import java.util.Set;
-
/**
+ * The contract between the Web Bean manager and a Web Bean. This interface
+ * should not be called directly by the application.
*
- * @author Pete Muir
+ * @author Gavin King
+ *
+ * @param <T>
+ * an API type of the Web Bean
*/
-
public abstract class Bean<T>
{
-
+
private final Manager manager;
-
+
protected Bean(Manager manager)
{
this.manager = manager;
}
-
+
protected Manager getManager()
{
return manager;
}
- public abstract Set<Class> getTypes();
+ public abstract T create();
+
+ public abstract void destroy(T instance);
+
+ public abstract Set<Class<?>> getTypes();
+
public abstract Set<Annotation> getBindingTypes();
- public abstract Annotation getScopeType();
- public abstract Annotation getDeploymentType();
+
+ public abstract Class<Annotation> getScopeType();
+
+ public abstract Class<Annotation> getDeploymentType();
+
public abstract String getName();
-
+
public abstract boolean isSerializable();
+
public abstract boolean isNullable();
-
- public abstract T create(Manager container);
- public abstract void destroy(Manager container, T instance);
-}
\ No newline at end of file
+}
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Context.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Context.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Context.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -21,7 +21,10 @@
/**
+ * The contract between the Web Bean manager and a Web Beans context object.
+ * This interface should not be called directly by the application.
*
+ * @author Gavin King
* @author Pete Muir
*/
@@ -30,7 +33,8 @@
public Class<? extends Annotation> getScopeType();
- public <T> T get(Manager container, Bean<T> component, boolean create);
+ public <T> T get(Bean<T> component, boolean create);
- public <T> void remove(Manager container, Bean<T> component);
+ boolean isActive();
+
}
Deleted: ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Conversation.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Conversation.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Conversation.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -1,30 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* Licensed 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.webbeans.manager;
-
-/**
- *
- * @author Pete Muir
- */
-
-public interface Conversation
-{
-
- public void begin();
- public void end();
-}
Added: ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Decorator.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Decorator.java (rev 0)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Decorator.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.webbeans.manager;
+
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
+public abstract class Decorator extends Bean<Object>
+{
+
+ protected Decorator(Manager manager)
+ {
+ super(manager);
+ }
+
+ public abstract Class<?> getDelegateType();
+
+ public abstract Set<Annotation> getDelegateBindingTypes();
+
+ public abstract void setDelegate(Object instance, Object delegate);
+
+}
Property changes on: ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Decorator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/EnterpriseBeanLookup.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/EnterpriseBeanLookup.java (rev 0)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/EnterpriseBeanLookup.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -0,0 +1,23 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.webbeans.manager;
+
+public interface EnterpriseBeanLookup
+{
+ public Object lookup(String ejbName);
+}
Property changes on: ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/EnterpriseBeanLookup.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Initialized.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Initialized.java (rev 0)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Initialized.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.webbeans.manager;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.webbeans.BindingType;
+
+/**
+ * Event binding type for the event that is raised by the Web Bean manager when
+ * it has completed initialization and discovery.
+ */
+@BindingType
+@Retention(RUNTIME)
+@Target( { FIELD, PARAMETER })
+public @interface Initialized
+{
+}
Property changes on: ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Initialized.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/InterceptionType.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/InterceptionType.java (rev 0)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/InterceptionType.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -0,0 +1,23 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.webbeans.manager;
+
+public enum InterceptionType
+{
+ AROUND_INVOKE, POST_CONSTRUCT, PRE_DESTROY, PRE_PASSIVATE, POST_ACTIVATE
+}
\ No newline at end of file
Property changes on: ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/InterceptionType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Interceptor.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Interceptor.java (rev 0)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Interceptor.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.webbeans.manager;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.util.Set;
+
+public abstract class Interceptor extends Bean<Object>
+{
+
+ protected Interceptor(Manager manager)
+ {
+ super(manager);
+ }
+
+ public abstract Set<Annotation> getInterceptorBindingTypes();
+
+ public abstract Method getMethod(InterceptionType type);
+
+}
Property changes on: ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Interceptor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Manager.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Manager.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Manager.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -1,63 +1,85 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* Licensed 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.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.webbeans.manager;
import java.lang.annotation.Annotation;
+import java.util.List;
import java.util.Set;
+import javax.webbeans.Observer;
import javax.webbeans.TypeLiteral;
/**
+ * The contract between the application and the Web Bean manager. Also the
+ * contract between the Web Bean manager and Bean, Context and Observer objects.
*
- * @author Pete Muir
+ * @author Gavin King
+ *
*/
-
public interface Manager
{
+ public <T> Set<Bean<T>> resolveByType(Class<T> type, Annotation... bindings);
+
+ public <T> Set<Bean<T>> resolveByType(TypeLiteral<T> apiType,
+ Annotation... bindingTypes);
+
public <T> T getInstanceByType(Class<T> type, Annotation... bindingTypes);
public <T> T getInstanceByType(TypeLiteral<T> type,
Annotation... bindingTypes);
- public <T> Set<Bean<T>> resolveByType(Class<T> apiType, Annotation... bindingTypes);
+ public Set<Bean<?>> resolveByName(String name);
- public <T> Set<Bean<T>> resolveByType(TypeLiteral<T> apiType,
- Annotation... bindingTypes);
+ public Object getInstanceByName(String name);
- public Object getInstanceByName(String name);
-
public <T> T getInstance(Bean<T> bean);
- public Set<Bean<?>> resolveByName(String name);
+ public void fireEvent(Object event, Annotation... bindings);
- public void fireEvent(Object event, Annotation... bindings);
-
- public <T> void addObserver(Observer<T> observer);
-
- public <T> void removeObserver(Observer<T> observer);
-
- public <T> Set<Observer<T>> resolveObservers(T event, Annotation... bindings);
-
- public void addContext(Context context);
-
public Context getContext(Class<Annotation> scopeType);
-
- public Manager addBean(Bean<?> component);
+ public void addContext(Context context);
+
+ public Manager addBean(Bean<?> bean);
+
+ public Manager addInterceptor(Interceptor interceptor);
+
+ public Manager addDecorator(Decorator decorator);
+
+ public <T> void addObserver(Observer<T> observer, Class<T> eventType,
+ Annotation... bindings);
+
+ public <T> void addObserver(Observer<T> observer, TypeLiteral<T> eventType,
+ Annotation... bindings);
+
+ public <T> void removeObserver(Observer<T> observer, Class<T> eventType,
+ Annotation... bindings);
+
+ public <T> void removeObserver(Observer<T> observer,
+ TypeLiteral<T> eventType, Annotation... bindings);
+
+ public <T> Set<Observer<T>> resolveObservers(T event, Annotation... bindings);
+
+ public List<Interceptor> resolveInterceptors(InterceptionType type,
+ Annotation... interceptorBindings);
+
+ public List<Decorator> resolveDecorators(Set<Class<?>> types,
+ Annotation... bindingTypes);
+
}
Deleted: ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Observer.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Observer.java 2008-10-20 06:50:03 UTC (rev 120)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Observer.java 2008-10-20 18:15:46 UTC (rev 121)
@@ -1,33 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* Licensed 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.webbeans.manager;
-
-
-/**
- *
- * @author Pete Muir
- */
-
-public interface Observer<T>
-{
-
- public Class<T> getEventType();
-
- public void notify(Manager container, T event);
-
-}
[View Less]
16 years, 3 months
[webbeans-commits] Webbeans SVN: r120 - in ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans: model and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-10-20 02:50:03 -0400 (Mon, 20 Oct 2008)
New Revision: 120
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/deployment/DeploymentStrategy.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/SimpleComponentModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java
Log:
fix jdk6 compiler errors, imports
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/deployment/…
[View More]DeploymentStrategy.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/deployment/DeploymentStrategy.java 2008-10-19 22:31:44 UTC (rev 119)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/deployment/DeploymentStrategy.java 2008-10-20 06:50:03 UTC (rev 120)
@@ -10,12 +10,10 @@
import javax.webbeans.DeploymentType;
import javax.webbeans.Stereotype;
-import javax.webbeans.manager.Manager;
import org.jboss.webbeans.BeanImpl;
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
-import org.jboss.webbeans.introspector.SimpleAnnotatedType;
import org.jboss.webbeans.model.SimpleComponentModel;
import org.jboss.webbeans.model.StereotypeModel;
import org.jboss.webbeans.scannotation.AnnotationDB;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/SimpleComponentModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/SimpleComponentModel.java 2008-10-19 22:31:44 UTC (rev 119)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/SimpleComponentModel.java 2008-10-20 06:50:03 UTC (rev 120)
@@ -69,7 +69,7 @@
{
if (getType().getConstructors().length == 1)
{
- Constructor<T> constructor = getType().getConstructors()[0];
+ Constructor<T> constructor = (Constructor<T>) getType().getConstructors()[0];
log.finest("Exactly one constructor (" + constructor +") defined, using it as the component constructor for " + getType());
this.constructor = new SimpleConstructor<T>(constructor);
return;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java 2008-10-19 22:31:44 UTC (rev 119)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java 2008-10-20 06:50:03 UTC (rev 120)
@@ -84,23 +84,25 @@
return methods;
}
+ @SuppressWarnings("unchecked")
public static <T> List<Constructor<T>> getConstructors(Class<? extends T> clazz, Class<? extends Annotation> annotationType)
{
List<Constructor<T>> constructors = new ArrayList<Constructor<T>>();
- for (Constructor<T> constructor : clazz.getConstructors())
+ for (Constructor<?> constructor : clazz.getConstructors())
{
if (constructor.isAnnotationPresent(annotationType))
{
- constructors.add(constructor);
+ constructors.add((Constructor<T>) constructor);
}
}
return constructors;
}
+ @SuppressWarnings("unchecked")
public static <T> List<Constructor<T>> getConstructorsForAnnotatedParameter(Class<? extends T> clazz, Class<? extends Annotation> parameterAnnotationType)
{
List<Constructor<T>> constructors = new ArrayList<Constructor<T>>();
- for (Constructor<T> constructor : clazz.getConstructors())
+ for (Constructor<?> constructor : clazz.getConstructors())
{
for (Annotation[] annotations : constructor.getParameterAnnotations())
{
@@ -108,7 +110,7 @@
{
if (annotation.annotationType().equals(parameterAnnotationType))
{
- constructors.add(constructor);
+ constructors.add((Constructor<T>) constructor);
}
}
}
@@ -116,10 +118,11 @@
return constructors;
}
+ @SuppressWarnings("unchecked")
public static <T> List<Constructor<T>> getConstructorsForMetaAnnotatedParameter(Class<? extends T> clazz, Class<? extends Annotation> metaAnnotationType)
{
List<Constructor<T>> constructors = new ArrayList<Constructor<T>>();
- for (Constructor<T> constructor : clazz.getConstructors())
+ for (Constructor<?> constructor : clazz.getConstructors())
{
for (Annotation[] annotations : constructor.getParameterAnnotations())
{
@@ -127,7 +130,7 @@
{
if (annotation.annotationType().isAnnotationPresent(metaAnnotationType))
{
- constructors.add(constructor);
+ constructors.add((Constructor<T>) constructor);
}
}
}
[View Less]
16 years, 3 months
[webbeans-commits] Webbeans SVN: r119 - in ri/trunk: webbeans-ri/src/main/java/org/jboss/webbeans and 4 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-10-19 18:31:44 -0400 (Sun, 19 Oct 2008)
New Revision: 119
Added:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ResolutionManager.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Injectable.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableField.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableParameter.java
ri/trunk/webbeans-ri/src/main/java/org/…
[View More]jboss/webbeans/injectable/InjectableParameterWrapper.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableWrapper.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/SimpleInjectable.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedConstructor.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedField.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedConstructor.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedField.java
Removed:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverMethod.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Element.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Parameter.java
Modified:
ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Manager.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Observer.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BeanImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ModelManager.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventBus.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableMethod.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/SimpleConstructor.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Unit.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AbstractAnnotatedItem.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedType.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedItem.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedMethod.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedType.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractClassComponentModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractComponentModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/EnterpriseComponentModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/EventComponentModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/MergedStereotypesModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ProducerExpressionComponent.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ProducerMethodComponentModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/SimpleComponentModel.java
Log:
Implement most of the resolution algorithms, tests tomorrow
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Manager.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Manager.java 2008-10-19 14:07:50 UTC (rev 118)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Manager.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -35,9 +35,9 @@
public <T> T getInstanceByType(TypeLiteral<T> type,
Annotation... bindingTypes);
- public <T> T resolveByType(Class<T> apiType, Annotation... bindingTypes);
+ public <T> Set<Bean<T>> resolveByType(Class<T> apiType, Annotation... bindingTypes);
- public <T> T resolveByType(TypeLiteral<T> apiType,
+ public <T> Set<Bean<T>> resolveByType(TypeLiteral<T> apiType,
Annotation... bindingTypes);
public Object getInstanceByName(String name);
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Observer.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Observer.java 2008-10-19 14:07:50 UTC (rev 118)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Observer.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -17,10 +17,7 @@
package javax.webbeans.manager;
-import java.lang.annotation.Annotation;
-import java.util.Set;
-
/**
*
* @author Pete Muir
@@ -30,7 +27,6 @@
{
public Class<T> getEventType();
- public Set<Annotation> getEventBindingTypes();
public void notify(Manager container, T event);
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BeanImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BeanImpl.java 2008-10-19 14:07:50 UTC (rev 118)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BeanImpl.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -19,7 +19,7 @@
private AbstractComponentModel<T, ?> componentMetaModel;
- public BeanImpl(AbstractComponentModel<T, ?> componentMetaModel, Manager manager)
+ public BeanImpl(AbstractComponentModel<T, ?> componentMetaModel, ManagerImpl manager)
{
super(manager);
this.componentMetaModel = componentMetaModel;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-10-19 14:07:50 UTC (rev 118)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -20,6 +20,8 @@
import org.jboss.webbeans.bindings.StandardAnnotationLiteral;
import org.jboss.webbeans.ejb.EjbManager;
import org.jboss.webbeans.event.EventBus;
+import org.jboss.webbeans.injectable.Injectable;
+import org.jboss.webbeans.injectable.SimpleInjectable;
public class ManagerImpl implements Manager
{
@@ -28,20 +30,24 @@
private ModelManager modelManager;
private EjbManager ejbLookupManager;
private EventBus eventBus;
+ private ResolutionManager resolutionManager;
+
+ private boolean containerInitialized = false;
private ThreadLocal<Map<Class<Annotation>, Context>> contexts =
new ThreadLocal<Map<Class<Annotation>, Context>>();
- private Set<Bean<?>> components;
+ private Set<Bean<?>> beans;
public ManagerImpl(List<Annotation> enabledDeploymentTypes)
{
initEnabledDeploymentTypes(enabledDeploymentTypes);
this.modelManager = new ModelManager();
this.ejbLookupManager = new EjbManager();
- this.components = new HashSet<Bean<?>>();
+ this.beans = new HashSet<Bean<?>>();
this.eventBus = new EventBus();
+ resolutionManager = new ResolutionManager(this);
}
private void initEnabledDeploymentTypes(List<Annotation> enabledDeploymentTypes)
@@ -62,9 +68,13 @@
}
}
- public Manager addBean(Bean<?> component)
+ public Manager addBean(Bean<?> bean)
{
- components.add(component);
+ beans.add(bean);
+ if (containerInitialized)
+ {
+ // TODO Somehow deal with dynamically reigstered components
+ }
return this;
}
@@ -130,18 +140,7 @@
return null;
}
- public <T> T resolveByType(Class<T> apiType, Annotation... bindingTypes)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public <T> T resolveByType(TypeLiteral<T> apiType,
- Annotation... bindingTypes)
- {
- // TODO Auto-generated method stub
- return null;
- }
+
public <T> Set<Method> resolveDisposalMethods(Class<T> apiType, Annotation... bindingTypes)
{
@@ -173,5 +172,27 @@
// TODO Auto-generated method stub
return null;
}
+
+ public <T> Set<Bean<T>> resolveByType(Class<T> apiType,
+ Annotation... bindingTypes)
+ {
+ return getResolutionManager().get(new SimpleInjectable<T>(apiType, bindingTypes));
+ }
+
+ public <T> Set<Bean<T>> resolveByType(TypeLiteral<T> apiType,
+ Annotation... bindingTypes)
+ {
+ return resolveByType(apiType.getRawType(), bindingTypes);
+ }
+ public ResolutionManager getResolutionManager()
+ {
+ return resolutionManager;
+ }
+
+ public Set<Bean<?>> getBeans()
+ {
+ return beans;
+ }
+
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ModelManager.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ModelManager.java 2008-10-19 14:07:50 UTC (rev 118)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ModelManager.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -30,9 +30,9 @@
componentModels.put(componentModel.getType(), componentModel);
}
- public <T> AbstractComponentModel<T, ?> getComponentModel(Class<T> clazz)
+ public AbstractComponentModel<?, ?> getComponentModel(Class<?> clazz)
{
- return (AbstractComponentModel<T, ?>) componentModels.get(clazz);
+ return componentModels.get(clazz);
}
}
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ResolutionManager.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ResolutionManager.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ResolutionManager.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -0,0 +1,42 @@
+package org.jboss.webbeans;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import javax.webbeans.manager.Bean;
+
+import org.jboss.webbeans.injectable.Injectable;
+
+public class ResolutionManager
+{
+
+ private Map<Injectable<?, ?>, Set<?>> resolvedInjectionPoints;
+ private ManagerImpl manager;
+
+ public ResolutionManager(ManagerImpl manager)
+ {
+ resolvedInjectionPoints = new HashMap<Injectable<?, ?>, Set<?>>();
+ this.manager = manager;
+ }
+
+ public void registerInjectionPoint(Injectable<?, ?> injectable)
+ {
+ resolvedInjectionPoints.put(injectable, injectable.getPossibleTargets(manager.getBeans()));
+ }
+
+ public void registerInjectionPoints(Set<Injectable<?, ?>> injectables)
+ {
+ for (Injectable<?, ?> injectable : injectables)
+ {
+ registerInjectionPoint(injectable);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> Set<Bean<T>> get(Injectable<T, ?> key)
+ {
+ return (Set<Bean<T>>) resolvedInjectionPoints.get(key);
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ResolutionManager.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventBus.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventBus.java 2008-10-19 14:07:50 UTC (rev 118)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventBus.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -49,7 +49,7 @@
*/
public void addObserver(Observer<?> o)
{
- int key = generateKey(o.getEventType(), o.getEventBindingTypes());
+ int key = 1 /*TODO generateKey(o.getEventType(), o.get)*/;
Set<Observer<?>> l = registeredObservers.get(key);
if (l == null)
l = new HashSet<Observer<?>>();
@@ -101,10 +101,11 @@
*/
public void removeObserver(Observer<?> o)
{
- Set<Observer<?>> l = registeredObservers.get(generateKey(o.getEventType(), o.getEventBindingTypes()));
- if (l != null) {
- l.remove(o);
- }
+ // TODO fix
+ // Set<Observer<?>> l = registeredObservers.get(generateKey(o.getEventType(), o.getEventBindingTypes()));
+ //if (l != null) {
+ // l.remove(o);
+ //}
}
/**
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverImpl.java 2008-10-19 14:07:50 UTC (rev 118)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverImpl.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -1,17 +1,13 @@
package org.jboss.webbeans.event;
import java.lang.annotation.Annotation;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
import javax.webbeans.manager.Manager;
import javax.webbeans.manager.Observer;
-import javax.webbeans.Observes;
-import org.jboss.webbeans.injectable.Parameter;
+import org.jboss.webbeans.injectable.InjectableMethod;
+import org.jboss.webbeans.injectable.InjectableParameter;
+import org.jboss.webbeans.injectable.InjectableParameterWrapper;
import org.jboss.webbeans.model.AbstractComponentModel;
/**
@@ -35,8 +31,7 @@
{
private final AbstractComponentModel<?, ?> componentModel;
- private final ObserverMethod observerMethod;
- private final Set<Annotation> eventBindings;
+ private final InjectableMethod<?> observerMethod;
private final Class<T> eventType;
/**
@@ -48,46 +43,16 @@
* @param eventType The type of event being observed
*/
@SuppressWarnings("unchecked")
- public ObserverImpl(AbstractComponentModel<?, ?> componentModel, ObserverMethod observer, Class<T> eventType)
+ public ObserverImpl(AbstractComponentModel<?, ?> componentModel, InjectableMethod<?> observer, Class<T> eventType)
{
this.componentModel = componentModel;
this.observerMethod = observer;
this.eventType = eventType;
- List<Parameter> parms = observer.getParameters();
- eventBindings = new HashSet<Annotation>();
- for (Parameter p : parms)
- {
- if (p.getType().equals(eventType))
- {
- if ((p.getBindingTypes() != null) && (p.getBindingTypes().length > 0))
- {
- eventBindings.addAll(Arrays.asList(p.getBindingTypes()));
- // Remove the @Observes annotation since it is not an event
- // binding type
- for (Annotation annotation : eventBindings)
- {
- if (Observes.class.isAssignableFrom(annotation.getClass()))
- eventBindings.remove(annotation);
- }
- break;
- }
- }
- }
}
/*
* (non-Javadoc)
*
- * @see javax.webbeans.Observer#getEventBindingTypes()
- */
- public Set<Annotation> getEventBindingTypes()
- {
- return Collections.unmodifiableSet(this.eventBindings);
- }
-
- /*
- * (non-Javadoc)
- *
* @see javax.webbeans.Observer#getEventType()
*/
public Class<T> getEventType()
@@ -101,12 +66,34 @@
* @see javax.webbeans.Observer#notify(javax.webbeans.Container,
* java.lang.Object)
*/
- public void notify(Manager manager, T event)
+ @SuppressWarnings("unchecked")
+ public void notify(Manager manager, final T event)
{
// Get the most specialized instance of the component
Object instance = getInstance(manager);
if (instance != null)
- this.observerMethod.invoke(manager, instance, event);
+ {
+ // Let the super class get the parameter values, but substitute the event
+ // object so that we know for certain it is the correct one.
+ for (int i = 0; i < observerMethod.getParameters().size(); i++)
+ {
+ InjectableParameter<?> parameter = observerMethod.getParameters().get(i);
+ if (parameter.getType().isAssignableFrom(event.getClass()))
+ {
+ InjectableParameter<?> newParameter = new InjectableParameterWrapper(parameter)
+ {
+ @Override
+ public Object getValue(Manager manager)
+ {
+ return event;
+ }
+ };
+ observerMethod.getParameters().set(i, newParameter);
+ }
+ }
+ this.observerMethod.invoke(manager, instance);
+ }
+
}
/**
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverMethod.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverMethod.java 2008-10-19 14:07:50 UTC (rev 118)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverMethod.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -1,74 +0,0 @@
-package org.jboss.webbeans.event;
-
-import java.lang.reflect.Method;
-import java.util.List;
-
-import javax.webbeans.manager.Manager;
-
-import org.jboss.webbeans.injectable.InjectableMethod;
-import org.jboss.webbeans.injectable.Parameter;
-
-/**
- * A specialized injectable method where one of the injected parameters is an
- * event object.
- *
- * @author David Allen
- *
- */
-public class ObserverMethod extends InjectableMethod
-{
-
- public ObserverMethod(Method method)
- {
- super(method);
- }
-
- /**
- * Invokes the method on the given component instance and uses the specified
- * event object for parameter injection.
- *
- * @param manager The WebBeans manager
- * @param instance The component instance to invoke the observer method on
- * @param event The event object being fired
- */
- public void invoke(Manager manager, Object instance, Object event)
- {
- try
- {
- getMethod().invoke(instance, getParameterValues(manager, event));
- }
- catch (Exception e)
- {
- throw new RuntimeException("Unable to invoke " + getMethod() + " on " + instance, e);
- }
- }
-
- /**
- * Creates a list of parameter values to inject and uses the specified event object
- * to inject the observed event.
- *
- * @param manager The WebBeans manager
- * @param event The event being fired
- * @return an array of objects that serve as arguments for the invocation of the method
- */
- @SuppressWarnings("unchecked")
- public Object[] getParameterValues(Manager manager, Object event)
- {
- // Let the super class get the parameter values, but substitute the event
- // object so that we know for certain it is the correct one.
- Object[] parameterValues = super.getParameterValues(manager);
- List<Parameter> parms = this.getParameters();
- int i = 0;
- for (Parameter p : parms)
- {
- if (p.getType().isAssignableFrom(event.getClass()))
- {
- parameterValues[i] = event;
- break;
- }
- i++;
- }
- return parameterValues;
- }
-
-}
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Element.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Element.java 2008-10-19 14:07:50 UTC (rev 118)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Element.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -1,40 +0,0 @@
-package org.jboss.webbeans.injectable;
-
-import java.lang.annotation.Annotation;
-
-import javax.webbeans.manager.Manager;
-
-public abstract class Element<T>
-{
-
- private Annotation[] bindingTypes;
-
- public Element(Annotation[] bindingTypes)
- {
- this.bindingTypes = bindingTypes;
- }
-
- public Element()
- {
- this.bindingTypes = new Annotation[0];
- }
-
- public Annotation[] getBindingTypes()
- {
- return bindingTypes;
- }
-
- @Override
- public String toString()
- {
- return getType() + " with binding types " + getBindingTypes();
- }
-
- public T getValue(Manager container)
- {
- return container.getInstanceByType(getType(), getBindingTypes());
- }
-
- public abstract Class<? extends T> getType();
-
-}
Copied: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Injectable.java (from rev 117, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Element.java)
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Injectable.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Injectable.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -0,0 +1,95 @@
+package org.jboss.webbeans.injectable;
+
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.webbeans.manager.Bean;
+import javax.webbeans.manager.Manager;
+
+import org.jboss.webbeans.introspector.AnnotatedItem;
+
+/**
+ * Abstraction of java reflection for Web Beans, represent's something that can
+ * be injected
+ *
+ * @author Pete Muir
+ *
+ */
+public abstract class Injectable<T, S>
+{
+
+ private AnnotatedItem<T, S> annotatedItem;
+
+ public Injectable(AnnotatedItem<T, S> annotatedItem)
+ {
+ this.annotatedItem = annotatedItem;
+ }
+
+ public Annotation[] getBindingTypes()
+ {
+ return (Annotation[]) annotatedItem.getAnnotations().toArray();
+ }
+
+ protected Injectable() {}
+
+ @Override
+ public String toString()
+ {
+ return getType() + " with binding types " + getBindingTypes();
+ }
+
+ public T getValue(Manager manager)
+ {
+ return manager.getInstanceByType(getType(), getBindingTypes());
+ }
+
+ public Class<? extends T> getType()
+ {
+ return annotatedItem.getType();
+ }
+
+ public AnnotatedItem<T, S> getAnnotatedItem()
+ {
+ return annotatedItem;
+ }
+
+ public Set<Bean<?>> getPossibleTargets(Set<Bean<?>> possibleBeans)
+ {
+ Set<Bean<?>> resolvedBeans = new HashSet<Bean<?>>();
+ for (Bean<?> bean : possibleBeans)
+ {
+ if (bean.getTypes().contains(getType()))
+ {
+ List<Annotation> beanBindingTypes = new ArrayList<Annotation>(bean.getBindingTypes());
+ for (Annotation annotation : annotatedItem.getAnnotations())
+ {
+ if (beanBindingTypes.contains(annotation))
+ {
+ // TODO inspect annotation parameters
+ // TODO inspect deployment types
+ resolvedBeans.add(bean);
+ }
+ }
+ }
+ }
+ return resolvedBeans;
+ }
+
+ @Override
+ public boolean equals(Object other)
+ {
+ if (other instanceof Injectable)
+ {
+ Injectable<?, ?> that = (Injectable<?, ?>) other;
+ return this.getAnnotatedItem().equals(that.getAnnotatedItem());
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Injectable.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableField.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableField.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableField.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.injectable;
+
+import java.lang.reflect.Field;
+
+import org.jboss.webbeans.introspector.SimpleAnnotatedField;
+
+/**
+ * Abstraction of Java Reflection
+ *
+ * @author Pete Muir
+ *
+ */
+public class InjectableField<T> extends Injectable<T, Field>
+{
+
+ @SuppressWarnings("unchecked")
+ public InjectableField(Field field)
+ {
+ super(new SimpleAnnotatedField(field));
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableField.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableMethod.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableMethod.java 2008-10-19 14:07:50 UTC (rev 118)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableMethod.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -1,25 +1,36 @@
package org.jboss.webbeans.injectable;
+import java.lang.reflect.Method;
+
import javax.webbeans.manager.Manager;
-// TODO Name this class better
-public class InjectableMethod<T> extends Unit<T>
+import org.jboss.webbeans.introspector.AnnotatedItem;
+import org.jboss.webbeans.introspector.AnnotatedMethod;
+import org.jboss.webbeans.introspector.SimpleAnnotatedMethod;
+
+public class InjectableMethod<T> extends Unit<T, Method>
{
- private java.lang.reflect.Method method;
+ private AnnotatedMethod<T> method;
public InjectableMethod(java.lang.reflect.Method method)
{
super(method.getParameterTypes(), method.getParameterAnnotations());
- this.method = method;
+ this.method = new SimpleAnnotatedMethod<T>(method);
}
@SuppressWarnings("unchecked")
public T invoke(Manager container, Object instance)
{
+ return invoke(container, instance, getParameterValues(container));
+ }
+
+ @SuppressWarnings("unchecked")
+ public T invoke(Manager container, Object instance, Object[] parameters)
+ {
try
{
- return (T) method.invoke(instance, getParameterValues(container));
+ return (T) method.getAnnotatedMethod().invoke(instance, parameters);
}
catch (Exception e)
{
@@ -27,10 +38,10 @@
}
}
- public java.lang.reflect.Method getMethod()
+ @Override
+ public AnnotatedItem<T, Method> getAnnotatedItem()
{
return method;
}
-
}
Copied: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableParameter.java (from rev 117, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Parameter.java)
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableParameter.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableParameter.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -0,0 +1,25 @@
+package org.jboss.webbeans.injectable;
+
+import java.lang.annotation.Annotation;
+
+import org.jboss.webbeans.bindings.CurrentAnnotationLiteral;
+import org.jboss.webbeans.introspector.SimpleAnnotatedItem;
+
+public class InjectableParameter<T> extends Injectable<T, Object>
+{
+
+ private static Annotation[] currentBinding = {new CurrentAnnotationLiteral()};
+
+ protected InjectableParameter() {}
+
+ public InjectableParameter(Annotation[] bindingTypes, Class<? extends T> type)
+ {
+ super(new SimpleAnnotatedItem<T, Object>(bindingTypes, type));
+ }
+
+ public InjectableParameter(Class<? extends T> type)
+ {
+ this(currentBinding, type);
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableParameter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableParameterWrapper.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableParameterWrapper.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableParameterWrapper.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -0,0 +1,43 @@
+package org.jboss.webbeans.injectable;
+
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
+import javax.webbeans.manager.Bean;
+import javax.webbeans.manager.Manager;
+
+public class InjectableParameterWrapper<T> extends InjectableParameter<T>
+{
+
+ private InjectableParameter<T> delegate;
+
+ public InjectableParameterWrapper(InjectableParameter<T> delegate)
+ {
+ this.delegate = delegate;
+ }
+
+ @Override
+ public Annotation[] getBindingTypes()
+ {
+ return delegate.getBindingTypes();
+ }
+
+ @Override
+ public Set<Bean<?>> getPossibleTargets(Set<Bean<?>> possibleBeans)
+ {
+ return delegate.getPossibleTargets(possibleBeans);
+ }
+
+ @Override
+ public Class<? extends T> getType()
+ {
+ return delegate.getType();
+ }
+
+ @Override
+ public T getValue(Manager manager)
+ {
+ return delegate.getValue(manager);
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableParameterWrapper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableWrapper.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableWrapper.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableWrapper.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -0,0 +1,43 @@
+package org.jboss.webbeans.injectable;
+
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
+import javax.webbeans.manager.Bean;
+import javax.webbeans.manager.Manager;
+
+public class InjectableWrapper<T, S> extends Injectable<T, S>
+{
+
+ private Injectable<T, S> delegate;
+
+ public InjectableWrapper(Injectable<T, S> delegate)
+ {
+ this.delegate = delegate;
+ }
+
+ @Override
+ public Annotation[] getBindingTypes()
+ {
+ return delegate.getBindingTypes();
+ }
+
+ @Override
+ public Set<Bean<?>> getPossibleTargets(Set<Bean<?>> possibleBeans)
+ {
+ return delegate.getPossibleTargets(possibleBeans);
+ }
+
+ @Override
+ public Class<? extends T> getType()
+ {
+ return delegate.getType();
+ }
+
+ @Override
+ public T getValue(Manager manager)
+ {
+ return delegate.getValue(manager);
+ }
+
+}
\ No newline at end of file
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableWrapper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Parameter.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Parameter.java 2008-10-19 14:07:50 UTC (rev 118)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Parameter.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -1,33 +0,0 @@
-package org.jboss.webbeans.injectable;
-
-import java.lang.annotation.Annotation;
-
-import org.jboss.webbeans.bindings.CurrentAnnotationLiteral;
-
-public class Parameter<T> extends Element<T>
-{
-
- private static Annotation[] currentBinding = {new CurrentAnnotationLiteral()};
-
- private Class<? extends T> type;
-
- public Parameter(Annotation[] bindingTypes, Class<? extends T> type)
- {
- super(bindingTypes);
- this.type = type;
- }
-
- public Parameter(Class<? extends T> type)
- {
- super(currentBinding);
- this.type = type;
- }
-
- public Class<? extends T> getType()
- {
- return type;
- }
-
-
-
-}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/SimpleConstructor.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/SimpleConstructor.java 2008-10-19 14:07:50 UTC (rev 118)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/SimpleConstructor.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -5,41 +5,45 @@
import javax.webbeans.manager.Manager;
+import org.jboss.webbeans.introspector.AnnotatedConstructor;
+import org.jboss.webbeans.introspector.AnnotatedItem;
+import org.jboss.webbeans.introspector.SimpleAnnotatedConstructor;
import org.jboss.webbeans.util.LoggerUtil;
-public class SimpleConstructor<T> extends Unit<T> implements ComponentConstructor<T>
+public class SimpleConstructor<T> extends Unit<T, Constructor<T>> implements ComponentConstructor<T>
{
public static final String LOGGER_NAME = "componentConstructor";
private static Logger log = LoggerUtil.getLogger(LOGGER_NAME);
- private Constructor<T> constructor;
+ private AnnotatedConstructor<T> constructor;
@SuppressWarnings("unchecked")
public SimpleConstructor(Constructor<T> constructor)
{
super(constructor.getParameterTypes(), constructor.getParameterAnnotations());
- this.constructor = constructor;
+ this.constructor = new SimpleAnnotatedConstructor<T>(constructor);
log.finest("Initialized metadata for " + constructor + " with injectable parameters " + getParameters());
}
-
- public Constructor<T> getConstructor()
- {
- return constructor;
- }
public T invoke(Manager container)
{
try
{
- log.finest("Creating new instance of " + constructor.getDeclaringClass() + " with injected parameters " + getParameters());
- return constructor.newInstance(getParameterValues(container));
+ log.finest("Creating new instance of " + constructor.getType() + " with injected parameters " + getParameters());
+ return constructor.getAnnotatedConstructor().newInstance(getParameterValues(container));
}
catch (Exception e)
{
- throw new RuntimeException("Error instantiating " + constructor.getDeclaringClass(), e);
+ throw new RuntimeException("Error instantiating " + constructor.getType(), e);
}
}
+ @Override
+ public AnnotatedItem<T, Constructor<T>> getAnnotatedItem()
+ {
+ return constructor;
+ }
+
}
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/SimpleInjectable.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/SimpleInjectable.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/SimpleInjectable.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -0,0 +1,15 @@
+package org.jboss.webbeans.injectable;
+
+import java.lang.annotation.Annotation;
+
+import org.jboss.webbeans.introspector.SimpleAnnotatedItem;
+
+public class SimpleInjectable<T> extends Injectable<T, Object>
+{
+
+ public SimpleInjectable(Class<? extends T> type, Annotation[] bindingTypes)
+ {
+ super(new SimpleAnnotatedItem<T, Object>(bindingTypes, type));
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/SimpleInjectable.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Unit.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Unit.java 2008-10-19 14:07:50 UTC (rev 118)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Unit.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -6,35 +6,37 @@
import javax.webbeans.manager.Manager;
-public abstract class Unit<T>
+import org.jboss.webbeans.introspector.AnnotatedItem;
+
+public abstract class Unit<T, S>
{
- private List<Element<Object>> parameters;
+ private List<InjectableParameter<?>> parameters;
public Unit(Class<?>[] parameterTypes, Annotation[][] parameterAnnotations)
{
parameters = initParameters(parameterTypes, parameterAnnotations);
}
- public List<Element<Object>> getParameters()
+ public List<InjectableParameter<?>> getParameters()
{
return parameters;
}
@SuppressWarnings("unchecked")
- protected static List<Element<Object>> initParameters(Class<?>[] parameterTypes, Annotation[][] parameterAnnotations)
+ protected static <T> List<InjectableParameter<?>> initParameters(Class<?>[] parameterTypes, Annotation[][] parameterAnnotations)
{
- List<Element<Object>> injectedParameters = new ArrayList<Element<Object>>();
+ List<InjectableParameter<?>> injectedParameters = new ArrayList<InjectableParameter<?>>();
for (int i = 0; i < parameterTypes.length; i++)
{
if (parameterAnnotations[i].length > 0)
{
- Parameter<Object> parameter = new Parameter(parameterAnnotations[i], parameterTypes[i]);
+ InjectableParameter<Object> parameter = new InjectableParameter(parameterAnnotations[i], parameterTypes[i]);
injectedParameters.add(i, parameter);
}
else
{
- Parameter<Object> parameter = new Parameter(parameterTypes[i]);
+ InjectableParameter<Object> parameter = new InjectableParameter(parameterTypes[i]);
injectedParameters.add(i, parameter);
}
}
@@ -51,4 +53,6 @@
return parameterValues;
}
+ public abstract AnnotatedItem<T, S> getAnnotatedItem();
+
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AbstractAnnotatedItem.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AbstractAnnotatedItem.java 2008-10-19 14:07:50 UTC (rev 118)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AbstractAnnotatedItem.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -8,7 +8,9 @@
import java.util.Set;
import java.util.Map.Entry;
-public abstract class AbstractAnnotatedItem<E> implements AnnotatedItem<E>
+import org.jboss.webbeans.injectable.Injectable;
+
+public abstract class AbstractAnnotatedItem<T, S> implements AnnotatedItem<T, S>
{
private Map<Class<? extends Annotation>, Annotation> annotationMap;
@@ -26,8 +28,13 @@
protected static Map<Class<? extends Annotation>, Annotation> buildAnnotationMap(AnnotatedElement element)
{
+ return buildAnnotationMap(element.getAnnotations());
+ }
+
+ protected static Map<Class<? extends Annotation>, Annotation> buildAnnotationMap(Annotation[] annotations)
+ {
Map<Class<? extends Annotation>, Annotation> annotationMap = new HashMap<Class<? extends Annotation>, Annotation>();
- for (Annotation annotation : element.getAnnotations())
+ for (Annotation annotation : annotations)
{
annotationMap.put(annotation.annotationType(), annotation);
}
@@ -44,9 +51,9 @@
}
@SuppressWarnings("unchecked")
- public <T extends Annotation> T getAnnotation(Class<? extends T> annotationType)
+ public <A extends Annotation> A getAnnotation(Class<? extends A> annotationType)
{
- return (T) annotationMap.get(annotationType);
+ return (A) annotationMap.get(annotationType);
}
public Set<Annotation> getAnnotations(Class<? extends Annotation> metaAnnotationType)
@@ -73,8 +80,10 @@
return annotationMap.containsKey(annotatedType);
}
- protected static <T extends Annotation> Map<Class<? extends Annotation>, Set<Annotation>> populateMetaAnnotationMap(
- Class<T> metaAnnotationType, Map<Class<? extends Annotation>, Set<Annotation>> metaAnnotations, Map<Class<? extends Annotation>, Annotation> annotationMap)
+ protected static <A extends Annotation> Map<Class<? extends Annotation>, Set<Annotation>> populateMetaAnnotationMap(
+ Class<A> metaAnnotationType, Map<Class<? extends Annotation>,
+ Set<Annotation>> metaAnnotations,
+ Map<Class<? extends Annotation>, Annotation> annotationMap)
{
if (!metaAnnotations.containsKey(metaAnnotationType))
{
@@ -95,5 +104,16 @@
{
return annotationMap;
}
+
+ @Override
+ public boolean equals(Object other)
+ {
+ if (other instanceof AnnotatedItem)
+ {
+ AnnotatedItem<?, ?> that = (AnnotatedItem<?, ?>) other;
+ return this.getAnnotations().equals(that.getAnnotations()) && this.getDelegate().equals(that.getDelegate());
+ }
+ return false;
+ }
}
\ No newline at end of file
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedConstructor.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedConstructor.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedConstructor.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -0,0 +1,17 @@
+package org.jboss.webbeans.introspector;
+
+import java.lang.reflect.Constructor;
+
+/**
+ * AnnotatedType provides a uniform access to the annotations on an annotated
+ * class defined either in Java or XML
+ *
+ * @author Pete Muir
+ *
+ */
+public interface AnnotatedConstructor<T> extends AnnotatedItem<T, Constructor<T>>
+{
+
+ public Constructor<T> getAnnotatedConstructor();
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedConstructor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedField.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedField.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedField.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -0,0 +1,17 @@
+package org.jboss.webbeans.introspector;
+
+import java.lang.reflect.Field;
+
+/**
+ * AnnotatedField provides a uniform access to the annotations on an annotated
+ * field
+ *
+ * @author Pete Muir
+ *
+ */
+public interface AnnotatedField<T> extends AnnotatedItem<T, Field>
+{
+
+ public Field getAnnotatedField();
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedField.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java 2008-10-19 14:07:50 UTC (rev 118)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -11,7 +11,7 @@
* @author Pete Muir
*
*/
-public interface AnnotatedItem<E>
+public interface AnnotatedItem<T, S>
{
/**
@@ -45,6 +45,8 @@
public boolean isAnnotationPresent(
Class<? extends Annotation> annotationType);
- public E getDelegate();
+ public S getDelegate();
+
+ public Class<? extends T> getType();
}
\ No newline at end of file
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java 2008-10-19 14:07:50 UTC (rev 118)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -9,7 +9,7 @@
* @author Pete Muir
*
*/
-public interface AnnotatedMethod extends AnnotatedItem<Method>
+public interface AnnotatedMethod<T> extends AnnotatedItem<T, Method>
{
public Method getAnnotatedMethod();
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedType.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedType.java 2008-10-19 14:07:50 UTC (rev 118)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedType.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -1,6 +1,9 @@
package org.jboss.webbeans.introspector;
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
/**
* AnnotatedType provides a uniform access to the annotations on an annotated
* class defined either in Java or XML
@@ -8,7 +11,7 @@
* @author Pete Muir
*
*/
-public interface AnnotatedType<T> extends AnnotatedItem<Class<T>>
+public interface AnnotatedType<T> extends AnnotatedItem<T, Class<T>>
{
/**
@@ -17,4 +20,29 @@
*/
public Class<? extends T> getAnnotatedClass();
+ /**
+ * Get all fields on the type
+ * @return
+ */
+ public Set<AnnotatedField<?>> getFields();
+
+ /**
+ * Get all annotations which are annotated with the given annotation
+ * type
+ *
+ * If no annotations are present which are annotated with the given
+ * annotation an empty set is returned
+ */
+ public Set<AnnotatedField<?>> getAnnotatedField(Class<? extends Annotation> annotationType);
+
+ /**
+ * Get all fields which are annotated with the given meta annotation
+ * type
+ *
+ * If no annotations are present which are annotated with the given meta
+ * annotation an empty set is returned
+ */
+ public Set<AnnotatedField<?>> getMetaAnnotatedFields(
+ Class<? extends Annotation> metaAnnotationType);
+
}
\ No newline at end of file
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedConstructor.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedConstructor.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedConstructor.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -0,0 +1,38 @@
+package org.jboss.webbeans.introspector;
+
+import java.lang.reflect.Constructor;
+
+public class SimpleAnnotatedConstructor<T> extends AbstractAnnotatedItem<T, Constructor<T>> implements AnnotatedConstructor<T>
+{
+
+ private Constructor<T> constructor;
+
+ public SimpleAnnotatedConstructor(Constructor<T> constructor)
+ {
+ super(buildAnnotationMap(constructor));
+ this.constructor = constructor;
+ }
+
+ public Constructor<T> getAnnotatedConstructor()
+ {
+ return constructor;
+ }
+
+ @Override
+ public String toString()
+ {
+ return constructor + " " + getAnnotatedConstructor().toString();
+ }
+
+ public Constructor<T> getDelegate()
+ {
+ return constructor;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Class<? extends T> getType()
+ {
+ return constructor.getDeclaringClass();
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedConstructor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedField.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedField.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedField.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -0,0 +1,38 @@
+package org.jboss.webbeans.introspector;
+
+import java.lang.reflect.Field;
+
+public class SimpleAnnotatedField<T> extends AbstractAnnotatedItem<T, Field> implements AnnotatedField<T>
+{
+
+ private Field field;
+
+ public SimpleAnnotatedField(Field field)
+ {
+ super(buildAnnotationMap(field));
+ this.field = field;
+ }
+
+ public Field getAnnotatedField()
+ {
+ return field;
+ }
+
+ @Override
+ public String toString()
+ {
+ return field + " " + getAnnotatedField().toString();
+ }
+
+ public Field getDelegate()
+ {
+ return field;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Class<? extends T> getType()
+ {
+ return (Class<? extends T>) field.getType();
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedField.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedItem.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedItem.java 2008-10-19 14:07:50 UTC (rev 118)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedItem.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -3,17 +3,39 @@
import java.lang.annotation.Annotation;
import java.util.Map;
-public class SimpleAnnotatedItem<E> extends AbstractAnnotatedItem<E>
+public class SimpleAnnotatedItem<T, S> extends AbstractAnnotatedItem<T, S>
{
+ private Class<? extends T> type;
+
public SimpleAnnotatedItem(Map<Class<? extends Annotation>, Annotation> annotationMap)
{
+ this(annotationMap, null);
+ }
+
+ public SimpleAnnotatedItem(Map<Class<? extends Annotation>, Annotation> annotationMap, Class<? extends Object> type)
+ {
super(annotationMap);
}
+
+ public SimpleAnnotatedItem(Annotation[] annotations)
+ {
+ this(annotations, null);
+ }
+
+ public SimpleAnnotatedItem(Annotation[] annotations, Class<? extends Object> type)
+ {
+ this(buildAnnotationMap(annotations), type);
+ }
- public E getDelegate()
+ public S getDelegate()
{
return null;
}
+
+ public Class<? extends T> getType()
+ {
+ return type;
+ }
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedMethod.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedMethod.java 2008-10-19 14:07:50 UTC (rev 118)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedMethod.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -2,31 +2,37 @@
import java.lang.reflect.Method;
-public class SimpleAnnotatedMethod extends AbstractAnnotatedItem<Method> implements AnnotatedMethod
+public class SimpleAnnotatedMethod<T> extends AbstractAnnotatedItem<T, Method> implements AnnotatedMethod<T>
{
- private Method annotatedMethod;
+ private Method method;
public SimpleAnnotatedMethod(Method method)
{
super(buildAnnotationMap(method));
- this.annotatedMethod = method;
+ this.method = method;
}
public Method getAnnotatedMethod()
{
- return annotatedMethod;
+ return method;
}
@Override
public String toString()
{
- return annotatedMethod + " " + getAnnotatedMethod().toString();
+ return method + " " + getAnnotatedMethod().toString();
}
public Method getDelegate()
{
- return annotatedMethod;
+ return method;
}
+
+ @SuppressWarnings("unchecked")
+ public Class<? extends T> getType()
+ {
+ return (Class<? extends T>) method.getReturnType();
+ }
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedType.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedType.java 2008-10-19 14:07:50 UTC (rev 118)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/SimpleAnnotatedType.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -1,7 +1,11 @@
package org.jboss.webbeans.introspector;
import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.util.HashMap;
+import java.util.HashSet;
import java.util.Map;
+import java.util.Set;
/**
* Base class for implementing AnnotatedItem. This implementation assumes
@@ -10,15 +14,18 @@
* @author pmuir
*
*/
-public class SimpleAnnotatedType<T> extends AbstractAnnotatedItem<Class<T>> implements AnnotatedType<T>
+public class SimpleAnnotatedType<T> extends AbstractAnnotatedItem<T, Class<T>> implements AnnotatedType<T>
{
- private Class<T> annotatedClass;
+ private Class<T> clazz;
+ private Set<AnnotatedField<?>> fields;
+ private Map<Class<? extends Annotation>, Set<AnnotatedField<?>>> annotatedFields;
+ private Map<Class<? extends Annotation>, Set<AnnotatedField<?>>> metaAnnotatedFields;
public SimpleAnnotatedType(Class<T> annotatedClass, Map<Class<? extends Annotation>, Annotation> annotationMap)
{
super(annotationMap);
- this.annotatedClass = annotatedClass;
+ this.clazz = annotatedClass;
}
public SimpleAnnotatedType(Class<T> annotatedClass)
@@ -28,18 +35,105 @@
public Class<? extends T> getAnnotatedClass()
{
- return annotatedClass;
+ return clazz;
}
@Override
public String toString()
{
- return annotatedClass + " " + super.getAnnotationMap().toString();
+ return clazz + " " + super.getAnnotationMap().toString();
}
public Class<T> getDelegate()
{
- return annotatedClass;
+ return clazz;
}
+
+ public Set<AnnotatedField<?>> getFields()
+ {
+ if (fields == null)
+ {
+ initFields();
+ }
+ return fields;
+ }
+
+ private void initFields()
+ {
+ this.fields = new HashSet<AnnotatedField<?>>();
+ for(Field field : clazz.getFields())
+ {
+ fields.add(new SimpleAnnotatedField<Object>(field));
+ }
+ }
+ public Set<AnnotatedField<?>> getMetaAnnotatedFields(
+ Class<? extends Annotation> metaAnnotationType)
+ {
+ if (metaAnnotatedFields == null)
+ {
+ metaAnnotatedFields = new HashMap<Class<? extends Annotation>, Set<AnnotatedField<?>>>();
+ }
+ if (annotatedFields == null)
+ {
+ initAnnoatedFields();
+ }
+ populateMetaAnnotatedFieldMap(metaAnnotationType, annotatedFields, metaAnnotatedFields);
+ return metaAnnotatedFields.get(metaAnnotationType);
+ }
+
+ protected static <T extends Annotation> Map<Class<? extends Annotation>, Set<AnnotatedField<?>>> populateMetaAnnotatedFieldMap(
+ Class<T> metaAnnotationType,
+ Map<Class<? extends Annotation>, Set<AnnotatedField<?>>> metaAnnotations,
+ Map<Class<? extends Annotation>, Set<AnnotatedField<?>>> annotationMap)
+ {
+ if (!metaAnnotations.containsKey(metaAnnotationType))
+ {
+ Set<AnnotatedField<?>> s = new HashSet<AnnotatedField<?>>();
+ for (Class<? extends Annotation> annotationType: annotationMap.keySet())
+ {
+ if (annotationType.isAnnotationPresent(metaAnnotationType))
+ {
+ s.addAll(annotationMap.get(annotationType));
+ }
+ }
+ metaAnnotations.put(metaAnnotationType, s);
+ }
+ return metaAnnotations;
+ }
+
+ public Set<AnnotatedField<?>> getAnnotatedField(
+ Class<? extends Annotation> annotationType)
+ {
+ if (annotatedFields == null)
+ {
+ initAnnoatedFields();
+ }
+ return annotatedFields.get(annotationType);
+ }
+
+ private void initAnnoatedFields()
+ {
+ if (fields == null)
+ {
+ initFields();
+ }
+ for (AnnotatedField<?> field : fields)
+ {
+ for (Annotation annotation : field.getAnnotations())
+ {
+ if (!annotatedFields.containsKey(annotation))
+ {
+ annotatedFields.put(annotation.annotationType(), new HashSet<AnnotatedField<?>>());
+ }
+ annotatedFields.get(annotation.annotationType()).add(field);
+ }
+ }
+ }
+
+ public Class<? extends T> getType()
+ {
+ return clazz;
+ }
+
}
\ No newline at end of file
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractClassComponentModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractClassComponentModel.java 2008-10-19 14:07:50 UTC (rev 118)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractClassComponentModel.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -6,6 +6,7 @@
import java.util.HashSet;
import java.util.logging.Logger;
+import javax.webbeans.BindingType;
import javax.webbeans.Dependent;
import org.jboss.webbeans.ManagerImpl;
@@ -101,6 +102,13 @@
}
@Override
+ protected void initInjectionPoints()
+ {
+ super.initInjectionPoints();
+ annotatedItem.getMetaAnnotatedFields(BindingType.class);
+ }
+
+ @Override
protected String getDefaultName()
{
String name = Strings.decapitalize(getType().getSimpleName());
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractComponentModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractComponentModel.java 2008-10-19 14:07:50 UTC (rev 118)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractComponentModel.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -1,7 +1,6 @@
package org.jboss.webbeans.model;
import java.lang.annotation.Annotation;
-import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@@ -18,7 +17,9 @@
import org.jboss.webbeans.bindings.DependentAnnotationLiteral;
import org.jboss.webbeans.bindings.ProductionAnnotationLiteral;
import org.jboss.webbeans.injectable.ComponentConstructor;
+import org.jboss.webbeans.injectable.Injectable;
import org.jboss.webbeans.injectable.InjectableMethod;
+import org.jboss.webbeans.injectable.InjectableParameter;
import org.jboss.webbeans.introspector.AnnotatedItem;
import org.jboss.webbeans.util.LoggerUtil;
@@ -37,6 +38,7 @@
protected Class<T> type;
protected InjectableMethod<?> removeMethod;
private Set<Class> apiTypes;
+ protected Set<Injectable<?, ?>> injectionPoints;
protected void init(ManagerImpl container)
{
@@ -51,6 +53,17 @@
initApiTypes();
}
+ protected void initInjectionPoints()
+ {
+ if (removeMethod != null)
+ {
+ for (InjectableParameter<?> injectable : removeMethod.getParameters())
+ {
+ injectionPoints.add(injectable);
+ }
+ }
+ }
+
protected abstract void initType();
protected void initApiTypes()
@@ -73,9 +86,9 @@
return classes;
}
- protected abstract AnnotatedItem<E> getAnnotatedItem();
+ protected abstract AnnotatedItem<T, E> getAnnotatedItem();
- protected abstract AnnotatedItem<E> getXmlAnnotatedItem();
+ protected abstract AnnotatedItem<T, E> getXmlAnnotatedItem();
protected void initBindingTypes()
{
@@ -307,5 +320,10 @@
{
return removeMethod;
}
+
+ public Set<Injectable<?, ?>> getInjectionPoints()
+ {
+ return injectionPoints;
+ }
}
\ No newline at end of file
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/EnterpriseComponentModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/EnterpriseComponentModel.java 2008-10-19 14:07:50 UTC (rev 118)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/EnterpriseComponentModel.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -10,6 +10,7 @@
import org.jboss.webbeans.injectable.ComponentConstructor;
import org.jboss.webbeans.injectable.EnterpriseConstructor;
import org.jboss.webbeans.injectable.InjectableMethod;
+import org.jboss.webbeans.injectable.InjectableParameter;
import org.jboss.webbeans.introspector.AnnotatedType;
import org.jboss.webbeans.util.Reflections;
@@ -33,8 +34,22 @@
super.init(container);
this.constructor = new EnterpriseConstructor<T>(getEjbMetaData());
initRemoveMethod(container);
+ initInjectionPoints();
}
+ @Override
+ protected void initInjectionPoints()
+ {
+ super.initInjectionPoints();
+ if (removeMethod != null)
+ {
+ for (InjectableParameter<?> injectable : removeMethod.getParameters())
+ {
+ injectionPoints.add(injectable);
+ }
+ }
+ }
+
public ComponentConstructor<T> getConstructor()
{
return constructor;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/EventComponentModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/EventComponentModel.java 2008-10-19 14:07:50 UTC (rev 118)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/EventComponentModel.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -17,10 +17,10 @@
public class EventComponentModel<T> extends AbstractComponentModel<T, Object>
{
private String location;
- private AnnotatedItem<Object> annotatedItem;
- private AnnotatedItem<Object> xmlAnnotatedItem;
+ private AnnotatedItem<T, Object> annotatedItem;
+ private AnnotatedItem<T, Object> xmlAnnotatedItem;
- public EventComponentModel(SimpleAnnotatedItem<Object> annotatedItem, SimpleAnnotatedItem<Object> xmlAnnotatedItem, ManagerImpl manager)
+ public EventComponentModel(SimpleAnnotatedItem<T, Object> annotatedItem, SimpleAnnotatedItem<T, Object> xmlAnnotatedItem, ManagerImpl manager)
{
this.annotatedItem = annotatedItem;
this.xmlAnnotatedItem = xmlAnnotatedItem;
@@ -61,7 +61,7 @@
}
@Override
- protected AnnotatedItem<Object> getAnnotatedItem()
+ protected AnnotatedItem<T, Object> getAnnotatedItem()
{
return this.annotatedItem;
}
@@ -74,7 +74,7 @@
}
@Override
- protected AnnotatedItem<Object> getXmlAnnotatedItem()
+ protected AnnotatedItem<T, Object> getXmlAnnotatedItem()
{
return this.xmlAnnotatedItem;
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/MergedStereotypesModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/MergedStereotypesModel.java 2008-10-19 14:07:50 UTC (rev 118)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/MergedStereotypesModel.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -25,7 +25,7 @@
private Set<Class<?>> requiredTypes;
private Set<Class<? extends Annotation>> supportedScopes;
- public MergedStereotypesModel(AnnotatedItem<E> annotatedItem, AnnotatedItem<E> xmlAnnotatedItem, ManagerImpl container)
+ public MergedStereotypesModel(AnnotatedItem<T, E> annotatedItem, AnnotatedItem<T, E> xmlAnnotatedItem, ManagerImpl container)
{
possibleDeploymentTypes = new HashMap<Class<? extends Annotation>, Annotation>();
possibleScopeTypes = new HashSet<Annotation>();
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ProducerExpressionComponent.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ProducerExpressionComponent.java 2008-10-19 14:07:50 UTC (rev 118)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ProducerExpressionComponent.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -15,11 +15,11 @@
public class ProducerExpressionComponent<T> extends AbstractProducerComponentModel<T>
{
- private AnnotatedItem<Method> xmlAnnotatedItem;
- private AnnotatedItem<Method> annotatedItem = new SimpleAnnotatedItem<Method>(new HashMap<Class<? extends Annotation>, Annotation>());
+ private AnnotatedItem<T, Method> xmlAnnotatedItem;
+ private AnnotatedItem<T, Method> annotatedItem = new SimpleAnnotatedItem<T, Method>(new HashMap<Class<? extends Annotation>, Annotation>());
private String location;
- public ProducerExpressionComponent(AnnotatedItem<Method> xmlAnnotatedMethod, ManagerImpl container)
+ public ProducerExpressionComponent(AnnotatedItem<T, Method> xmlAnnotatedMethod, ManagerImpl container)
{
this.xmlAnnotatedItem = xmlAnnotatedMethod;
init(container);
@@ -41,11 +41,12 @@
protected void init(ManagerImpl container)
{
super.init(container);
+ initInjectionPoints();
}
@Override
- protected AnnotatedItem<Method> getAnnotatedItem()
+ protected AnnotatedItem<T, Method> getAnnotatedItem()
{
return annotatedItem;
}
@@ -74,7 +75,7 @@
}
@Override
- protected AnnotatedItem<Method> getXmlAnnotatedItem()
+ protected AnnotatedItem<T, Method> getXmlAnnotatedItem()
{
return xmlAnnotatedItem;
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ProducerMethodComponentModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ProducerMethodComponentModel.java 2008-10-19 14:07:50 UTC (rev 118)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ProducerMethodComponentModel.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -13,6 +13,7 @@
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.injectable.ComponentConstructor;
import org.jboss.webbeans.injectable.InjectableMethod;
+import org.jboss.webbeans.injectable.InjectableParameter;
import org.jboss.webbeans.injectable.MethodConstructor;
import org.jboss.webbeans.introspector.AnnotatedItem;
import org.jboss.webbeans.introspector.AnnotatedMethod;
@@ -22,12 +23,12 @@
public class ProducerMethodComponentModel<T> extends AbstractProducerComponentModel<T>
{
- private ComponentConstructor<T> constructor;
+ private MethodConstructor<T> constructor;
- private AnnotatedItem<Method> xmlAnnotatedItem = new SimpleAnnotatedItem<Method>(new HashMap<Class<? extends Annotation>, Annotation>());
- private AnnotatedMethod annotatedMethod;
+ private AnnotatedItem<T, Method> xmlAnnotatedItem = new SimpleAnnotatedItem<T, Method>(new HashMap<Class<? extends Annotation>, Annotation>());
+ private AnnotatedMethod<T> annotatedMethod;
- private AbstractComponentModel<?, Class<?>> declaringComponent;
+ private AbstractComponentModel<?, ?> declaringComponent;
// Cached values
private String location;
@@ -41,15 +42,33 @@
}
@Override
- protected void init(ManagerImpl container)
+ protected void init(ManagerImpl manager)
{
- super.init(container);
+ super.init(manager);
checkProducerMethod();
this.constructor = new MethodConstructor<T>(getAnnotatedItem().getDelegate());
- initRemoveMethod(container);
+ initRemoveMethod(manager);
+ initInjectionPoints();
}
@Override
+ protected void initInjectionPoints()
+ {
+ super.initInjectionPoints();
+ for (InjectableParameter<?> injectable : constructor.getParameters())
+ {
+ injectionPoints.add(injectable);
+ }
+ if (removeMethod != null)
+ {
+ for (InjectableParameter<?> injectable : removeMethod.getParameters())
+ {
+ injectionPoints.add(injectable);
+ }
+ }
+ }
+
+ @Override
protected void initDeploymentType(ManagerImpl container)
{
super.initDeploymentType(container);
@@ -65,7 +84,7 @@
protected void initDeclaringComponent(ManagerImpl container)
{
- declaringComponent = (AbstractComponentModel<?, Class<?>>) container.getModelManager().getComponentModel(getAnnotatedItem().getDelegate().getDeclaringClass());
+ declaringComponent = container.getModelManager().getComponentModel(getAnnotatedItem().getDelegate().getDeclaringClass());
}
@Override
@@ -109,7 +128,7 @@
}
@Override
- protected AnnotatedItem<Method> getAnnotatedItem()
+ protected AnnotatedMethod<T> getAnnotatedItem()
{
return annotatedMethod;
}
@@ -129,7 +148,7 @@
}
@Override
- protected AnnotatedItem<Method> getXmlAnnotatedItem()
+ protected AnnotatedItem<T, Method> getXmlAnnotatedItem()
{
return xmlAnnotatedItem;
}
@@ -180,7 +199,7 @@
return removeMethod;
}
- public AbstractComponentModel<?, Class<?>> getDeclaringComponent()
+ public AbstractComponentModel<?, ?> getDeclaringComponent()
{
return declaringComponent;
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/SimpleComponentModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/SimpleComponentModel.java 2008-10-19 14:07:50 UTC (rev 118)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/SimpleComponentModel.java 2008-10-19 22:31:44 UTC (rev 119)
@@ -8,6 +8,7 @@
import javax.webbeans.Initializer;
import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.injectable.InjectableParameter;
import org.jboss.webbeans.injectable.SimpleConstructor;
import org.jboss.webbeans.introspector.AnnotatedType;
import org.jboss.webbeans.util.LoggerUtil;
@@ -41,9 +42,20 @@
super.init(container);
initConstructor();
checkType(getType());
+ initInjectionPoints();
// TODO Interceptors
}
+ @Override
+ protected void initInjectionPoints()
+ {
+ super.initInjectionPoints();
+ for (InjectableParameter<?> injectable : constructor.getParameters())
+ {
+ injectionPoints.add(injectable);
+ }
+ }
+
public static void checkType(Class<?> type)
{
if (type.isMemberClass())
[View Less]
16 years, 3 months
[webbeans-commits] Webbeans SVN: r118 - in ri/trunk: webbeans-ri/src/main/java/org/jboss/webbeans and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-10-19 10:07:50 -0400 (Sun, 19 Oct 2008)
New Revision: 118
Modified:
ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Bean.java
ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Manager.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BeanImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/deployment/DeploymentStrategy.java
Log:
…
[View More]Update manager and bean api
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Bean.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Bean.java 2008-10-15 08:19:05 UTC (rev 117)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Bean.java 2008-10-19 14:07:50 UTC (rev 118)
@@ -28,6 +28,18 @@
public abstract class Bean<T>
{
+
+ private final Manager manager;
+
+ protected Bean(Manager manager)
+ {
+ this.manager = manager;
+ }
+
+ protected Manager getManager()
+ {
+ return manager;
+ }
public abstract Set<Class> getTypes();
public abstract Set<Annotation> getBindingTypes();
@@ -35,6 +47,9 @@
public abstract Annotation getDeploymentType();
public abstract String getName();
+ public abstract boolean isSerializable();
+ public abstract boolean isNullable();
+
public abstract T create(Manager container);
public abstract void destroy(Manager container, T instance);
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Manager.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Manager.java 2008-10-15 08:19:05 UTC (rev 117)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/manager/Manager.java 2008-10-19 14:07:50 UTC (rev 118)
@@ -41,14 +41,16 @@
Annotation... bindingTypes);
public Object getInstanceByName(String name);
+
+ public <T> T getInstance(Bean<T> bean);
- public Set<Bean> resolveByName(String name);
+ public Set<Bean<?>> resolveByName(String name);
public void fireEvent(Object event, Annotation... bindings);
- public void addObserver(Observer observer);
+ public <T> void addObserver(Observer<T> observer);
- public void removeObserver(Observer observer);
+ public <T> void removeObserver(Observer<T> observer);
public <T> Set<Observer<T>> resolveObservers(T event, Annotation... bindings);
@@ -56,6 +58,6 @@
public Context getContext(Class<Annotation> scopeType);
- public Manager addComponent(Bean component);
+ public Manager addBean(Bean<?> component);
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BeanImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BeanImpl.java 2008-10-15 08:19:05 UTC (rev 117)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BeanImpl.java 2008-10-19 14:07:50 UTC (rev 118)
@@ -19,8 +19,9 @@
private AbstractComponentModel<T, ?> componentMetaModel;
- public BeanImpl(AbstractComponentModel<T, ?> componentMetaModel)
+ public BeanImpl(AbstractComponentModel<T, ?> componentMetaModel, Manager manager)
{
+ super(manager);
this.componentMetaModel = componentMetaModel;
}
@@ -68,4 +69,18 @@
return null;
}
+ @Override
+ public boolean isNullable()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isSerializable()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-10-15 08:19:05 UTC (rev 117)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-10-19 14:07:50 UTC (rev 118)
@@ -33,14 +33,14 @@
private ThreadLocal<Map<Class<Annotation>, Context>> contexts =
new ThreadLocal<Map<Class<Annotation>, Context>>();
- private Set<Bean> components;
+ private Set<Bean<?>> components;
public ManagerImpl(List<Annotation> enabledDeploymentTypes)
{
initEnabledDeploymentTypes(enabledDeploymentTypes);
this.modelManager = new ModelManager();
this.ejbLookupManager = new EjbManager();
- this.components = new HashSet<Bean>();
+ this.components = new HashSet<Bean<?>>();
this.eventBus = new EventBus();
}
@@ -62,7 +62,7 @@
}
}
- public Manager addComponent(Bean component)
+ public Manager addBean(Bean<?> component)
{
components.add(component);
return this;
@@ -74,7 +74,7 @@
}
- public void addObserver(Observer observer)
+ public <T> void addObserver(Observer<T> observer)
{
eventBus.addObserver(observer);
}
@@ -119,12 +119,12 @@
return null;
}
- public void removeObserver(Observer observer)
+ public<T> void removeObserver(Observer<T> observer)
{
eventBus.removeObserver(observer);
}
- public Set<Bean> resolveByName(String name)
+ public Set<Bean<?>> resolveByName(String name)
{
// TODO Auto-generated method stub
return null;
@@ -167,5 +167,11 @@
{
return ejbLookupManager;
}
+
+ public <T> T getInstance(Bean<T> bean)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/deployment/DeploymentStrategy.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/deployment/DeploymentStrategy.java 2008-10-15 08:19:05 UTC (rev 117)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/deployment/DeploymentStrategy.java 2008-10-19 14:07:50 UTC (rev 118)
@@ -141,7 +141,7 @@
SimpleComponentModel componentModel = new SimpleComponentModel(
new SimpleAnnotatedType(componentClass),
new SimpleAnnotatedType(null, new HashMap()), container);
- container.addComponent(new BeanImpl(componentModel));
+ container.addBean(new BeanImpl(componentModel, null));
log.info("Web Bean: " + componentModel);
}
}
[View Less]
16 years, 4 months
[webbeans-commits] Webbeans SVN: r117 - in ri/trunk: webbeans-ri/src/main/java/org/jboss/webbeans/event and 3 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2008-10-15 04:19:05 -0400 (Wed, 15 Oct 2008)
New Revision: 117
Added:
ri/trunk/webbeans-api/src/main/java/javax/webbeans/DuplicateBindingTypeException.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventComponentModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/bindings/TameAnnotationLiteral.java
Modified:
ri/trunk/webbeans-api/src/main/java/javax/webbeans/Event.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/…
[View More]webbeans/event/EventImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/EventComponentModel.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/bindings/FishStereotypeAnnotationLiteral.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/bindings/RiverFishStereotypeAnnotationLiteral.java
Log:
Refactored event implementation and updated event APIs to latest specification revision.
Added: ri/trunk/webbeans-api/src/main/java/javax/webbeans/DuplicateBindingTypeException.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/DuplicateBindingTypeException.java (rev 0)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/DuplicateBindingTypeException.java 2008-10-15 08:19:05 UTC (rev 117)
@@ -0,0 +1,50 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed 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.webbeans;
+
+/**
+ * This exception is thrown whenever more than one binding type instance of the
+ * same type is used with the API.
+ *
+ * @author David Allen
+ */
+public class DuplicateBindingTypeException extends RuntimeException
+{
+
+ private static final long serialVersionUID = 4194175477451120383L;
+
+ public DuplicateBindingTypeException()
+ {
+ super();
+ }
+
+ public DuplicateBindingTypeException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public DuplicateBindingTypeException(String message)
+ {
+ super(message);
+ }
+
+ public DuplicateBindingTypeException(Throwable cause)
+ {
+ super(cause);
+ }
+
+}
Property changes on: ri/trunk/webbeans-api/src/main/java/javax/webbeans/DuplicateBindingTypeException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-api/src/main/java/javax/webbeans/Event.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/Event.java 2008-10-07 16:30:19 UTC (rev 116)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/Event.java 2008-10-15 08:19:05 UTC (rev 117)
@@ -19,6 +19,8 @@
import java.lang.annotation.Annotation;
+import javax.webbeans.manager.Observer;
+
/**
*
* @author Pete Muir
@@ -29,4 +31,6 @@
public void fire(T event, Annotation... bindings);
+ public void observes(Observer<T> observe, Annotation... bindings);
+
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java 2008-10-07 16:30:19 UTC (rev 116)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java 2008-10-15 08:19:05 UTC (rev 117)
@@ -2,54 +2,123 @@
import java.lang.annotation.Annotation;
import java.util.Arrays;
+import java.util.Collection;
import java.util.Set;
import java.util.HashSet;
+import javax.webbeans.BindingType;
import javax.webbeans.Current;
+import javax.webbeans.DuplicateBindingTypeException;
import javax.webbeans.Event;
import javax.webbeans.manager.Manager;
+import javax.webbeans.manager.Observer;
-import org.jboss.webbeans.BeanImpl;
-import org.jboss.webbeans.model.EventComponentModel;
-
/**
- * Implementation of an event as a simple component.
+ * Implementation of the {@link Event} interface used for the container provided
+ * Web Bean to be injected for an observable event. See section 7.4 of the JSR
+ * for more details on how this bean is provided by the container and used.
*
* @author David Allen
- *
+ *
*/
-public class EventImpl<T> extends BeanImpl<T> implements Event<T>
+public class EventImpl<T> implements Event<T>
{
+ private Collection<? extends Annotation> eventBindings;
+
// The current WB manager
@Current
protected Manager webBeansManager;
- /**
- * Creates a simple implementation of {@link Event} with no default
- * event bindings.
- */
- public EventImpl(EventComponentModel<T> componentMetaModel) {
- super(componentMetaModel);
+ public EventImpl(Annotation... eventBindings)
+ {
+ this.eventBindings = Arrays.asList(eventBindings);
}
-
- /* (non-Javadoc)
- * @see javax.webbeans.Event#fire(java.lang.Object, java.lang.annotation.Annotation[])
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.webbeans.Event#fire(java.lang.Object,
+ * java.lang.annotation.Annotation[])
*/
public void fire(T event, Annotation... bindings)
{
- // Combine the annotations passed here with the annotations (event bindings)
+ // Combine the annotations passed here with the annotations (event
+ // bindings)
// specified on the @Observable object.
Set<Annotation> eventBindings = new HashSet<Annotation>();
eventBindings.addAll(this.getBindingTypes());
- eventBindings.addAll(Arrays.asList(bindings));
-
+ // eventBindings.addAll(Arrays.asList(bindings));
+ addAnnotationBindings(eventBindings, bindings);
+
// Invoke the container method to fire the event per 7.2
- webBeansManager.fireEvent(event, eventBindings.toArray(new Annotation[0]));
+ webBeansManager
+ .fireEvent(event, eventBindings.toArray(new Annotation[0]));
}
+ public void observes(Observer<T> observe, Annotation... bindings)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * Adds each of the annotation bindings to the set, but if any binding
+ * already exists in the set, a {@link DuplicateBindingTypeException} is
+ * thrown.
+ *
+ * @param bindingsSet
+ * @param bindings
+ * @throws DuplicateBindingTypeException
+ * if any of bindings are duplicates
+ */
+ private void addAnnotationBindings(Set<Annotation> bindingsSet,
+ Annotation[] bindings)
+ {
+ if (bindings != null)
+ {
+ Set<Class<? extends Annotation>> bindingTypes = new HashSet<Class<? extends Annotation>>();
+ for (Annotation annotation : bindings)
+ {
+ // Check that the binding type is indeed a binding type
+ Annotation[] bindingAnnotations = annotation.annotationType()
+ .getAnnotations();
+ boolean isBindingType = false;
+ for (Annotation bindingAnnotation : bindingAnnotations)
+ {
+ if (bindingAnnotation.annotationType().equals(BindingType.class))
+ {
+ isBindingType = true;
+ }
+ }
+ if (!isBindingType)
+ throw new IllegalArgumentException("Annotation " + annotation
+ + " is not a binding type");
+
+ // Check that no binding type was specified more than once in the
+ // annotations
+ if (bindingTypes.contains(annotation.annotationType()))
+ {
+ throw new DuplicateBindingTypeException();
+ } else
+ {
+ bindingTypes.add(annotation.annotationType());
+ }
+ }
+ bindingsSet.addAll(Arrays.asList(bindings));
+ }
+
+ }
+
+ private Collection<? extends Annotation> getBindingTypes()
+ {
+ // Get the binding types directly from the model for the component
+ return this.eventBindings;
+ }
+
// TODO Remove the setter for the manager once WB injection is working
public void setManager(Manager manager)
{
this.webBeansManager = manager;
}
+
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/EventComponentModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/EventComponentModel.java 2008-10-07 16:30:19 UTC (rev 116)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/EventComponentModel.java 2008-10-15 08:19:05 UTC (rev 117)
@@ -9,7 +9,7 @@
/**
* Web Beans component meta model for the container instantiated, injectable,
- * observable events (Section 7.2).
+ * observable events (Section 7.4).
*
* @author David Allen
*
@@ -56,7 +56,7 @@
@Override
protected void initType()
{
- // TODO Type is null but maybe should be EventImpl
+ // TODO Get the class for Event and use it for the type
this.type = null;
}
@@ -69,7 +69,7 @@
@Override
protected String getDefaultName()
{
- // TODO Auto-generated method stub
+ // No name per 7.4
return null;
}
@@ -80,21 +80,12 @@
}
/* (non-Javadoc)
- * @see org.jboss.webbeans.model.AbstractComponentModel#checkDeploymentType()
- */
- @Override
- protected void checkDeploymentType()
- {
- // TODO Let super class check deployment type once initType() is fixed.
- }
-
- /* (non-Javadoc)
* @see org.jboss.webbeans.model.AbstractComponentModel#initDeploymentType(org.jboss.webbeans.ManagerImpl)
*/
@Override
protected void initDeploymentType(ManagerImpl container)
{
- // This is always @Standard per 7.2
+ // This is always @Standard per 7.4
this.deploymentType = new StandardAnnotationLiteral();
}
@@ -104,7 +95,7 @@
@Override
protected void initName()
{
- // No name per 7.2
+ // No name per 7.4
this.name = null;
}
@@ -114,7 +105,7 @@
@Override
protected void initScopeType()
{
- // This is always @Dependent per 7.2
+ // This is always @Dependent per 7.4
this.scopeType = new DependentAnnotationLiteral();
}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventComponentModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventComponentModelTest.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventComponentModelTest.java 2008-10-15 08:19:05 UTC (rev 117)
@@ -0,0 +1,96 @@
+package org.jboss.webbeans.test;
+
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Set;
+
+import javax.webbeans.Dependent;
+import javax.webbeans.Event;
+import javax.webbeans.Standard;
+
+import org.jboss.webbeans.bindings.StandardAnnotationLiteral;
+import org.jboss.webbeans.injectable.ComponentConstructor;
+import org.jboss.webbeans.introspector.SimpleAnnotatedItem;
+import org.jboss.webbeans.model.EventComponentModel;
+import org.jboss.webbeans.test.bindings.AnotherDeploymentTypeAnnotationLiteral;
+import org.jboss.webbeans.test.mock.MockContainerImpl;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * Unit tests for the component model used only for the container supplied
+ * Event component.
+ *
+ * @author David Allen
+ *
+ */
+public class EventComponentModelTest
+{
+ private MockContainerImpl manager = null;
+ private EventComponentModel<Event<? extends Object>> eventComponentModel = null;
+
+ @BeforeMethod
+ public void before() throws Exception
+ {
+ List<Annotation> enabledDeploymentTypes = new ArrayList<Annotation>();
+ enabledDeploymentTypes.add(new StandardAnnotationLiteral());
+ enabledDeploymentTypes.add(new AnotherDeploymentTypeAnnotationLiteral());
+ manager = new MockContainerImpl(enabledDeploymentTypes);
+ eventComponentModel = new EventComponentModel<Event<? extends Object>>(
+ new SimpleAnnotatedItem<Object>(
+ new HashMap<Class<? extends Annotation>, Annotation>()),
+ new SimpleAnnotatedItem<Object>(
+ new HashMap<Class<? extends Annotation>, Annotation>()),
+ manager);
+
+ }
+
+ /**
+ * The name should always be null since this type of component is not allowed to have a name.
+ */
+ @Test(groups = "eventbus")
+ public void testName()
+ {
+ assert eventComponentModel.getName() == null;
+ }
+
+ /**
+ * The scope type should always be @Dependent
+ */
+ @Test(groups = "eventbus")
+ public void testScopeType()
+ {
+ assert eventComponentModel.getScopeType().annotationType().equals(Dependent.class);
+ }
+
+ /**
+ * The deployment type should always be @Standard
+ */
+ @Test(groups = "eventbus")
+ public void testDeploymentType()
+ {
+ assert eventComponentModel.getDeploymentType().annotationType().equals(Standard.class);
+ }
+
+ @Test(groups = "eventbus")
+ public void testApiTypes()
+ {
+ Set<Class> apis = eventComponentModel.getApiTypes();
+ assert apis.size() >= 1;
+ for (Class api : apis)
+ {
+ api.equals(Event.class);
+ }
+ }
+
+ @Test(groups = "eventbus")
+ public void testConstructor()
+ {
+ ComponentConstructor<Event<? extends Object>> constructor = eventComponentModel.getConstructor();
+ assert constructor != null;
+ Event<? extends Object> event = constructor.invoke(manager);
+ assert event != null;
+ }
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventComponentModelTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventTest.java 2008-10-07 16:30:19 UTC (rev 116)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventTest.java 2008-10-15 08:19:05 UTC (rev 117)
@@ -2,20 +2,20 @@
import java.lang.annotation.Annotation;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
-import javax.webbeans.Current;
+import javax.webbeans.DuplicateBindingTypeException;
import javax.webbeans.Event;
import org.jboss.webbeans.bindings.StandardAnnotationLiteral;
import org.jboss.webbeans.event.EventImpl;
-import org.jboss.webbeans.introspector.SimpleAnnotatedItem;
-import org.jboss.webbeans.model.EventComponentModel;
-import org.jboss.webbeans.test.annotations.FishStereotype;
-import org.jboss.webbeans.test.annotations.RiverFishStereotype;
+import org.jboss.webbeans.test.annotations.AnimalStereotype;
+import org.jboss.webbeans.test.annotations.Tame;
+import org.jboss.webbeans.test.annotations.Synchronous;
+import org.jboss.webbeans.test.bindings.AnimalStereotypeAnnotationLiteral;
import org.jboss.webbeans.test.bindings.AnotherDeploymentTypeAnnotationLiteral;
import org.jboss.webbeans.test.bindings.FishStereotypeAnnotationLiteral;
-import org.jboss.webbeans.test.bindings.RiverFishStereotypeAnnotationLiteral;
+import org.jboss.webbeans.test.bindings.TameAnnotationLiteral;
+import org.jboss.webbeans.test.bindings.SynchronousAnnotationLiteral;
import org.jboss.webbeans.test.components.DangerCall;
import org.jboss.webbeans.test.mock.MockContainerImpl;
import org.jboss.webbeans.util.Reflections;
@@ -26,7 +26,7 @@
* Tests for the implementation of an Event component.
*
* @author David Allen
- *
+ *
*/
public class EventTest
{
@@ -42,23 +42,49 @@
}
/**
- * Tests the {@link Event#fire(Object, Annotation...)} method with a sample event
- * component.
+ * Tests the {@link Event#fire(Object, Annotation...)} method with a sample
+ * event component.
*/
@SuppressWarnings("unchecked")
@Test(groups = "eventbus")
public void testFireEvent()
{
DangerCall anEvent = new DangerCall();
- EventComponentModel<DangerCall> eventComponentModel =
- new EventComponentModel<DangerCall>(
- new SimpleAnnotatedItem<Object>(new HashMap<Class<? extends Annotation>, Annotation>()),
- new SimpleAnnotatedItem<Object>(new HashMap<Class<? extends Annotation>, Annotation>()),
- manager);
- EventImpl<DangerCall> eventComponent = new EventImpl<DangerCall>(eventComponentModel);
+ // Create a test annotation for the event and use it to construct the
+ // event object
+ Annotation[] annotations = new Annotation[] { new AnimalStereotypeAnnotationLiteral() };
+ EventImpl<DangerCall> eventComponent = new EventImpl<DangerCall>(
+ annotations);
eventComponent.setManager(manager);
- eventComponent.fire(anEvent, new FishStereotypeAnnotationLiteral(), new RiverFishStereotypeAnnotationLiteral());
+ eventComponent.fire(anEvent, new TameAnnotationLiteral(),
+ new SynchronousAnnotationLiteral());
assert anEvent.equals(manager.getEvent());
- assert Reflections.annotationSetMatches(manager.getEventBindings(), Current.class, FishStereotype.class, RiverFishStereotype.class);
+ assert Reflections.annotationSetMatches(manager.getEventBindings(),
+ AnimalStereotype.class, Tame.class,
+ Synchronous.class);
+
+ // Test duplicate annotations on the fire method call
+ boolean duplicateDetected = false;
+ try
+ {
+ eventComponent.fire(anEvent, new TameAnnotationLiteral(),
+ new TameAnnotationLiteral());
+ } catch (DuplicateBindingTypeException e)
+ {
+ duplicateDetected = true;
+ }
+ assert duplicateDetected;
+
+ // Test annotations that are not binding types
+ boolean nonBindingTypeDetected = false;
+ try
+ {
+ eventComponent.fire(anEvent, new FishStereotypeAnnotationLiteral());
+ }
+ catch (IllegalArgumentException e)
+ {
+ nonBindingTypeDetected = true;
+ }
+ assert nonBindingTypeDetected;
}
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/bindings/FishStereotypeAnnotationLiteral.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/bindings/FishStereotypeAnnotationLiteral.java 2008-10-07 16:30:19 UTC (rev 116)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/bindings/FishStereotypeAnnotationLiteral.java 2008-10-15 08:19:05 UTC (rev 117)
@@ -2,9 +2,9 @@
import javax.webbeans.AnnotationLiteral;
-import org.jboss.webbeans.test.annotations.RiverFishStereotype;
+import org.jboss.webbeans.test.annotations.FishStereotype;
-public class FishStereotypeAnnotationLiteral extends AnnotationLiteral<RiverFishStereotype> implements RiverFishStereotype
+public class FishStereotypeAnnotationLiteral extends AnnotationLiteral<FishStereotype> implements FishStereotype
{
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/bindings/RiverFishStereotypeAnnotationLiteral.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/bindings/RiverFishStereotypeAnnotationLiteral.java 2008-10-07 16:30:19 UTC (rev 116)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/bindings/RiverFishStereotypeAnnotationLiteral.java 2008-10-15 08:19:05 UTC (rev 117)
@@ -2,9 +2,9 @@
import javax.webbeans.AnnotationLiteral;
-import org.jboss.webbeans.test.annotations.FishStereotype;
+import org.jboss.webbeans.test.annotations.RiverFishStereotype;
-public class RiverFishStereotypeAnnotationLiteral extends AnnotationLiteral<FishStereotype> implements FishStereotype
+public class RiverFishStereotypeAnnotationLiteral extends AnnotationLiteral<RiverFishStereotype> implements RiverFishStereotype
{
}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/bindings/TameAnnotationLiteral.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/bindings/TameAnnotationLiteral.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/bindings/TameAnnotationLiteral.java 2008-10-15 08:19:05 UTC (rev 117)
@@ -0,0 +1,10 @@
+package org.jboss.webbeans.test.bindings;
+
+import javax.webbeans.AnnotationLiteral;
+
+import org.jboss.webbeans.test.annotations.Tame;
+
+public class TameAnnotationLiteral extends AnnotationLiteral<Tame> implements Tame
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/bindings/TameAnnotationLiteral.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
[View Less]
16 years, 4 months
[webbeans-commits] Webbeans SVN: r116 - in ri/trunk/webbeans-ri/src: test/java/org/jboss/webbeans/test and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2008-10-07 12:30:19 -0400 (Tue, 07 Oct 2008)
New Revision: 116
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventTest.java
Log:
Fixed compile problem with EventTest.
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/…
[View More]webbeans/event/EventImpl.java 2008-10-07 16:19:54 UTC (rev 115)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java 2008-10-07 16:30:19 UTC (rev 116)
@@ -47,4 +47,9 @@
webBeansManager.fireEvent(event, eventBindings.toArray(new Annotation[0]));
}
+ // TODO Remove the setter for the manager once WB injection is working
+ public void setManager(Manager manager)
+ {
+ this.webBeansManager = manager;
+ }
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventTest.java 2008-10-07 16:19:54 UTC (rev 115)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventTest.java 2008-10-07 16:30:19 UTC (rev 116)
@@ -50,12 +50,13 @@
public void testFireEvent()
{
DangerCall anEvent = new DangerCall();
- EventComponentModel<Event<DangerCall>> eventComponentModel =
- new EventComponentModel<Event<DangerCall>>(
+ EventComponentModel<DangerCall> eventComponentModel =
+ new EventComponentModel<DangerCall>(
new SimpleAnnotatedItem<Object>(new HashMap<Class<? extends Annotation>, Annotation>()),
new SimpleAnnotatedItem<Object>(new HashMap<Class<? extends Annotation>, Annotation>()),
manager);
- Event<DangerCall> eventComponent = new EventImpl<DangerCall>(eventComponentModel);
+ EventImpl<DangerCall> eventComponent = new EventImpl<DangerCall>(eventComponentModel);
+ eventComponent.setManager(manager);
eventComponent.fire(anEvent, new FishStereotypeAnnotationLiteral(), new RiverFishStereotypeAnnotationLiteral());
assert anEvent.equals(manager.getEvent());
assert Reflections.annotationSetMatches(manager.getEventBindings(), Current.class, FishStereotype.class, RiverFishStereotype.class);
[View Less]
16 years, 4 months
[webbeans-commits] Webbeans SVN: r115 - in ri/trunk/webbeans-ri/src: main/java/org/jboss/webbeans/model and 3 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2008-10-07 12:19:54 -0400 (Tue, 07 Oct 2008)
New Revision: 115
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/DangerCall.java
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/DeferredEventNotification.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventBus.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/…
[View More]event/EventImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverMethod.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractComponentModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/EventComponentModel.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockContainerImpl.java
Log:
Restructured the event component model and added new test for the implementation of Event.
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/DeferredEventNotification.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/DeferredEventNotification.java 2008-10-02 05:45:13 UTC (rev 114)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/DeferredEventNotification.java 2008-10-07 16:19:54 UTC (rev 115)
@@ -13,21 +13,21 @@
*/
public class DeferredEventNotification implements Synchronization
{
- private Manager container;
+ private Manager manager;
private Observer<Object> observer;
private Object event;
/**
* Creates a new deferred event notifier.
*
- * @param container The Web Beans container
+ * @param manager The Web Beans manager
* @param observer The observer to be notified
* @param event The event being fired
*/
@SuppressWarnings("unchecked")
- public DeferredEventNotification(Manager container, Object event, Observer observer)
+ public DeferredEventNotification(Manager manager, Object event, Observer observer)
{
- this.container = container;
+ this.manager = manager;
this.observer = observer;
this.event = event;
}
@@ -40,7 +40,7 @@
public void beforeCompletion()
{
// Execute the observer method on the event
- observer.notify(container, event);
+ observer.notify(manager, event);
}
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventBus.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventBus.java 2008-10-02 05:45:13 UTC (rev 114)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventBus.java 2008-10-07 16:19:54 UTC (rev 115)
@@ -25,7 +25,7 @@
*/
public class EventBus
{
- private final Map<Integer, Set<Observer>> registeredObservers;
+ private final Map<Integer, Set<Observer<?>>> registeredObservers;
private final TransactionManager tm;
private String tmName = "java:/TransactionManager";
@@ -38,7 +38,7 @@
*/
public EventBus()
{
- registeredObservers = new HashMap<Integer, Set<Observer>>();
+ registeredObservers = new HashMap<Integer, Set<Observer<?>>>();
tm = JNDI.lookup(tmName, TransactionManager.class);
}
@@ -47,12 +47,12 @@
* event information is already encapsulated as part of the observer.
* @param o The observer that should receive events
*/
- public void addObserver(Observer o)
+ public void addObserver(Observer<?> o)
{
int key = generateKey(o.getEventType(), o.getEventBindingTypes());
- Set<Observer> l = registeredObservers.get(key);
+ Set<Observer<?>> l = registeredObservers.get(key);
if (l == null)
- l = new HashSet<Observer>();
+ l = new HashSet<Observer<?>>();
l.add(o);
registeredObservers.put(key, l);
}
@@ -67,7 +67,7 @@
* @throws IllegalStateException
* @throws RollbackException
*/
- public void deferEvent(Manager container, Object event, Observer o) throws SystemException, IllegalStateException, RollbackException
+ public void deferEvent(Manager container, Object event, Observer<?> o) throws SystemException, IllegalStateException, RollbackException
{
if (tm != null) {
// Get the current transaction associated with the thread
@@ -84,18 +84,24 @@
* @param bindings Optional event bindings
* @return A set of Observers
*/
- public Set getObservers(Object event, Annotation... bindings)
+ @SuppressWarnings("unchecked")
+ public <T> Set<Observer<T>> getObservers(T event, Annotation... bindings)
{
- return registeredObservers.get(generateKey(event.getClass(), Arrays.asList(bindings)));
+ Set<Observer<T>> results = new HashSet<Observer<T>>();
+ for (Observer<?> observer : registeredObservers.get(generateKey(event.getClass(), Arrays.asList(bindings))))
+ {
+ results.add((Observer<T>) observer);
+ }
+ return results;
}
/**
* Removes an observer from the event bus.
* @param o The observer to remove
*/
- public void removeObserver(Observer o)
+ public void removeObserver(Observer<?> o)
{
- Set<Observer> l = registeredObservers.get(generateKey(o.getEventType(), o.getEventBindingTypes()));
+ Set<Observer<?>> l = registeredObservers.get(generateKey(o.getEventType(), o.getEventBindingTypes()));
if (l != null) {
l.remove(o);
}
@@ -108,7 +114,7 @@
* @param eventBindings An optional set of event bindings
* @return
*/
- public int generateKey(Class<?> eventType, Collection eventBindings)
+ public int generateKey(Class<?> eventType, Collection<Annotation> eventBindings)
{
// Produce the sum of the hash codes for the event type and the set of
// event bindings.
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java 2008-10-02 05:45:13 UTC (rev 114)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java 2008-10-07 16:19:54 UTC (rev 115)
@@ -5,7 +5,9 @@
import java.util.Set;
import java.util.HashSet;
+import javax.webbeans.Current;
import javax.webbeans.Event;
+import javax.webbeans.manager.Manager;
import org.jboss.webbeans.BeanImpl;
import org.jboss.webbeans.model.EventComponentModel;
@@ -18,7 +20,9 @@
*/
public class EventImpl<T> extends BeanImpl<T> implements Event<T>
{
- private EventComponentModel<T> componentModel;
+ // The current WB manager
+ @Current
+ protected Manager webBeansManager;
/**
* Creates a simple implementation of {@link Event} with no default
@@ -26,7 +30,6 @@
*/
public EventImpl(EventComponentModel<T> componentMetaModel) {
super(componentMetaModel);
- this.componentModel = componentMetaModel;
}
/* (non-Javadoc)
@@ -41,7 +44,7 @@
eventBindings.addAll(Arrays.asList(bindings));
// Invoke the container method to fire the event per 7.2
- componentModel.getContainer().fireEvent(event, eventBindings.toArray(new Annotation[0]));
+ webBeansManager.fireEvent(event, eventBindings.toArray(new Annotation[0]));
}
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverMethod.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverMethod.java 2008-10-02 05:45:13 UTC (rev 114)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverMethod.java 2008-10-07 16:19:54 UTC (rev 115)
@@ -27,15 +27,15 @@
* Invokes the method on the given component instance and uses the specified
* event object for parameter injection.
*
- * @param container The WebBeans container
+ * @param manager The WebBeans manager
* @param instance The component instance to invoke the observer method on
* @param event The event object being fired
*/
- public void invoke(Manager container, Object instance, Object event)
+ public void invoke(Manager manager, Object instance, Object event)
{
try
{
- getMethod().invoke(instance, getParameterValues(container, event));
+ getMethod().invoke(instance, getParameterValues(manager, event));
}
catch (Exception e)
{
@@ -47,16 +47,16 @@
* Creates a list of parameter values to inject and uses the specified event object
* to inject the observed event.
*
- * @param container The WebBeans container
+ * @param manager The WebBeans manager
* @param event The event being fired
* @return an array of objects that serve as arguments for the invocation of the method
*/
@SuppressWarnings("unchecked")
- public Object[] getParameterValues(Manager container, Object event)
+ public Object[] getParameterValues(Manager manager, Object event)
{
// Let the super class get the parameter values, but substitute the event
// object so that we know for certain it is the correct one.
- Object[] parameterValues = super.getParameterValues(container);
+ Object[] parameterValues = super.getParameterValues(manager);
List<Parameter> parms = this.getParameters();
int i = 0;
for (Parameter p : parms)
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractComponentModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractComponentModel.java 2008-10-02 05:45:13 UTC (rev 114)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractComponentModel.java 2008-10-07 16:19:54 UTC (rev 115)
@@ -30,8 +30,8 @@
private static Logger log = LoggerUtil.getLogger(LOGGER_NAME);
private Set<Annotation> bindingTypes;
- private String name;
- private Annotation scopeType;
+ protected String name;
+ protected Annotation scopeType;
private MergedStereotypesModel<T, E> mergedStereotypes;
protected Annotation deploymentType;
protected Class<T> type;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/EventComponentModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/EventComponentModel.java 2008-10-02 05:45:13 UTC (rev 114)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/EventComponentModel.java 2008-10-07 16:19:54 UTC (rev 115)
@@ -1,13 +1,11 @@
package org.jboss.webbeans.model;
-import java.lang.annotation.Annotation;
-
-import javax.webbeans.manager.Manager;
-
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.bindings.DependentAnnotationLiteral;
import org.jboss.webbeans.bindings.StandardAnnotationLiteral;
-import org.jboss.webbeans.introspector.AnnotatedType;
+import org.jboss.webbeans.injectable.ComponentConstructor;
+import org.jboss.webbeans.introspector.AnnotatedItem;
+import org.jboss.webbeans.introspector.SimpleAnnotatedItem;
/**
* Web Beans component meta model for the container instantiated, injectable,
@@ -16,56 +14,108 @@
* @author David Allen
*
*/
-public class EventComponentModel<T> extends SimpleComponentModel<T>
+public class EventComponentModel<T> extends AbstractComponentModel<T, Object>
{
+ private String location;
+ private AnnotatedItem<Object> annotatedItem;
+ private AnnotatedItem<Object> xmlAnnotatedItem;
- private StandardAnnotationLiteral deploymentType = new StandardAnnotationLiteral();
- private DependentAnnotationLiteral scopeType = new DependentAnnotationLiteral();
- private ManagerImpl container;
+ public EventComponentModel(SimpleAnnotatedItem<Object> annotatedItem, SimpleAnnotatedItem<Object> xmlAnnotatedItem, ManagerImpl manager)
+ {
+ this.annotatedItem = annotatedItem;
+ this.xmlAnnotatedItem = xmlAnnotatedItem;
+ this.init(manager);
+ }
- /**
- * Creates a new component model for an injectable, observable event object.
- * @see org.jboss.webbeans.event.EventImpl
- *
- * @param annotatedItem The injectable variable declared in Java
- * @param xmlAnnotatedItem The injectable variable defined in XML
- * @param container The Web Beans container
+ @Override
+ public ComponentConstructor<T> getConstructor()
+ {
+ // TODO No constructor is needed, but make sure this does not brake instantiation
+ return null;
+ }
+
+ @Override
+ public String getLocation()
+ {
+ if (location == null)
+ {
+ location = "type: Event Component;";
+ }
+ return location;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "EventComponentModel[" + getType().getName() + "]";
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.webbeans.model.AbstractClassComponentModel#initType()
*/
- public EventComponentModel(AnnotatedType annotatedItem, AnnotatedType xmlAnnotatedItem, ManagerImpl container)
+ @Override
+ protected void initType()
{
- super(annotatedItem, xmlAnnotatedItem, container);
- // This is needed later for the impl of Event to fire events with the container
- this.container = container;
+ // TODO Type is null but maybe should be EventImpl
+ this.type = null;
}
- /**
- * The implementation of the container used to create this model.
- * @return the container
+ @Override
+ protected AnnotatedItem<Object> getAnnotatedItem()
+ {
+ return this.annotatedItem;
+ }
+
+ @Override
+ protected String getDefaultName()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ protected AnnotatedItem<Object> getXmlAnnotatedItem()
+ {
+ return this.xmlAnnotatedItem;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.webbeans.model.AbstractComponentModel#checkDeploymentType()
*/
- public Manager getContainer()
+ @Override
+ protected void checkDeploymentType()
{
- return container;
+ // TODO Let super class check deployment type once initType() is fixed.
}
+ /* (non-Javadoc)
+ * @see org.jboss.webbeans.model.AbstractComponentModel#initDeploymentType(org.jboss.webbeans.ManagerImpl)
+ */
@Override
- public Annotation getDeploymentType()
+ protected void initDeploymentType(ManagerImpl container)
{
// This is always @Standard per 7.2
- return deploymentType;
+ this.deploymentType = new StandardAnnotationLiteral();
}
+ /* (non-Javadoc)
+ * @see org.jboss.webbeans.model.AbstractComponentModel#initName()
+ */
@Override
- public String getName()
+ protected void initName()
{
// No name per 7.2
- return "";
+ this.name = null;
}
+ /* (non-Javadoc)
+ * @see org.jboss.webbeans.model.AbstractComponentModel#initScopeType()
+ */
@Override
- public Annotation getScopeType()
+ protected void initScopeType()
{
// This is always @Dependent per 7.2
- return scopeType;
+ this.scopeType = new DependentAnnotationLiteral();
}
-
+
}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventTest.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventTest.java 2008-10-07 16:19:54 UTC (rev 115)
@@ -0,0 +1,63 @@
+package org.jboss.webbeans.test;
+
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import javax.webbeans.Current;
+import javax.webbeans.Event;
+import org.jboss.webbeans.bindings.StandardAnnotationLiteral;
+import org.jboss.webbeans.event.EventImpl;
+import org.jboss.webbeans.introspector.SimpleAnnotatedItem;
+import org.jboss.webbeans.model.EventComponentModel;
+import org.jboss.webbeans.test.annotations.FishStereotype;
+import org.jboss.webbeans.test.annotations.RiverFishStereotype;
+import org.jboss.webbeans.test.bindings.AnotherDeploymentTypeAnnotationLiteral;
+import org.jboss.webbeans.test.bindings.FishStereotypeAnnotationLiteral;
+import org.jboss.webbeans.test.bindings.RiverFishStereotypeAnnotationLiteral;
+import org.jboss.webbeans.test.components.DangerCall;
+import org.jboss.webbeans.test.mock.MockContainerImpl;
+import org.jboss.webbeans.util.Reflections;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * Tests for the implementation of an Event component.
+ *
+ * @author David Allen
+ *
+ */
+public class EventTest
+{
+ private MockContainerImpl manager = null;
+
+ @BeforeMethod
+ public void before() throws Exception
+ {
+ List<Annotation> enabledDeploymentTypes = new ArrayList<Annotation>();
+ enabledDeploymentTypes.add(new StandardAnnotationLiteral());
+ enabledDeploymentTypes.add(new AnotherDeploymentTypeAnnotationLiteral());
+ manager = new MockContainerImpl(enabledDeploymentTypes);
+ }
+
+ /**
+ * Tests the {@link Event#fire(Object, Annotation...)} method with a sample event
+ * component.
+ */
+ @SuppressWarnings("unchecked")
+ @Test(groups = "eventbus")
+ public void testFireEvent()
+ {
+ DangerCall anEvent = new DangerCall();
+ EventComponentModel<Event<DangerCall>> eventComponentModel =
+ new EventComponentModel<Event<DangerCall>>(
+ new SimpleAnnotatedItem<Object>(new HashMap<Class<? extends Annotation>, Annotation>()),
+ new SimpleAnnotatedItem<Object>(new HashMap<Class<? extends Annotation>, Annotation>()),
+ manager);
+ Event<DangerCall> eventComponent = new EventImpl<DangerCall>(eventComponentModel);
+ eventComponent.fire(anEvent, new FishStereotypeAnnotationLiteral(), new RiverFishStereotypeAnnotationLiteral());
+ assert anEvent.equals(manager.getEvent());
+ assert Reflections.annotationSetMatches(manager.getEventBindings(), Current.class, FishStereotype.class, RiverFishStereotype.class);
+ }
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/DangerCall.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/DangerCall.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/DangerCall.java 2008-10-07 16:19:54 UTC (rev 115)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.components;
+
+import javax.webbeans.Production;
+
+@Production
+public class DangerCall
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/DangerCall.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockContainerImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockContainerImpl.java 2008-10-02 05:45:13 UTC (rev 114)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockContainerImpl.java 2008-10-07 16:19:54 UTC (rev 115)
@@ -1,16 +1,52 @@
package org.jboss.webbeans.test.mock;
import java.lang.annotation.Annotation;
+import java.util.Arrays;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import org.jboss.webbeans.ManagerImpl;
public class MockContainerImpl extends ManagerImpl
{
-
+ private Object event = null;
+ private Annotation[] eventBindings = null;
+
public MockContainerImpl(List<Annotation> enabledDeploymentTypes)
{
super(enabledDeploymentTypes);
}
+ /* (non-Javadoc)
+ * @see org.jboss.webbeans.ManagerImpl#fireEvent(java.lang.Object, java.lang.annotation.Annotation[])
+ */
+ @Override
+ public void fireEvent(Object event, Annotation... bindings)
+ {
+ // Record the event
+ this.event = event;
+ this.eventBindings = bindings;
+ }
+
+ /**
+ * Retrieves the event which was last fired with this manager.
+ * @return the event
+ */
+ public final Object getEvent()
+ {
+ return event;
+ }
+
+ /**
+ * @return the eventBindings
+ */
+ public final Set<Annotation> getEventBindings()
+ {
+ if (eventBindings != null)
+ return new HashSet<Annotation>(Arrays.asList(eventBindings));
+ else
+ return null;
+ }
+
}
[View Less]
16 years, 4 months
[webbeans-commits] Webbeans SVN: r114 - ri/trunk/webbeans-api/src/main/java/javax/webbeans.
by webbeans-commits@lists.jboss.org
Author: gavin.king(a)jboss.com
Date: 2008-10-02 01:45:13 -0400 (Thu, 02 Oct 2008)
New Revision: 114
Removed:
ri/trunk/webbeans-api/src/main/java/javax/webbeans/EventBindingType.java
Log:
doesn't exist in spec
Deleted: ri/trunk/webbeans-api/src/main/java/javax/webbeans/EventBindingType.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/EventBindingType.java 2008-10-01 19:27:58 UTC (rev 113)
+++ ri/trunk/webbeans-…
[View More]api/src/main/java/javax/webbeans/EventBindingType.java 2008-10-02 05:45:13 UTC (rev 114)
@@ -1,38 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* Licensed 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.webbeans;
-
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- *
- * @author Pete Muir
- */
-
-@Target(TYPE)
-@Retention(RUNTIME)
-@Documented
-public @interface EventBindingType
-{
-
-}
[View Less]
16 years, 4 months
[webbeans-commits] Webbeans SVN: r113 - ri/trunk.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2008-10-01 15:27:58 -0400 (Wed, 01 Oct 2008)
New Revision: 113
Added:
ri/trunk/eclipse-code-formatter-profile.xml
Log:
Added an Eclipse Java code formatter profile originally taken from Seam.
Added: ri/trunk/eclipse-code-formatter-profile.xml
===================================================================
--- ri/trunk/eclipse-code-formatter-profile.xml (rev 0)
+++ ri/trunk/eclipse-code-formatter-profile.xml 2008-10-01 19:27:58 UTC (rev 113)
…
[View More]@@ -0,0 +1,267 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<profiles version="11">
+<profile kind="CodeFormatterProfile" name="WebBeans" version="11">
+<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
+<setting id="org.eclipse.jdt.core.compiler.source" value="1.5"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="800"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="3"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
+<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="3"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.5"/>
+<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
+<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.5"/>
+<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
+</profile>
+</profiles>
Property changes on: ri/trunk/eclipse-code-formatter-profile.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
[View Less]
16 years, 4 months