Author: dallen6
Date: 2009-01-08 13:12:02 -0500 (Thu, 08 Jan 2009)
New Revision: 836
Added:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/InjectionPointProvider.java
Removed:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/InjectionPointFactory.java
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java
Log:
Changed name of injection point factory to provider.
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-08
17:40:08 UTC (rev 835)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2009-01-08
18:12:02 UTC (rev 836)
@@ -56,7 +56,7 @@
import org.jboss.webbeans.ejb.EjbDescriptorCache;
import org.jboss.webbeans.ejb.spi.EjbResolver;
import org.jboss.webbeans.event.EventManager;
-import org.jboss.webbeans.injection.InjectionPointFactory;
+import org.jboss.webbeans.injection.InjectionPointProvider;
import org.jboss.webbeans.introspector.AnnotatedItem;
import org.jboss.webbeans.introspector.AnnotatedMethod;
import org.jboss.webbeans.introspector.jlr.AnnotatedClassImpl;
@@ -87,7 +87,7 @@
// The Web Beans event manager
private transient final EventManager eventManager;
// An injection point metadata beans factory
- private transient final InjectionPointFactory injectionPointFactory;
+ private transient final InjectionPointProvider injectionPointProvider;
// The bean resolver
private transient final Resolver resolver;
@@ -135,7 +135,7 @@
this.contextMap = new ContextMap();
this.eventManager = new EventManager();
this.ejbDescriptorCache = new EjbDescriptorCache();
- this.injectionPointFactory = new InjectionPointFactory();
+ this.injectionPointProvider = new InjectionPointProvider();
List<Class<? extends Annotation>> defaultEnabledDeploymentTypes = new
ArrayList<Class<? extends Annotation>>();
defaultEnabledDeploymentTypes.add(0, Standard.class);
@@ -761,9 +761,9 @@
*
* @return the factory
*/
- public InjectionPointFactory getInjectionPointFactory()
+ public InjectionPointProvider getInjectionPointFactory()
{
- return injectionPointFactory;
+ return injectionPointProvider;
}
// Serialization
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-08
17:40:08 UTC (rev 835)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-01-08
18:12:02 UTC (rev 836)
@@ -30,7 +30,7 @@
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.MetaDataCache;
import org.jboss.webbeans.context.DependentContext;
-import org.jboss.webbeans.injection.InjectionPointFactory;
+import org.jboss.webbeans.injection.InjectionPointProvider;
import org.jboss.webbeans.injection.InjectionPointImpl;
import org.jboss.webbeans.introspector.AnnotatedClass;
import org.jboss.webbeans.introspector.AnnotatedConstructor;
@@ -117,15 +117,15 @@
{
checkProducedInjectionPoints();
}
- InjectionPointFactory injectionPointFactory =
manager.getInjectionPointFactory();
- injectionPointFactory.pushBean(this);
+ InjectionPointProvider injectionPointProvider =
manager.getInjectionPointFactory();
+ injectionPointProvider.pushBean(this);
T instance = null;
try
{
instance = constructor.newInstance(manager);
try
{
- injectionPointFactory.pushInstance(instance);
+ injectionPointProvider.pushInstance(instance);
bindDecorators();
bindInterceptors();
injectEjbAndCommonFields(instance);
@@ -135,12 +135,12 @@
}
finally
{
- injectionPointFactory.popInstance();
+ injectionPointProvider.popInstance();
}
}
finally
{
- injectionPointFactory.popBean();
+ injectionPointProvider.popBean();
}
return instance;
}
@@ -271,17 +271,17 @@
*/
protected void injectBoundFields(T instance)
{
- InjectionPointFactory injectionPointFactory = manager.getInjectionPointFactory();
+ InjectionPointProvider injectionPointProvider =
manager.getInjectionPointFactory();
for (AnnotatedField<?> injectableField : getInjectableFields())
{
- injectionPointFactory.pushInjectionPoint(injectableField);
+ injectionPointProvider.pushInjectionPoint(injectableField);
try
{
injectableField.inject(instance, manager);
}
finally
{
- injectionPointFactory.popInjectionPoint();
+ injectionPointProvider.popInjectionPoint();
}
}
}
Deleted:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/InjectionPointFactory.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/InjectionPointFactory.java 2009-01-08
17:40:08 UTC (rev 835)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/InjectionPointFactory.java 2009-01-08
18:12:02 UTC (rev 836)
@@ -1,132 +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 org.jboss.webbeans.injection;
-
-import java.lang.reflect.Member;
-import java.util.Stack;
-
-import javax.webbeans.InjectionPoint;
-import javax.webbeans.manager.Bean;
-
-import org.jboss.webbeans.introspector.AnnotatedMember;
-
-/**
- * Factory used to create the container provided implementation for the
- * InjectionPoint beans. This factory maintains a stack with the current bean
- * and instance being created so that this information is readily available for
- * construction of a new InjectionPoint bean.
- *
- * @author David Allen
- *
- */
-public class InjectionPointFactory
-{
- private final Stack<Bean<?>> beans = new Stack<Bean<?>>();
- private final Stack<Object> beanInstances = new Stack<Object>();
- private final Stack<AnnotatedMember<?, ? extends Member>> injectionPoints
= new Stack<AnnotatedMember<?, ? extends Member>>();
-
- /**
- * Pushes the current bean that is being instantiated onto a stack for later
- * use.
- *
- * @param currentBean The bean being instantiated
- */
- public void pushBean(Bean<?> currentBean)
- {
- beans.push(currentBean);
- }
-
- /**
- * Pushes the current bean instance that has been instantiated, but has not
- * yet had any injection points initialized.
- *
- * @param currentInstance The bean instance last instantiated
- */
- public void pushInstance(Object currentInstance)
- {
- beanInstances.push(currentInstance);
- }
-
- /**
- * Pushes the current injection point being processed.
- *
- * @param injectedMember The metadata for the injection point
- */
- public void pushInjectionPoint(AnnotatedMember<?, ? extends Member>
injectedMember)
- {
- injectionPoints.push(injectedMember);
- }
-
- /**
- * Pops the bean from the stack. This should be called
- * whenever all processing is complete for instantiating a bean.
- */
- public void popBean()
- {
- beans.pop();
- }
-
- /**
- * Pops the current instance from the stack. This should be called
- * whenever all processing is complete for instantiating a bean.
- */
- public void popInstance()
- {
- beanInstances.pop();
- }
-
- /**
- * Pops the current injection point being processed. This should be called once
- * the injection point is bound.
- */
- public void popInjectionPoint()
- {
- injectionPoints.pop();
- }
-
- /**
- * Creates an InjectionPoint based on the current state of processing as
- * indicated by this factory's stack of injection points and related
- * information.
- *
- * @return a new injection point metadata object
- */
- public InjectionPoint getPreviousInjectionPoint()
- {
- // When the injected member is a constructor, we are short one instance,
- // so the instance on the top of the stack is the bean instance
- // we want. Otherwise, it is the second to last instance same as
- // the bean stack.
- InjectionPoint injectionPoint = null;
- Bean<?> currentBean = beans.pop();
- AnnotatedMember<?, ? extends Member> currentInjection =
injectionPoints.pop();
- if (beanInstances.size() < beans.size())
- {
- injectionPoint = new InjectionPointImpl(injectionPoints.peek(), beans.peek(),
beanInstances.peek());
- }
- else
- {
- Object currentInstance = beanInstances.pop();
- injectionPoint = new InjectionPointImpl(injectionPoints.peek(), beans.peek(),
beanInstances.peek());
- beanInstances.push(currentInstance);
- }
- beans.push(currentBean);
- injectionPoints.push(currentInjection);
- return injectionPoint;
- }
-}
Copied:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/InjectionPointProvider.java
(from rev 835,
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/InjectionPointFactory.java)
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/InjectionPointProvider.java
(rev 0)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/InjectionPointProvider.java 2009-01-08
18:12:02 UTC (rev 836)
@@ -0,0 +1,131 @@
+/*
+ * 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 org.jboss.webbeans.injection;
+
+import java.lang.reflect.Member;
+import java.util.Stack;
+
+import javax.webbeans.InjectionPoint;
+import javax.webbeans.manager.Bean;
+
+import org.jboss.webbeans.introspector.AnnotatedMember;
+
+/**
+ * Used to create the container provided implementation for the
+ * InjectionPoint beans. The instance maintains state information
+ * on a stack so that this information is readily available for
+ * construction of a new InjectionPoint bean instance.
+ *
+ * @author David Allen
+ *
+ */
+public class InjectionPointProvider
+{
+ private final Stack<Bean<?>> beans = new Stack<Bean<?>>();
+ private final Stack<Object> beanInstances = new Stack<Object>();
+ private final Stack<AnnotatedMember<?, ? extends Member>> injectionPoints
= new Stack<AnnotatedMember<?, ? extends Member>>();
+
+ /**
+ * Pushes the current bean that is being instantiated onto a stack for later
+ * use.
+ *
+ * @param currentBean The bean being instantiated
+ */
+ public void pushBean(Bean<?> currentBean)
+ {
+ beans.push(currentBean);
+ }
+
+ /**
+ * Pushes the current bean instance that has been instantiated, but has not
+ * yet had any injection points initialized.
+ *
+ * @param currentInstance The bean instance last instantiated
+ */
+ public void pushInstance(Object currentInstance)
+ {
+ beanInstances.push(currentInstance);
+ }
+
+ /**
+ * Pushes the current injection point being processed.
+ *
+ * @param injectedMember The metadata for the injection point
+ */
+ public void pushInjectionPoint(AnnotatedMember<?, ? extends Member>
injectedMember)
+ {
+ injectionPoints.push(injectedMember);
+ }
+
+ /**
+ * Pops the bean from the stack. This should be called
+ * whenever all processing is complete for instantiating a bean.
+ */
+ public void popBean()
+ {
+ beans.pop();
+ }
+
+ /**
+ * Pops the current instance from the stack. This should be called
+ * whenever all processing is complete for instantiating a bean.
+ */
+ public void popInstance()
+ {
+ beanInstances.pop();
+ }
+
+ /**
+ * Pops the current injection point being processed. This should be called once
+ * the injection point is bound.
+ */
+ public void popInjectionPoint()
+ {
+ injectionPoints.pop();
+ }
+
+ /**
+ * Returns the InjectionPoint where the current bean under construction
+ * is being injected.
+ *
+ * @return a new injection point metadata object
+ */
+ public InjectionPoint getPreviousInjectionPoint()
+ {
+ // When the injected member is a constructor, we are short one instance,
+ // so the instance on the top of the stack is the bean instance
+ // we want. Otherwise, it is the second to last instance same as
+ // the bean stack.
+ InjectionPoint injectionPoint = null;
+ Bean<?> currentBean = beans.pop();
+ AnnotatedMember<?, ? extends Member> currentInjection =
injectionPoints.pop();
+ if (beanInstances.size() < beans.size())
+ {
+ injectionPoint = new InjectionPointImpl(injectionPoints.peek(), beans.peek(),
beanInstances.peek());
+ }
+ else
+ {
+ Object currentInstance = beanInstances.pop();
+ injectionPoint = new InjectionPointImpl(injectionPoints.peek(), beans.peek(),
beanInstances.peek());
+ beanInstances.push(currentInstance);
+ }
+ beans.push(currentBean);
+ injectionPoints.push(currentInjection);
+ return injectionPoint;
+ }
+}
Property changes on:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injection/InjectionPointProvider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java 2009-01-08
17:40:08 UTC (rev 835)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java 2009-01-08
18:12:02 UTC (rev 836)
@@ -29,7 +29,7 @@
import javax.webbeans.manager.Manager;
import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.injection.InjectionPointFactory;
+import org.jboss.webbeans.injection.InjectionPointProvider;
import org.jboss.webbeans.introspector.AnnotatedMember;
import org.jboss.webbeans.introspector.AnnotatedParameter;
import org.jboss.webbeans.util.Reflections;
@@ -206,8 +206,8 @@
protected Object[] getParameterValues(List<AnnotatedParameter<Object>>
parameters, Object specialVal, Class<? extends Annotation> specialParam, ManagerImpl
manager)
{
Object[] parameterValues = new Object[parameters.size()];
- InjectionPointFactory injectionPointFactory = manager.getInjectionPointFactory();
- injectionPointFactory.pushInjectionPoint(this);
+ InjectionPointProvider injectionPointProvider =
manager.getInjectionPointFactory();
+ injectionPointProvider.pushInjectionPoint(this);
try
{
Iterator<AnnotatedParameter<Object>> iterator =
parameters.iterator();
@@ -226,7 +226,7 @@
}
finally
{
- injectionPointFactory.popInjectionPoint();
+ injectionPointProvider.popInjectionPoint();
}
return parameterValues;