Author: pete.muir(a)jboss.org
Date: 2009-01-31 09:52:00 -0500 (Sat, 31 Jan 2009)
New Revision: 1370
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/FacadeImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/InstanceImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractFacadeBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EventBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/InstanceBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/standard/InjectionPointBean.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/EventObserver.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/MethodInjectionPoint.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/ParameterInjectionPoint.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/Resolver.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/AnnotationStore.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedItem.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedClass.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedField.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedMethod.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedParameter.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/metadata/StereotypeModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockBootstrap.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/lookup/ResolutionByTypeTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/House.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Space.java
Log:
WBRI-99
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/FacadeImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/FacadeImpl.java 2009-01-31
14:23:43 UTC (rev 1369)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/FacadeImpl.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -36,7 +36,7 @@
public abstract class FacadeImpl<T>
{
// The binding types the helper operates on
- protected final Set<? extends Annotation> bindingTypes;
+ protected final Set<? extends Annotation> bindings;
// The Web Beans manager
protected final Manager manager;
// The type of the operation
@@ -47,13 +47,13 @@
*
* @param type The event type
* @param manager The Web Beans manager
- * @param bindingTypes The binding types
+ * @param bindings The binding types
*/
- protected FacadeImpl(Class<T> type, Manager manager, Annotation...
bindingTypes)
+ protected FacadeImpl(Class<T> type, Manager manager, Annotation... bindings)
{
this.manager = manager;
this.type = type;
- this.bindingTypes = mergeBindingTypes(new HashSet<Annotation>(),
bindingTypes);
+ this.bindings = mergeBindings(new HashSet<Annotation>(), bindings);
}
/**
@@ -65,15 +65,15 @@
* @param newBindings New bindings
* @return The union of the bindings
*/
- protected Set<Annotation> mergeBindingTypes(Set<? extends Annotation>
currentBindings, Annotation... newBindings)
+ protected Set<Annotation> mergeBindings(Set<? extends Annotation>
currentBindings, Annotation... newBindings)
{
Set<Annotation> result = new HashSet<Annotation>();
result.addAll(currentBindings);
for (Annotation newAnnotation : newBindings)
{
- if (!Reflections.isBindingType(newAnnotation))
+ if (!Reflections.isBindings(newAnnotation))
{
- throw new IllegalArgumentException(newAnnotation + " is not a binding
type for " + this);
+ throw new IllegalArgumentException(newAnnotation + " is not a binding
for " + this);
}
if (result.contains(newAnnotation))
{
@@ -97,13 +97,13 @@
/**
* Merges the binding this helper operates upon with the parameters
*
- * @param bindingTypes The bindings to merge
+ * @param bindings The bindings to merge
*
* @return The union of the binding types
*/
- protected Annotation[] mergeBindings(Annotation... newBindingTypes)
+ protected Annotation[] mergeBindings(Annotation... newBindings)
{
- return mergeBindingTypes(bindingTypes, newBindingTypes).toArray(new
Annotation[0]);
+ return mergeBindings(bindings, newBindings).toArray(new Annotation[0]);
}
/**
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/InstanceImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/InstanceImpl.java 2009-01-31
14:23:43 UTC (rev 1369)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/InstanceImpl.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -39,25 +39,25 @@
*
* @param type The obtainable type
* @param manager The Web Beans manager
- * @param bindingTypes The binding types
+ * @param bindings The binding types
*/
- public InstanceImpl(Class<T> type, Manager manager, Annotation... bindingTypes)
+ public InstanceImpl(Class<T> type, Manager manager, Annotation... bindings)
{
- super(type, manager, bindingTypes);
+ super(type, manager, bindings);
}
/**
* Gets an instance with the matching binding types
*
- * @param bindingTypes The binding types
+ * @param bindings The binding types
* @return The instance
*
* @see javax.inject.Instance#get(Annotation...)
* @see javax.inject.manager.Manager#getInstanceByType(Class, Annotation...)
*/
- public T get(Annotation... bindingTypes)
+ public T get(Annotation... bindings)
{
- return manager.getInstanceByType(type, mergeBindings(bindingTypes));
+ return manager.getInstanceByType(type, mergeBindings(bindings));
}
/**
@@ -68,7 +68,7 @@
@Override
public String toString()
{
- return "Obtainable instance for type " + type + " and binding types
" + bindingTypes;
+ return "Obtainable instance for type " + type + " and binding types
" + bindings;
}
/**
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 2009-01-31
14:23:43 UTC (rev 1369)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -199,7 +199,7 @@
* use.
*
* @param apiType The API type to match
- * @param bindingTypes The binding types to match
+ * @param bindings The binding types to match
* @return The set of matching disposal methods
*/
public <T> Set<AnnotatedMethod<?>>
resolveDisposalMethods(Class<T> apiType, Annotation... bindings)
@@ -273,7 +273,7 @@
* Resolves beans by API type and binding types
*
* @param type The API type to match
- * @param bindingTypes The binding types to match
+ * @param bindings The binding types to match
* @return The set of matching beans
*
* @see javax.inject.manager.Manager#resolveByType(java.lang.Class,
@@ -288,7 +288,7 @@
* Resolves beans by API type literal and binding types
*
* @param type The API type literal to match
- * @param bindingTypes The binding types to match
+ * @param bindings The binding types to match
* @return The set of matching beans
*
* @see javax.inject.manager.Manager#resolveByType(javax.inject.TypeLiteral,
@@ -304,7 +304,7 @@
* perform the resolution. For internal use.
*
* @param element The item to resolve
- * @param bindingTypes The binding types to match
+ * @param bindings The binding types to match
* @return The set of matching beans
*/
public <T> Set<Bean<T>> resolveByType(AnnotatedItem<T, ?>
element, Annotation... bindings)
@@ -491,7 +491,7 @@
// Also check that the binding types are truly binding types
for (Annotation binding : bindings)
{
- if (!Reflections.isBindingType(binding))
+ if (!Reflections.isBindings(binding))
{
throw new IllegalArgumentException("Event type " +
event.getClass().getName() + " cannot be fired with non-binding type " +
binding.getClass().getName() + " specified");
}
@@ -616,7 +616,7 @@
currentInjectionPoint.set(injectionPoint);
}
AnnotatedItem<T, ?> element = AnnotatedClassImpl.of((Class<T>)
injectionPoint.getType(), injectionPoint.getBindings().toArray(new Annotation[0]));
- Bean<T> bean = getBeanByType(element, element.getBindingTypesAsArray());
+ Bean<T> bean = getBeanByType(element, element.getBindingsAsArray());
if (creationalContext instanceof CreationalContextImpl)
{
CreationalContextImpl<?> ctx = (CreationalContextImpl<?>)
creationalContext;
@@ -674,7 +674,7 @@
* Returns an instance by API type and binding types
*
* @param type The API type to match
- * @param bindingTypes The binding types to match
+ * @param bindings The binding types to match
* @return An instance of the bean
*
* @see javax.inject.manager.Manager#getInstanceByType(java.lang.Class,
@@ -690,7 +690,7 @@
* Returns an instance by type literal and binding types
*
* @param type The type to match
- * @param bindingTypes The binding types to match
+ * @param bindings The binding types to match
* @return An instance of the bean
*
* @see javax.inject.manager.Manager#getInstanceByType(javax.inject.TypeLiteral,
@@ -706,7 +706,7 @@
* and return
*
* @param element The annotated item to match
- * @param bindingTypes The binding types to match
+ * @param bindings The binding types to match
* @return An instance of the bean
*/
private <T> T getInstanceByType(AnnotatedItem<T, ?> element, Annotation...
bindings)
@@ -785,7 +785,7 @@
* Resolves a list of decorators based on API types and binding types Os
*
* @param types The set of API types to match
- * @param bindingTypes The binding types to match
+ * @param bindings The binding types to match
* @return A list of matching decorators
*
* @see javax.inject.manager.Manager#resolveDecorators(java.util.Set,
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-01-31
14:23:43 UTC (rev 1369)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -90,7 +90,7 @@
// Logger
private LogProvider log = Logging.getLogProvider(AbstractBean.class);
// The binding types
- private Set<Annotation> bindingTypes;
+ private Set<Annotation> bindings;
// The name
protected String name;
// The scope type
@@ -131,12 +131,12 @@
protected void init()
{
mergedStereotypes = new MergedStereotypes<T,
E>(getAnnotatedItem().getMetaAnnotations(Stereotype.class));
- initBindingTypes();
+ initBindings();
if (isSpecializing())
{
- preCheckSpecialization();
- initSpecialization();
- postSpecialization();
+ preSpecialize();
+ specialize();
+ postSpecialize();
}
initDefaultBindings();
initType();
@@ -165,23 +165,23 @@
/**
* Initializes the binding types
*/
- protected void initBindingTypes()
+ protected void initBindings()
{
- this.bindingTypes = new HashSet<Annotation>();
-
this.bindingTypes.addAll(getAnnotatedItem().getMetaAnnotations(BindingType.class));
+ this.bindings = new HashSet<Annotation>();
+ this.bindings.addAll(getAnnotatedItem().getMetaAnnotations(BindingType.class));
}
protected void initDefaultBindings()
{
- if (bindingTypes.size() == 0)
+ if (bindings.size() == 0)
{
log.trace("Adding default @Current binding type");
- this.bindingTypes.add(new CurrentLiteral());
+ this.bindings.add(new CurrentLiteral());
}
else
{
if (log.isTraceEnabled())
- log.trace("Using binding types " + bindingTypes + " specified
by annotations");
+ log.trace("Using binding types " + bindings + " specified by
annotations");
}
}
@@ -330,13 +330,13 @@
}
}
- protected void postSpecialization()
+ protected void postSpecialize()
{
if (getAnnotatedItem().isAnnotationPresent(Named.class) &&
getSpecializedBean().getAnnotatedItem().isAnnotationPresent(Named.class))
{
throw new DefinitionException("Cannot put name on specializing and
specialized class");
}
- this.bindingTypes.addAll(getSpecializedBean().getBindings());
+ this.bindings.addAll(getSpecializedBean().getBindings());
if (isSpecializing() &&
getSpecializedBean().getAnnotatedItem().isAnnotationPresent(Named.class))
{
this.name = getSpecializedBean().getName();
@@ -345,12 +345,12 @@
manager.getSpecializedBeans().put(getSpecializedBean(), this);
}
- protected void preCheckSpecialization()
+ protected void preSpecialize()
{
}
- protected void initSpecialization()
+ protected void specialize()
{
}
@@ -387,7 +387,7 @@
*/
public Set<Annotation> getBindings()
{
- return bindingTypes;
+ return bindings;
}
/**
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java 2009-01-31
14:23:43 UTC (rev 1369)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -284,9 +284,9 @@
}
@Override
- protected void preCheckSpecialization()
+ protected void preSpecialize()
{
- super.preCheckSpecialization();
+ super.preSpecialize();
if (getAnnotatedItem().getSuperclass() == null ||
getAnnotatedItem().getSuperclass().getType().equals(Object.class))
{
throw new DefinitionException("Specializing bean must extend another
bean");
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractFacadeBean.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractFacadeBean.java 2009-01-31
14:23:43 UTC (rev 1369)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractFacadeBean.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -53,16 +53,6 @@
init();
}
- /*
- * Gets the binding type as an array
- *
- * @return The binding types
- */
- protected Annotation[] getBindingTypesArray()
- {
- return annotatedItem.getBindingTypesAsArray();
- }
-
/**
* Gets the type paramater of the facade
*
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2009-01-31
14:23:43 UTC (rev 1369)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -182,9 +182,9 @@
/**
* Validates specialization
*/
- protected void preCheckSpecialization()
+ protected void preSpecialize()
{
- super.preCheckSpecialization();
+ super.preSpecialize();
if
(!manager.getEjbDescriptorCache().containsKey(getAnnotatedItem().getSuperclass().getType()))
{
throw new DefinitionException("Annotation defined specializing EJB must
have EJB superclass");
@@ -192,7 +192,7 @@
}
@Override
- protected void initSpecialization()
+ protected void specialize()
{
this.specializedBean = EnterpriseBean.of(getAnnotatedItem().getSuperclass(),
manager);
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EventBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EventBean.java 2009-01-31
14:23:43 UTC (rev 1369)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EventBean.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -136,7 +136,7 @@
@SuppressWarnings("unchecked")
Class<T> eventType = (Class<T>) clazz;
- return new EventImpl<T>(eventType, manager, getBindingTypesArray());
+ return new EventImpl<T>(eventType, manager,
getAnnotatedItem().getBindingsAsArray());
}
finally
{
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/InstanceBean.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/InstanceBean.java 2009-01-31
14:23:43 UTC (rev 1369)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/InstanceBean.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -71,7 +71,7 @@
try
{
DependentContext.INSTANCE.setActive(true);
- return new InstanceImpl<T>(getTypeParameter(), manager,
getBindingTypesArray());
+ return new InstanceImpl<T>(getTypeParameter(), manager,
getAnnotatedItem().getBindingsAsArray());
}
finally
{
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2009-01-31
14:23:43 UTC (rev 1369)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -209,7 +209,7 @@
}
@Override
- protected void preCheckSpecialization()
+ protected void preSpecialize()
{
if
(declaringBean.getAnnotatedItem().getSuperclass().getDeclaredMethod(getAnnotatedItem().getAnnotatedMethod())
== null)
{
@@ -218,7 +218,7 @@
}
@Override
- protected void initSpecialization()
+ protected void specialize()
{
this.specializedBean =
ProducerMethodBean.of(declaringBean.getAnnotatedItem().getSuperclass().getMethod(getAnnotatedItem().getAnnotatedMethod()),
SimpleBean.of(declaringBean.getAnnotatedItem().getSuperclass(), manager), manager);
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-01-31
14:23:43 UTC (rev 1369)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -354,9 +354,9 @@
}
@Override
- protected void preCheckSpecialization()
+ protected void preSpecialize()
{
- super.preCheckSpecialization();
+ super.preSpecialize();
if
(manager.getEjbDescriptorCache().containsKey(getAnnotatedItem().getSuperclass().getType()))
{
throw new DefinitionException("Simple bean must specialize a simple
bean");
@@ -364,7 +364,7 @@
}
@Override
- protected void initSpecialization()
+ protected void specialize()
{
this.specializedBean = SimpleBean.of(getAnnotatedItem().getSuperclass(), manager);
}
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/standard/InjectionPointBean.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/standard/InjectionPointBean.java 2009-01-31
14:23:43 UTC (rev 1369)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/standard/InjectionPointBean.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -69,9 +69,8 @@
return getManager().getInjectionPoint();
}
- public void destroy(InjectionPoint instance)
+ public void destroy(InjectionPoint instance)
{
- // TODO Auto-generated method stub
}
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 2009-01-31
14:23:43 UTC (rev 1369)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -48,33 +48,33 @@
*
* @param eventType The event type
* @param manager The Web Beans manager
- * @param bindingTypes The binding types
+ * @param bindings The binding types
*/
- public EventImpl(Class<T> eventType, Manager manager, Annotation...
bindingTypes)
+ public EventImpl(Class<T> eventType, Manager manager, Annotation... bindings)
{
- super(eventType, manager, bindingTypes);
+ super(eventType, manager, bindings);
}
/**
* Fires an event
*
* @param event The event object
- * @param bindingTypes Additional binding types
+ * @param bindings Additional binding types
*/
- public void fire(T event, Annotation... bindingTypes)
+ public void fire(T event, Annotation... bindings)
{
- manager.fireEvent(event, mergeBindings(bindingTypes));
+ manager.fireEvent(event, mergeBindings(bindings));
}
/**
* Registers an observer
*
* @param observer
- * @param bindingTypes Additional binding types
+ * @param bindings Additional binding types
*/
- public void observe(Observer<T> observer, Annotation... bindingTypes)
+ public void observe(Observer<T> observer, Annotation... bindings)
{
- manager.addObserver(observer, type, mergeBindings(bindingTypes));
+ manager.addObserver(observer, type, mergeBindings(bindings));
}
@Override
@@ -83,7 +83,7 @@
StringBuilder buffer = new StringBuilder();
buffer.append("Observable Event:\n");
buffer.append(" Event Type: " + type.getName() + "\n");
- buffer.append(Strings.collectionToString(" Event Bindings: ",
bindingTypes));
+ buffer.append(Strings.collectionToString(" Event Bindings: ",
bindings));
return buffer.toString();
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventObserver.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventObserver.java 2009-01-31
14:23:43 UTC (rev 1369)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventObserver.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -75,7 +75,7 @@
{
for (Annotation annotation : bindingAnnotations)
{
- if (!Reflections.isBindingType(annotation))
+ if (!Reflections.isBindings(annotation))
{
throw new IllegalArgumentException(annotation + " is not a binding type
for " + this);
}
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 2009-01-31
14:23:43 UTC (rev 1369)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverImpl.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -111,7 +111,7 @@
Class<T> c = (Class<T>)
observerMethod.getAnnotatedParameters(Observes.class).get(0).getType();
this.eventType = c;
- this.bindings =
observerMethod.getAnnotatedParameters(Observes.class).get(0).getBindingTypesAsArray();
+ this.bindings =
observerMethod.getAnnotatedParameters(Observes.class).get(0).getBindingsAsArray();
initTransactionObservationPhase();
this.conditional =
!observerMethod.getAnnotatedParameters(IfExists.class).isEmpty();
}
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java 2009-01-31
14:23:43 UTC (rev 1369)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -76,7 +76,7 @@
public Set<Annotation> getBindings()
{
- return delegate().getBindingTypes();
+ return delegate().getBindings();
}
public T newInstance(ManagerImpl manager, CreationalContext<?>
creationalContext)
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java 2009-01-31
14:23:43 UTC (rev 1369)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -50,7 +50,7 @@
public Set<Annotation> getBindings()
{
- return delegate().getAnnotationStore().getBindingTypes();
+ return delegate().getAnnotationStore().getBindings();
}
public void inject(Object declaringInstance, ManagerImpl manager,
CreationalContext<?> creationalContext)
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/MethodInjectionPoint.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/MethodInjectionPoint.java 2009-01-31
14:23:43 UTC (rev 1369)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/MethodInjectionPoint.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -76,7 +76,7 @@
public Set<Annotation> getBindings()
{
- return delegate().getBindingTypes();
+ return delegate().getBindings();
}
public T invoke(Object declaringInstance, ManagerImpl manager,
CreationalContext<?> creationalContext)
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/ParameterInjectionPoint.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/ParameterInjectionPoint.java 2009-01-31
14:23:43 UTC (rev 1369)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/ParameterInjectionPoint.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -48,7 +48,7 @@
public Set<Annotation> getBindings()
{
- return delegate().getBindingTypes();
+ return delegate().getBindings();
}
public Member getMember()
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/Resolver.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/Resolver.java 2009-01-31
14:23:43 UTC (rev 1369)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/Resolver.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -69,7 +69,7 @@
if (other instanceof AnnotatedItem)
{
AnnotatedItem<?, ?> that = (AnnotatedItem<?, ?>) other;
- return delegate().isAssignableFrom(that) &&
that.getBindingTypes().equals(this.getBindingTypes());
+ return delegate().isAssignableFrom(that) &&
that.getBindings().equals(this.getBindings());
}
else
{
@@ -290,7 +290,7 @@
Set<Bean<T>> resolvedBeans = new HashSet<Bean<T>>();
for (Bean<?> bean : beans)
{
- if (element.isAssignableFrom(bean.getTypes()) &&
containsAllBindingBindingTypes(element, bean.getBindings()))
+ if (element.isAssignableFrom(bean.getTypes()) &&
containsAllBindings(element, bean.getBindings()))
{
@SuppressWarnings("unchecked")
Bean<T> b = (Bean<T>) bean;
@@ -304,20 +304,20 @@
* Checks if binding criteria fulfill all binding types
*
* @param element The binding criteria to check
- * @param bindingTypes The binding types to check
+ * @param bindings The binding types to check
* @return True if all matches, false otherwise
*/
- private boolean containsAllBindingBindingTypes(AnnotatedItem<?, ?> element,
Set<Annotation> bindingTypes)
+ private boolean containsAllBindings(AnnotatedItem<?, ?> element,
Set<Annotation> bindings)
{
- for (Annotation bindingType : element.getBindingTypes())
+ for (Annotation binding : element.getBindings())
{
- BindingTypeModel<?> bindingTypeModel =
MetaDataCache.instance().getBindingTypeModel(bindingType.annotationType());
- if (bindingTypeModel.getNonBindingTypes().size() > 0)
+ BindingTypeModel<?> bindingType =
MetaDataCache.instance().getBindingTypeModel(binding.annotationType());
+ if (bindingType.getNonBindingTypes().size() > 0)
{
boolean matchFound = false;
- for (Annotation otherBindingType : bindingTypes)
+ for (Annotation otherBinding : bindings)
{
- if (bindingTypeModel.isEqual(bindingType, otherBindingType))
+ if (bindingType.isEqual(binding, otherBinding))
{
matchFound = true;
}
@@ -327,7 +327,7 @@
return false;
}
}
- else if (!bindingTypes.contains(bindingType))
+ else if (!bindings.contains(binding))
{
return false;
}
@@ -339,10 +339,10 @@
* Resolves decorators according to binding criteria
*
* @param types The set of API types to match
- * @param bindingTypes The binding types to match
+ * @param bindings The binding types to match
* @return The set of matching decorators
*/
- public List<Decorator> resolveDecorators(Set<Type> types, Annotation[]
bindingTypes)
+ public List<Decorator> resolveDecorators(Set<Type> types, Annotation[]
bindings)
{
// TODO Implement decorators
return Collections.emptyList();
@@ -352,7 +352,7 @@
* Resolves interceptors according to binding criteria
*
* @param types The set of API types to match
- * @param bindingTypes The binding types to match
+ * @param bindings The binding types to match
* @return The set of matching interceptors
*/
public List<Interceptor> resolveInterceptors(InterceptionType type, Annotation[]
interceptorBindings)
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 2009-01-31
14:23:43 UTC (rev 1369)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -86,7 +86,7 @@
* @returns A set of binding types present on the type. Returns an empty set
* if there are no matches.
*/
- public Set<Annotation> getBindingTypes();
+ public Set<Annotation> getBindings();
/**
* Gets the binding types for this element
@@ -94,7 +94,7 @@
* @returns An array of binding types present on the type. Returns an empty
* array if there are no matches.
*/
- public Annotation[] getBindingTypesAsArray();
+ public Annotation[] getBindingsAsArray();
/**
* Gets an annotation for the annotation type specified.
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotationStore.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotationStore.java 2009-01-31
14:23:43 UTC (rev 1369)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotationStore.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -274,7 +274,7 @@
}
@Deprecated
- public Set<Annotation> getBindingTypes()
+ public Set<Annotation> getBindings()
{
if (getMetaAnnotations(BindingType.class).size() > 0)
{
@@ -287,9 +287,9 @@
}
@Deprecated
- public Annotation[] getBindingTypesAsArray()
+ public Annotation[] getBindingsAsArray()
{
- return getBindingTypes().toArray(EMPTY_ANNOTATION_ARRAY);
+ return getBindings().toArray(EMPTY_ANNOTATION_ARRAY);
}
public <A extends Annotation> A getAnnotation(Class<? extends A>
annotationType)
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedItem.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedItem.java 2009-01-31
14:23:43 UTC (rev 1369)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedItem.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -76,18 +76,18 @@
* @see org.jboss.webbeans.introspector.AnnotatedItem
*/
@Deprecated
- public Set<Annotation> getBindingTypes()
+ public Set<Annotation> getBindings()
{
- return delegate().getBindingTypes();
+ return delegate().getBindings();
}
/**
* @see org.jboss.webbeans.introspector.AnnotatedItem
*/
@Deprecated
- public Annotation[] getBindingTypesAsArray()
+ public Annotation[] getBindingsAsArray()
{
- return delegate().getBindingTypesAsArray();
+ return delegate().getBindingsAsArray();
}
/**
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedClass.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedClass.java 2009-01-31
14:23:43 UTC (rev 1369)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedClass.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -79,18 +79,18 @@
* @see org.jboss.webbeans.introspector.AnnotatedItem
*/
@Deprecated
- public Set<Annotation> getBindingTypes()
+ public Set<Annotation> getBindings()
{
- return getAnnotationStore().getBindingTypes();
+ return getAnnotationStore().getBindings();
}
/**
* @see org.jboss.webbeans.introspector.AnnotatedItem
*/
@Deprecated
- public Annotation[] getBindingTypesAsArray()
+ public Annotation[] getBindingsAsArray()
{
- return getAnnotationStore().getBindingTypesAsArray();
+ return getAnnotationStore().getBindingsAsArray();
}
/**
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedField.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedField.java 2009-01-31
14:23:43 UTC (rev 1369)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedField.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -78,18 +78,18 @@
* @see org.jboss.webbeans.introspector.AnnotatedItem
*/
@Deprecated
- public Set<Annotation> getBindingTypes()
+ public Set<Annotation> getBindings()
{
- return getAnnotationStore().getBindingTypes();
+ return getAnnotationStore().getBindings();
}
/**
* @see org.jboss.webbeans.introspector.AnnotatedItem
*/
@Deprecated
- public Annotation[] getBindingTypesAsArray()
+ public Annotation[] getBindingsAsArray()
{
- return getAnnotationStore().getBindingTypesAsArray();
+ return getAnnotationStore().getBindingsAsArray();
}
/**
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedMethod.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedMethod.java 2009-01-31
14:23:43 UTC (rev 1369)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedMethod.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -79,18 +79,18 @@
* @see org.jboss.webbeans.introspector.AnnotatedItem
*/
@Deprecated
- public Set<Annotation> getBindingTypes()
+ public Set<Annotation> getBindings()
{
- return getAnnotationStore().getBindingTypes();
+ return getAnnotationStore().getBindings();
}
/**
* @see org.jboss.webbeans.introspector.AnnotatedItem
*/
@Deprecated
- public Annotation[] getBindingTypesAsArray()
+ public Annotation[] getBindingsAsArray()
{
- return getAnnotationStore().getBindingTypesAsArray();
+ return getAnnotationStore().getBindingsAsArray();
}
/**
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedParameter.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedParameter.java 2009-01-31
14:23:43 UTC (rev 1369)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedParameter.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -84,18 +84,18 @@
* @see org.jboss.webbeans.introspector.AnnotatedItem
*/
@Deprecated
- public Set<Annotation> getBindingTypes()
+ public Set<Annotation> getBindings()
{
- return getAnnotationStore().getBindingTypes();
+ return getAnnotationStore().getBindings();
}
/**
* @see org.jboss.webbeans.introspector.AnnotatedItem
*/
@Deprecated
- public Annotation[] getBindingTypesAsArray()
+ public Annotation[] getBindingsAsArray()
{
- return getAnnotationStore().getBindingTypesAsArray();
+ return getAnnotationStore().getBindingsAsArray();
}
/**
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java 2009-01-31
14:23:43 UTC (rev 1369)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -214,9 +214,9 @@
}
@Deprecated
- public Set<Annotation> getBindingTypes()
+ public Set<Annotation> getBindings()
{
- return getAnnotationStore().getBindingTypes();
+ return getAnnotationStore().getBindings();
}
/**
@@ -227,12 +227,12 @@
*
* @return An array of (binding type) annotations
*
- * @see org.jboss.webbeans.introspector.AnnotatedItem#getBindingTypesAsArray()
+ * @see org.jboss.webbeans.introspector.AnnotatedItem#getBindingsAsArray()
*/
@Deprecated
- public Annotation[] getBindingTypesAsArray()
+ public Annotation[] getBindingsAsArray()
{
- return getAnnotationStore().getBindingTypesAsArray();
+ return getAnnotationStore().getBindingsAsArray();
}
/**
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/metadata/StereotypeModel.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/metadata/StereotypeModel.java 2009-01-31
14:23:43 UTC (rev 1369)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/metadata/StereotypeModel.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -66,16 +66,16 @@
initSupportedScopes();
initRequiredTypes();
initInterceptorBindings();
- checkBindingTypes();
+ checkBindings();
}
/**
* Validates the binding types
*/
- private void checkBindingTypes()
+ private void checkBindings()
{
- Set<Annotation> bindingTypes =
getAnnotatedAnnotation().getMetaAnnotations(BindingType.class);
- if (bindingTypes.size() > 0)
+ Set<Annotation> bindings =
getAnnotatedAnnotation().getMetaAnnotations(BindingType.class);
+ if (bindings.size() > 0)
{
throw new DefinitionException("Cannot declare binding types on a stereotype
" + getAnnotatedAnnotation());
}
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 2009-01-31
14:23:43 UTC (rev 1369)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -540,13 +540,15 @@
* Checks the bindingType to make sure the annotation was declared properly
* as a binding type (annotated with @BindingType).
*
- * @param bindingType The binding type to check
+ * @param binding The binding type to check
* @return true only if the annotation is really a binding type
*/
- public static boolean isBindingType(Annotation bindingType)
+ @Deprecated
+ // TODO Move this method
+ public static boolean isBindings(Annotation binding)
{
boolean isBindingAnnotation = false;
- if (bindingType.annotationType().isAnnotationPresent(BindingType.class))
+ if (binding.annotationType().isAnnotationPresent(BindingType.class))
{
isBindingAnnotation = true;
}
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockBootstrap.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockBootstrap.java 2009-01-31
14:23:43 UTC (rev 1369)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockBootstrap.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -152,7 +152,6 @@
public Object resolveResource(InjectionPoint injectionPoint, NamingContext
namingContext)
{
- // TODO Auto-generated method stub
return null;
}
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/lookup/ResolutionByTypeTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/lookup/ResolutionByTypeTest.java 2009-01-31
14:23:43 UTC (rev 1369)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/lookup/ResolutionByTypeTest.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -23,13 +23,13 @@
{
AnnotatedField<Tuna> tuna = new
AnnotatedFieldImpl<Tuna>(FishFarm.class.getDeclaredField("tuna"),
fishFarmClass);
assert tuna.getType().isAssignableFrom(Tuna.class);
- assert tuna.getBindingTypes().size() == 1;
- assert tuna.getBindingTypes().contains(new CurrentLiteral());
+ assert tuna.getBindings().size() == 1;
+ assert tuna.getBindings().contains(new CurrentLiteral());
assert tuna.getType().isAssignableFrom(Tuna.class);
}
@Test
- public void testOneBindingType() throws Exception
+ public void testOneBinding() throws Exception
{
AnnotatedField<ScottishFish> whiteScottishFishField = new
AnnotatedFieldImpl<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"),
fishFarmClass);
Bean<Cod> codBean = SimpleBean.of(Cod.class, manager);
@@ -45,7 +45,7 @@
}
@Test
- public void testABindingType() throws Exception
+ public void testABinding() throws Exception
{
AnnotatedField<Animal> whiteChunkyFishField = new
AnnotatedFieldImpl<Animal>(FishFarm.class.getDeclaredField("realChunkyWhiteFish"),
fishFarmClass);
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/House.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/House.java 2009-01-31
14:23:43 UTC (rev 1369)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/House.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -7,10 +7,8 @@
class House
{
- public House()
- {
- // TODO Auto-generated constructor stub
- }
+ // For serialization
+ public House() {}
@Initializer
public House(House house)
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Space.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Space.java 2009-01-31
14:23:43 UTC (rev 1369)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/Space.java 2009-01-31
14:52:00 UTC (rev 1370)
@@ -7,10 +7,8 @@
class Space
{
- public Space()
- {
- // TODO Auto-generated constructor stub
- }
+ // For serialization
+ public Space() {}
@Initializer
public Space(Planet planet)