openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gerdo...@apache.org
Subject svn commit: r732803 [2/17] - in /incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans: ./ annotation/ component/ component/ejb/ component/jms/ component/xml/ config/ container/ context/ context/type/ decorator/ decorator/xml/ de...
Date Thu, 08 Jan 2009 19:41:33 GMT
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/Component.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/Component.java?rev=732803&r1=732802&r2=732803&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/Component.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/Component.java Thu Jan  8 11:41:30 2009
@@ -1,18 +1,15 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- * 
- *       http://www.apache.org/licenses/LICENSE-2.0
- * 
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
  */
 package org.apache.webbeans.component;
 
@@ -26,58 +23,56 @@
 import org.apache.webbeans.intercept.InterceptorData;
 
 /**
- * Extends the unpublished {@link Bean} interface for
- * backward capability with EDR-1 of the specification.
- * 
+ * Extends the unpublished {@link Bean} interface for backward capability with
+ * EDR-1 of the specification.
  * <p>
- *   <b>This class is not used by the client. It is used 
- *   entirely as internal. It exists only for compatibility problems.</b>
+ * <b>This class is not used by the client. It is used entirely as internal. It
+ * exists only for compatibility problems.</b>
  * </p>
  * 
  * @author <a href="mailto:gurkanerdogdu@yahoo.com">Gurkan Erdogdu</a>
  * @since 1.0
- *
  */
 public abstract class Component<T> extends Bean<T>
 {
-	protected Component(Manager manager)
-	{
-		super(manager);
-	}
-		
-	abstract public Annotation getType();
-	
-	abstract public void setType(Annotation type);
-	
-	abstract public Annotation getImplScopeType();
-	
-	abstract public void setImplScopeType(Annotation scopeType);
-	
-	abstract public WebBeansType getWebBeansType();
-	
-	abstract public void addBindingType(Annotation bindingType);
-	
-	abstract public void addStereoType(Annotation stereoType);
-	
-	abstract public void addApiType(Class<?> apiType);
-	
-	abstract public Set<Annotation> getImplBindingTypes();
-	
-	abstract public Set<Annotation> getStereoTypes();
-		
-	abstract public void setName(String name);
-	
-	abstract public int getPrecedence();
-	
-	abstract public Class<T> getReturnType();
-	
-	abstract public Object getDependent(Component<?> dependentComponent);
-	
-	abstract public List<InterceptorData> getInterceptorStack();
-	
-	abstract public List<Object> getDecoratorStack();
-	
-	abstract public void setSerializable(boolean serializable);
-	
-	abstract public void setNullable(boolean nullable);
+    protected Component(Manager manager)
+    {
+        super(manager);
+    }
+
+    abstract public Annotation getType();
+
+    abstract public void setType(Annotation type);
+
+    abstract public Annotation getImplScopeType();
+
+    abstract public void setImplScopeType(Annotation scopeType);
+
+    abstract public WebBeansType getWebBeansType();
+
+    abstract public void addBindingType(Annotation bindingType);
+
+    abstract public void addStereoType(Annotation stereoType);
+
+    abstract public void addApiType(Class<?> apiType);
+
+    abstract public Set<Annotation> getImplBindingTypes();
+
+    abstract public Set<Annotation> getStereoTypes();
+
+    abstract public void setName(String name);
+
+    abstract public int getPrecedence();
+
+    abstract public Class<T> getReturnType();
+
+    abstract public Object getDependent(Component<?> dependentComponent);
+
+    abstract public List<InterceptorData> getInterceptorStack();
+
+    abstract public List<Object> getDecoratorStack();
+
+    abstract public void setSerializable(boolean serializable);
+
+    abstract public void setNullable(boolean nullable);
 }
\ No newline at end of file

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ComponentImpl.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ComponentImpl.java?rev=732803&r1=732802&r2=732803&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ComponentImpl.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ComponentImpl.java Thu Jan  8 11:41:30 2009
@@ -1,18 +1,15 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- * 
- *       http://www.apache.org/licenses/LICENSE-2.0
- * 
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
  */
 package org.apache.webbeans.component;
 
@@ -34,10 +31,8 @@
 import org.apache.webbeans.intercept.InvocationContextImpl;
 import org.apache.webbeans.util.WebBeansUtil;
 
-
 /**
  * Concrete implementation of the {@link AbstractComponent}.
- * 
  * <p>
  * It is defined as bean implementation class component.
  * </p>
@@ -47,197 +42,202 @@
  */
 public class ComponentImpl<T> extends AbstractObservesComponent<T>
 {
-	/**Constructor of the web bean component*/
-	private Constructor<T> constructor;
-	
-	/**Injected fields of the component*/
-	private Set<Field> injectedFields = new HashSet<Field>();
-	
-	/**Injected methods of the component*/
-	private Set<Method> injectedMethods = new HashSet<Method>();
-	
-		
-	public ComponentImpl(Class<T> returnType)
-	{
-		this(returnType, WebBeansType.SIMPLE);
-	}
-	
-	public ComponentImpl(Class<T> returnType, WebBeansType type)
-	{
-		super(type, returnType);
-	}
-	
-	
-	/*
-	 * (non-Javadoc)
-	 * @see org.apache.webbeans.component.AbstractComponent#createInstance()
-	 */
-	@Override
-	protected T createInstance()
-	{
-		beforeConstructor();
-		
-		Constructor<T> con = getConstructor();
-		InjectableConstructor<T> ic = new InjectableConstructor<T>(con,this);
-		
-		T instance = ic.doInjection();
-		
-		afterConstructor(instance);
-		
-		
-		return instance;
-	}
-	
-	/*
-	 * Call before object constructor
-	 */
-	protected void beforeConstructor()
-	{
-
-	}
-	
-	/*
-	 * Call after object construction
-	 */
-	protected void afterConstructor(T instance)
-	{
-		injectFields(instance);
-		injectMethods(instance);
-		
-		if(getWebBeansType().equals(WebBeansType.SIMPLE))
-		{
-			DefinitionUtil.defineSimpleWebBeanInterceptorStack(this);
-			DefinitionUtil.defineWebBeanDecoratorStack(this, instance);	
-		}
-		
-		if(WebBeansUtil.isContainsInterceptorMethod(getInterceptorStack(), InterceptorType.POST_CONSTRUCT))
-		{
-			InvocationContextImpl impl = new InvocationContextImpl(instance,null,null,WebBeansUtil.getInterceptorMethods(getInterceptorStack(), InterceptorType.POST_CONSTRUCT),InterceptorType.POST_CONSTRUCT);
-			try
-			{
-				impl.proceed();
-				
-			}catch(Exception e)
-			{
-				throw new WebBeansException(e);
-			}				
-		}
-		
-	}
-	
-	/*
-	 * Injectable fields
-	 */
-	protected void injectFields(T instance)
-	{
-		Set<Field> fields = getInjectedFields();
-		Iterator<Field> it = fields.iterator();
-		
-		while(it.hasNext())
-		{
-			Field field = it.next();
-			if(field.getAnnotation(Decorates.class) == null)
-			{
-				InjectableField f = new InjectableField(field,instance,this);
-				f.doInjection();				
-			}
-			
-		}
-		
-	}
-	
-	/*
-	 * Injectable methods
-	 */
-	@SuppressWarnings("unchecked")
-	protected void injectMethods(T instance)
-	{
-		Set<Method> methods = getInjectedMethods();
-		Iterator<Method> it = methods.iterator();
-		
-		while(it.hasNext())
-		{
-			InjectableMethods m = new InjectableMethods(it.next(),instance,this);
-			m.doInjection();
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * @see org.apache.webbeans.component.AbstractComponent#destroyInstance(java.lang.Object)
-	 */
-	@Override
-	protected void destroyInstance(T instance)
-	{
-		if(WebBeansUtil.isContainsInterceptorMethod(getInterceptorStack(), InterceptorType.PRE_DESTROY))
-		{
-			InvocationContextImpl impl = new InvocationContextImpl(instance,null,null,WebBeansUtil.getInterceptorMethods(getInterceptorStack(), InterceptorType.PRE_DESTROY),InterceptorType.PRE_DESTROY);
-			try
-			{
-				impl.proceed();
-				
-			}catch(Exception e)
-			{
-				throw new WebBeansException(e);
-			}
-			
-		}
-
-		instance = null;
-	}
-	
-	/**
-	 * Get constructor.
-	 * @return constructor
-	 */
-	public Constructor<T> getConstructor()
-	{
-		return constructor;
-	}
-
-	/**
-	 * Set constructor.
-	 * @param constructor constructor instance
-	 */
-	public void setConstructor(Constructor<T> constructor)
-	{
-		this.constructor = constructor;
-	}
-	
-	/**
-	 * Gets injected fields.
-	 * @return injected fields
-	 */
-	public Set<Field> getInjectedFields()
-	{
-		return this.injectedFields;
-	}
-	
-	/**
-	 * Add new injected field.
-	 * @param field new injected field
-	 */
-	public void addInjectedField(Field field)
-	{
-		this.injectedFields.add(field);
-	}
-	
-	/**
-	 * Gets injected methods.
-	 * @return injected methods
-	 */
-	public Set<Method> getInjectedMethods()
-	{
-		return this.injectedMethods;
-	}
-	
-	/**
-	 * Add new injected method.
-	 * @param field new injected method
-	 */
-	public void addInjectedMethod(Method method)
-	{
-		this.injectedMethods.add(method);
-	}
+    /** Constructor of the web bean component */
+    private Constructor<T> constructor;
+
+    /** Injected fields of the component */
+    private Set<Field> injectedFields = new HashSet<Field>();
+
+    /** Injected methods of the component */
+    private Set<Method> injectedMethods = new HashSet<Method>();
+
+    public ComponentImpl(Class<T> returnType)
+    {
+        this(returnType, WebBeansType.SIMPLE);
+    }
+
+    public ComponentImpl(Class<T> returnType, WebBeansType type)
+    {
+        super(type, returnType);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.webbeans.component.AbstractComponent#createInstance()
+     */
+    @Override
+    protected T createInstance()
+    {
+        beforeConstructor();
+
+        Constructor<T> con = getConstructor();
+        InjectableConstructor<T> ic = new InjectableConstructor<T>(con, this);
+
+        T instance = ic.doInjection();
+
+        afterConstructor(instance);
+
+        return instance;
+    }
+
+    /*
+     * Call before object constructor
+     */
+    protected void beforeConstructor()
+    {
+
+    }
+
+    /*
+     * Call after object construction
+     */
+    protected void afterConstructor(T instance)
+    {
+        injectFields(instance);
+        injectMethods(instance);
+
+        if (getWebBeansType().equals(WebBeansType.SIMPLE))
+        {
+            DefinitionUtil.defineSimpleWebBeanInterceptorStack(this);
+            DefinitionUtil.defineWebBeanDecoratorStack(this, instance);
+        }
+
+        if (WebBeansUtil.isContainsInterceptorMethod(getInterceptorStack(), InterceptorType.POST_CONSTRUCT))
+        {
+            InvocationContextImpl impl = new InvocationContextImpl(instance, null, null, WebBeansUtil.getInterceptorMethods(getInterceptorStack(), InterceptorType.POST_CONSTRUCT), InterceptorType.POST_CONSTRUCT);
+            try
+            {
+                impl.proceed();
+
+            } catch (Exception e)
+            {
+                throw new WebBeansException(e);
+            }
+        }
+
+    }
+
+    /*
+     * Injectable fields
+     */
+    protected void injectFields(T instance)
+    {
+        Set<Field> fields = getInjectedFields();
+        Iterator<Field> it = fields.iterator();
+
+        while (it.hasNext())
+        {
+            Field field = it.next();
+            if (field.getAnnotation(Decorates.class) == null)
+            {
+                InjectableField f = new InjectableField(field, instance, this);
+                f.doInjection();
+            }
+
+        }
+
+    }
+
+    /*
+     * Injectable methods
+     */
+    @SuppressWarnings("unchecked")
+    protected void injectMethods(T instance)
+    {
+        Set<Method> methods = getInjectedMethods();
+        Iterator<Method> it = methods.iterator();
+
+        while (it.hasNext())
+        {
+            InjectableMethods m = new InjectableMethods(it.next(), instance, this);
+            m.doInjection();
+        }
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.webbeans.component.AbstractComponent#destroyInstance(java.lang.Object)
+     */
+    @Override
+    protected void destroyInstance(T instance)
+    {
+        if (WebBeansUtil.isContainsInterceptorMethod(getInterceptorStack(), InterceptorType.PRE_DESTROY))
+        {
+            InvocationContextImpl impl = new InvocationContextImpl(instance, null, null, WebBeansUtil.getInterceptorMethods(getInterceptorStack(), InterceptorType.PRE_DESTROY), InterceptorType.PRE_DESTROY);
+            try
+            {
+                impl.proceed();
+
+            } catch (Exception e)
+            {
+                throw new WebBeansException(e);
+            }
+
+        }
+
+        instance = null;
+    }
+
+    /**
+     * Get constructor.
+     * 
+     * @return constructor
+     */
+    public Constructor<T> getConstructor()
+    {
+        return constructor;
+    }
+
+    /**
+     * Set constructor.
+     * 
+     * @param constructor constructor instance
+     */
+    public void setConstructor(Constructor<T> constructor)
+    {
+        this.constructor = constructor;
+    }
+
+    /**
+     * Gets injected fields.
+     * 
+     * @return injected fields
+     */
+    public Set<Field> getInjectedFields()
+    {
+        return this.injectedFields;
+    }
+
+    /**
+     * Add new injected field.
+     * 
+     * @param field new injected field
+     */
+    public void addInjectedField(Field field)
+    {
+        this.injectedFields.add(field);
+    }
+
+    /**
+     * Gets injected methods.
+     * 
+     * @return injected methods
+     */
+    public Set<Method> getInjectedMethods()
+    {
+        return this.injectedMethods;
+    }
+
+    /**
+     * Add new injected method.
+     * 
+     * @param field new injected method
+     */
+    public void addInjectedMethod(Method method)
+    {
+        this.injectedMethods.add(method);
+    }
 
 }

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ConversationComponent.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ConversationComponent.java?rev=732803&r1=732802&r2=732803&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ConversationComponent.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ConversationComponent.java Thu Jan  8 11:41:30 2009
@@ -1,18 +1,15 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- * 
- *       http://www.apache.org/licenses/LICENSE-2.0
- * 
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
  */
 package org.apache.webbeans.component;
 
@@ -25,35 +22,34 @@
 public class ConversationComponent extends AbstractComponent<Conversation>
 {
 
-	public ConversationComponent()
-	{
-		super(WebBeansType.CONVERSATION, Conversation.class);
-	}
-
-	@Override
-	protected Conversation createInstance()
-	{
-		String conversationId = JSFUtil.getConversationId();
-		Conversation conversation =	null;
-		
-		if(conversationId != null)
-		{
-			conversation = ConversationManager.getInstance().getConversation(conversationId);
-		}
-		else
-		{
-			conversation =	new ConversationImpl(JSFUtil.getSession().getId());	
-		}
-		
-		return conversation;		
-	}
-
-	@Override
-	protected void destroyInstance(Conversation instance)
-	{
-		if(!instance.isLongRunning())
-		{
-			instance = null;
-		}
-	}
+    public ConversationComponent()
+    {
+        super(WebBeansType.CONVERSATION, Conversation.class);
+    }
+
+    @Override
+    protected Conversation createInstance()
+    {
+        String conversationId = JSFUtil.getConversationId();
+        Conversation conversation = null;
+
+        if (conversationId != null)
+        {
+            conversation = ConversationManager.getInstance().getConversation(conversationId);
+        } else
+        {
+            conversation = new ConversationImpl(JSFUtil.getSession().getId());
+        }
+
+        return conversation;
+    }
+
+    @Override
+    protected void destroyInstance(Conversation instance)
+    {
+        if (!instance.isLongRunning())
+        {
+            instance = null;
+        }
+    }
 }

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ManagerComponentImpl.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ManagerComponentImpl.java?rev=732803&r1=732802&r2=732803&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ManagerComponentImpl.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ManagerComponentImpl.java Thu Jan  8 11:41:30 2009
@@ -1,18 +1,15 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- * 
- *       http://www.apache.org/licenses/LICENSE-2.0
- * 
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
  */
 package org.apache.webbeans.component;
 
@@ -22,28 +19,28 @@
 
 public class ManagerComponentImpl extends AbstractComponent<Manager>
 {
-	private Manager manager = null;
-	
-	public ManagerComponentImpl()
-	{
-		super(WebBeansType.MANAGER, Manager.class);
-	}
-
-	@Override
-	protected Manager createInstance()
-	{
-		if(this.manager == null)
-		{
-			manager = ManagerImpl.getManager();	
-		}  
-		
-		return manager;
-	}
-
-	@Override
-	protected void destroyInstance(Manager instance)
-	{
-		this.manager = null;
-	}
+    private Manager manager = null;
+
+    public ManagerComponentImpl()
+    {
+        super(WebBeansType.MANAGER, Manager.class);
+    }
+
+    @Override
+    protected Manager createInstance()
+    {
+        if (this.manager == null)
+        {
+            manager = ManagerImpl.getManager();
+        }
+
+        return manager;
+    }
+
+    @Override
+    protected void destroyInstance(Manager instance)
+    {
+        this.manager = null;
+    }
 
 }

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/NewComponentImpl.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/NewComponentImpl.java?rev=732803&r1=732802&r2=732803&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/NewComponentImpl.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/NewComponentImpl.java Thu Jan  8 11:41:30 2009
@@ -1,27 +1,22 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- * 
- *       http://www.apache.org/licenses/LICENSE-2.0
- * 
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
  */
 package org.apache.webbeans.component;
 
 import javax.webbeans.New;
 
-
 /**
  * Component definition with {@link New} binding annotation.
- * 
  * <p>
  * It is defined as concrete java class component.
  * </p>
@@ -31,32 +26,32 @@
  */
 public class NewComponentImpl<T> extends ComponentImpl<T>
 {
-	private WebBeansType definedType;
+    private WebBeansType definedType;
+
+    public NewComponentImpl(Class<T> returnType, WebBeansType definedType)
+    {
+        super(returnType);
+        this.definedType = definedType;
+    }
+
+    @Override
+    protected T createInstance()
+    {
+        return super.createInstance();
+    }
+
+    @Override
+    protected void destroyInstance(T instance)
+    {
+        super.destroyInstance(instance);
+    }
+
+    /**
+     * @return the definedType
+     */
+    public WebBeansType getDefinedType()
+    {
+        return definedType;
+    }
 
-	public NewComponentImpl(Class<T> returnType, WebBeansType definedType)
-	{
-		super(returnType);
-		this.definedType = definedType;
-	}
-	
-	@Override
-	protected T createInstance()
-	{		
-		 return super.createInstance();
-	}
-	
-	@Override
-	protected void destroyInstance(T instance)
-	{
-		super.destroyInstance(instance);
-	}
-
-	/**
-	 * @return the definedType
-	 */
-	public WebBeansType getDefinedType()
-	{
-		return definedType;
-	}
-	
 }

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ObservableComponentImpl.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ObservableComponentImpl.java?rev=732803&r1=732802&r2=732803&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ObservableComponentImpl.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ObservableComponentImpl.java Thu Jan  8 11:41:30 2009
@@ -1,18 +1,15 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- * 
- *       http://www.apache.org/licenses/LICENSE-2.0
- * 
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
  */
 package org.apache.webbeans.component;
 
@@ -23,10 +20,8 @@
 
 import org.apache.webbeans.exception.WebBeansException;
 
-
 /**
  * Component definition with {@link New} binding annotation.
- * 
  * <p>
  * It is defined as concrete java class component.
  * </p>
@@ -34,55 +29,54 @@
  * @author <a href="mailto:gurkanerdogdu@yahoo.com">Gurkan Erdogdu</a>
  * @since 1.0
  */
-public class ObservableComponentImpl<T,K> extends ComponentImpl<T>
+public class ObservableComponentImpl<T, K> extends ComponentImpl<T>
 {
-	private WebBeansType definedType;
-	
-	private Class<K> eventType = null;
-	
-	public ObservableComponentImpl(Class<T> returnType, Class<K> eventType, WebBeansType definedType)
-	{
-		super(returnType);
-		this.definedType = definedType;
-		this.eventType = eventType;
-	}
-	
-	@Override
-	protected T createInstance()
-	{	
-		Set<Annotation> setBindingTypes = getBindingTypes();
-		Annotation[] bindingTypes = new Annotation[setBindingTypes.size()];
-		
-		bindingTypes = setBindingTypes.toArray(bindingTypes);
-		
-		T instance = null;
-		
-		try
-		{
-			instance = getConstructor().newInstance(new Object[]{bindingTypes, eventType});
-			
-		}catch(Throwable e)
-		{
-			throw new WebBeansException("Exception in creating Observable implicit component for event type : " + eventType.getName());
-		}
-		
-		return instance; 
-		 
-	}
-	
-	@Override
-	protected void destroyInstance(T instance)
-	{
-		super.destroyInstance(instance);
-	}
-
-	/**
-	 * @return the definedType
-	 */
-	public WebBeansType getDefinedType()
-	{
-		return definedType;
-	}
-	
-	
+    private WebBeansType definedType;
+
+    private Class<K> eventType = null;
+
+    public ObservableComponentImpl(Class<T> returnType, Class<K> eventType, WebBeansType definedType)
+    {
+        super(returnType);
+        this.definedType = definedType;
+        this.eventType = eventType;
+    }
+
+    @Override
+    protected T createInstance()
+    {
+        Set<Annotation> setBindingTypes = getBindingTypes();
+        Annotation[] bindingTypes = new Annotation[setBindingTypes.size()];
+
+        bindingTypes = setBindingTypes.toArray(bindingTypes);
+
+        T instance = null;
+
+        try
+        {
+            instance = getConstructor().newInstance(new Object[] { bindingTypes, eventType });
+
+        } catch (Throwable e)
+        {
+            throw new WebBeansException("Exception in creating Observable implicit component for event type : " + eventType.getName());
+        }
+
+        return instance;
+
+    }
+
+    @Override
+    protected void destroyInstance(T instance)
+    {
+        super.destroyInstance(instance);
+    }
+
+    /**
+     * @return the definedType
+     */
+    public WebBeansType getDefinedType()
+    {
+        return definedType;
+    }
+
 }

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ObservesMethodsOwner.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ObservesMethodsOwner.java?rev=732803&r1=732802&r2=732803&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ObservesMethodsOwner.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ObservesMethodsOwner.java Thu Jan  8 11:41:30 2009
@@ -1,18 +1,15 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- * 
- *       http://www.apache.org/licenses/LICENSE-2.0
- * 
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
  */
 package org.apache.webbeans.component;
 
@@ -21,8 +18,8 @@
 
 public interface ObservesMethodsOwner<T>
 {
-	public Set<Method> getObservableMethods();
-	
-	public void addObservableMethod(Method observerMethod);
+    public Set<Method> getObservableMethods();
+
+    public void addObservableMethod(Method observerMethod);
 
 }

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ProducerComponentImpl.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ProducerComponentImpl.java?rev=732803&r1=732802&r2=732803&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ProducerComponentImpl.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ProducerComponentImpl.java Thu Jan  8 11:41:30 2009
@@ -1,18 +1,15 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- * 
- *       http://www.apache.org/licenses/LICENSE-2.0
- * 
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
  */
 package org.apache.webbeans.component;
 
@@ -31,7 +28,6 @@
 
 /**
  * Concrete implementation of the {@link AbstractComponent}.
- * 
  * <p>
  * It is defined as producer method component.
  * </p>
@@ -40,185 +36,184 @@
  * @since 1.0
  */
 public class ProducerComponentImpl<T> extends AbstractComponent<T>
-{	
-	/**Parent component that this producer method belongs*/
-	protected AbstractComponent<?> parent;
-	
-	/**Creator method of the parent component*/
-	protected Method creatorMethod;
-	
-	/**Disposal method*/
-	protected Method disposalMethod;
-	
-	/*
-	 * Constructor
-	 */
-	public ProducerComponentImpl(AbstractComponent<?> parent, Class<T> returnType)
-	{
-		super(WebBeansType.PRODUCER, returnType);
-		this.parent = parent;
-	}
-
-	/**
-	 * Gets the creator method.
-	 * 
-	 * @return producer method
-	 */
-	public Method getCreatorMethod()
-	{
-		return creatorMethod;
-	}
-
-	/**
-	 * Sets the method.
-	 * 
-	 * @param creatorMethod producer method
-	 */
-	public void setCreatorMethod(Method creatorMethod)
-	{
-		this.creatorMethod = creatorMethod;
-	}
-
-	/**
-	 * Gets the producer method owner web bean.
-	 * 
-	 * @return web bean component defines producer method
-	 */
-	public AbstractComponent<?> getParent()
-	{
-		return parent;
-	}
-
-	/**
-	 * Gets the disposal method of the component.
-	 * 
-	 * @return disposal method
-	 */
-	public Method getDisposalMethod()
-	{
-		return disposalMethod;
-	}
-	
-	/**
-	 * Sets the disposal method.
-	 * 
-	 * @param disposalMethod disposal method of this producer method component
-	 */
-	public void setDisposalMethod(Method disposalMethod)
-	{
-		if(this.disposalMethod != null)
-		{
-			throw new WebBeansConfigurationException("There are multiple disposal method for producer method component with name : " + getName() + " with implementation class " + getParent().getReturnType().getName() + " with disposal method name : " + disposalMethod.getName());
-		}
-		this.disposalMethod = disposalMethod;
-	}
-	
-	public Type[] getActualTypeArguments()
-	{
-		Type type = creatorMethod.getGenericReturnType();
-		if(type instanceof ParameterizedType)
-		{
-			ParameterizedType pType = (ParameterizedType)type;
-			return pType.getActualTypeArguments();
-		}
-		
-		else
-		{
-			return new Type[0];
-		}
-		
-	}
-	
-	/*
-	 * (non-Javadoc)
-	 * @see org.apache.webbeans.component.AbstractComponent#createInstance()
-	 */
-	@Override
-	protected T createInstance()
-	{	
-		T instance = null;
-		Object  parentInstance = getParentInstance();
-
-		try
-		{
-			InjectableMethods<T> m = new InjectableMethods<T>(creatorMethod, parentInstance,this);
-			instance = m.doInjection();
-			
-		}
-		finally
-		{
-			if(getParent().getScopeType().equals(Dependent.class))
-			{
-				destroyBean(getParent(), parentInstance);
-			}
-		}
-		
-		checkNullInstance(instance);
-		checkScopeType();
-		
-		return instance;
-	}
-	
-	
-	@SuppressWarnings("unchecked")
-	protected <K> void destroyBean(Bean<?> bean, Object instance)
-	{
-		Bean<K> destroy = (Bean<K>)bean;
-		K inst = (K) instance;
-		
-		destroy.destroy(inst);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * @see org.apache.webbeans.component.AbstractComponent#destroyInstance(java.lang.Object)
-	 */
-	@Override
-	protected void destroyInstance(T instance)
-	{
-		if(disposalMethod != null)
-		{
-			
-			Object object = getParentInstance();
-			
-			InjectableMethods<T> m = new InjectableMethods<T>(disposalMethod, object, this);
-			m.doInjection();
-			
-		}
-		
-		instance = null;
-		
-	}
-	
-	
-	protected Object getParentInstance()
-	{
-		Object parentInstance = ManagerImpl.getManager().getInstance(this.parent);
-		
-		return parentInstance;
-	}
-	
-	protected void checkNullInstance(Object instance)
-	{
-		if(instance == null)
-		{
-			if(!this.getScopeType().equals(Dependent.class))
-			{
-				throw new IllegalProductException("WebBeans producer method : " + creatorMethod.getName() + " return type in the component implementation class : " + this.parent.getReturnType().getName() + " scope type must be @Dependent to create null instance");
-			}			
-		}		
-	}
-	
-	protected void checkScopeType()
-	{
-		//Scope type check
-		ScopeType scope = this.getScopeType().getAnnotation(ScopeType.class);
-		if(scope.passivating())
-		{
-			if(!this.isSerializable())
-			{
-				throw new IllegalProductException("WebBeans producer method : " + creatorMethod.getName() + " return type in the component implementation class : " + this.parent.getReturnType().getName() + " with passivating scope @" + scope.annotationType().getName() + " must be Serializable");
-			}
-		}
-	}	
+{
+    /** Parent component that this producer method belongs */
+    protected AbstractComponent<?> parent;
+
+    /** Creator method of the parent component */
+    protected Method creatorMethod;
+
+    /** Disposal method */
+    protected Method disposalMethod;
+
+    /*
+     * Constructor
+     */
+    public ProducerComponentImpl(AbstractComponent<?> parent, Class<T> returnType)
+    {
+        super(WebBeansType.PRODUCER, returnType);
+        this.parent = parent;
+    }
+
+    /**
+     * Gets the creator method.
+     * 
+     * @return producer method
+     */
+    public Method getCreatorMethod()
+    {
+        return creatorMethod;
+    }
+
+    /**
+     * Sets the method.
+     * 
+     * @param creatorMethod producer method
+     */
+    public void setCreatorMethod(Method creatorMethod)
+    {
+        this.creatorMethod = creatorMethod;
+    }
+
+    /**
+     * Gets the producer method owner web bean.
+     * 
+     * @return web bean component defines producer method
+     */
+    public AbstractComponent<?> getParent()
+    {
+        return parent;
+    }
+
+    /**
+     * Gets the disposal method of the component.
+     * 
+     * @return disposal method
+     */
+    public Method getDisposalMethod()
+    {
+        return disposalMethod;
+    }
+
+    /**
+     * Sets the disposal method.
+     * 
+     * @param disposalMethod disposal method of this producer method component
+     */
+    public void setDisposalMethod(Method disposalMethod)
+    {
+        if (this.disposalMethod != null)
+        {
+            throw new WebBeansConfigurationException("There are multiple disposal method for producer method component with name : " + getName() + " with implementation class " + getParent().getReturnType().getName() + " with disposal method name : " + disposalMethod.getName());
+        }
+        this.disposalMethod = disposalMethod;
+    }
+
+    public Type[] getActualTypeArguments()
+    {
+        Type type = creatorMethod.getGenericReturnType();
+        if (type instanceof ParameterizedType)
+        {
+            ParameterizedType pType = (ParameterizedType) type;
+            return pType.getActualTypeArguments();
+        }
+
+        else
+        {
+            return new Type[0];
+        }
+
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.webbeans.component.AbstractComponent#createInstance()
+     */
+    @Override
+    protected T createInstance()
+    {
+        T instance = null;
+        Object parentInstance = getParentInstance();
+
+        try
+        {
+            InjectableMethods<T> m = new InjectableMethods<T>(creatorMethod, parentInstance, this);
+            instance = m.doInjection();
+
+        } finally
+        {
+            if (getParent().getScopeType().equals(Dependent.class))
+            {
+                destroyBean(getParent(), parentInstance);
+            }
+        }
+
+        checkNullInstance(instance);
+        checkScopeType();
+
+        return instance;
+    }
+
+    @SuppressWarnings("unchecked")
+    protected <K> void destroyBean(Bean<?> bean, Object instance)
+    {
+        Bean<K> destroy = (Bean<K>) bean;
+        K inst = (K) instance;
+
+        destroy.destroy(inst);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.webbeans.component.AbstractComponent#destroyInstance(java.lang.Object)
+     */
+    @Override
+    protected void destroyInstance(T instance)
+    {
+        if (disposalMethod != null)
+        {
+
+            Object object = getParentInstance();
+
+            InjectableMethods<T> m = new InjectableMethods<T>(disposalMethod, object, this);
+            m.doInjection();
+
+        }
+
+        instance = null;
+
+    }
+
+    protected Object getParentInstance()
+    {
+        Object parentInstance = ManagerImpl.getManager().getInstance(this.parent);
+
+        return parentInstance;
+    }
+
+    protected void checkNullInstance(Object instance)
+    {
+        if (instance == null)
+        {
+            if (!this.getScopeType().equals(Dependent.class))
+            {
+                throw new IllegalProductException("WebBeans producer method : " + creatorMethod.getName() + " return type in the component implementation class : " + this.parent.getReturnType().getName() + " scope type must be @Dependent to create null instance");
+            }
+        }
+    }
+
+    protected void checkScopeType()
+    {
+        // Scope type check
+        ScopeType scope = this.getScopeType().getAnnotation(ScopeType.class);
+        if (scope.passivating())
+        {
+            if (!this.isSerializable())
+            {
+                throw new IllegalProductException("WebBeans producer method : " + creatorMethod.getName() + " return type in the component implementation class : " + this.parent.getReturnType().getName() + " with passivating scope @" + scope.annotationType().getName() + " must be Serializable");
+            }
+        }
+    }
 }
\ No newline at end of file

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/WebBeansType.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/WebBeansType.java?rev=732803&r1=732802&r2=732803&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/WebBeansType.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/WebBeansType.java Thu Jan  8 11:41:30 2009
@@ -1,47 +1,44 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- * 
- *       http://www.apache.org/licenses/LICENSE-2.0
- * 
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
  */
 package org.apache.webbeans.component;
 
 import javax.webbeans.Produces;
 
 /**
- * There are different <i>Web Beans Component</i> with regard to the definition.
- * These are the;
+ * There are different <i>Web Beans Component</i> with regard to the
+ * definition. These are the;
  * <ul>
- *  <li>Bean Implementation Class Components</li>
- *  <li>Producer Method Components</li>
+ * <li>Bean Implementation Class Components</li>
+ * <li>Producer Method Components</li>
  * </ul>
- * 
  * <p>
- * Bean Implementation Class Components are defined with annotating the 
- * ordinary classes with {@link Component} annotation. It maybe defined within the 
- * web-beans.xml file using &lt;class&gt; element. It is possible to mix these two definitions.
+ * Bean Implementation Class Components are defined with annotating the ordinary
+ * classes with {@link Component} annotation. It maybe defined within the
+ * web-beans.xml file using &lt;class&gt; element. It is possible to mix these
+ * two definitions.
  * </p>
- * 
  * <p>
- * Producer Method Components are defined within the class that is annotated with
- * {@link Component} annotation. In these classes, there are methods that are annotated with
- * {@link Produces} annotation. These methods become the producer method components of this
- * web beans component. It maybe defined using the web-beans.xml file using the &lt;producer&gt; element.
- * It is possible to mix these two definitons.
+ * Producer Method Components are defined within the class that is annotated
+ * with {@link Component} annotation. In these classes, there are methods that
+ * are annotated with {@link Produces} annotation. These methods become the
+ * producer method components of this web beans component. It maybe defined
+ * using the web-beans.xml file using the &lt;producer&gt; element. It is
+ * possible to mix these two definitons.
  * </p>
- * 
  * <p>
- * For further details about the components, see Web Beans Specification Chapter-2.
+ * For further details about the components, see Web Beans Specification
+ * Chapter-2.
  * </p>
  * 
  * @author <a href="mailto:gurkanerdogdu@yahoo.com">Gurkan Erdogdu</a>
@@ -49,15 +46,5 @@
  */
 public enum WebBeansType
 {
-	SIMPLE,
-	PRODUCER,
-	NEW,
-	ENTERPRISE,
-	JMS,
-	DEPENDENT,
-	INTERCEPTOR,
-	DECORATOR,
-	OBSERVABLE,
-	MANAGER,
-	CONVERSATION
+    SIMPLE, PRODUCER, NEW, ENTERPRISE, JMS, DEPENDENT, INTERCEPTOR, DECORATOR, OBSERVABLE, MANAGER, CONVERSATION
 }

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ejb/EJBComponentImpl.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ejb/EJBComponentImpl.java?rev=732803&r1=732802&r2=732803&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ejb/EJBComponentImpl.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ejb/EJBComponentImpl.java Thu Jan  8 11:41:30 2009
@@ -1,18 +1,15 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- * 
- *       http://www.apache.org/licenses/LICENSE-2.0
- * 
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
  */
 package org.apache.webbeans.component.ejb;
 

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/jms/JMSComponentImpl.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/jms/JMSComponentImpl.java?rev=732803&r1=732802&r2=732803&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/jms/JMSComponentImpl.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/jms/JMSComponentImpl.java Thu Jan  8 11:41:30 2009
@@ -1,18 +1,15 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- * 
- *       http://www.apache.org/licenses/LICENSE-2.0
- * 
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
  */
 package org.apache.webbeans.component.jms;
 

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/xml/XMLComponentImpl.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/xml/XMLComponentImpl.java?rev=732803&r1=732802&r2=732803&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/xml/XMLComponentImpl.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/xml/XMLComponentImpl.java Thu Jan  8 11:41:30 2009
@@ -1,18 +1,15 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- * 
- *       http://www.apache.org/licenses/LICENSE-2.0
- * 
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
  */
 package org.apache.webbeans.component.xml;
 
@@ -35,194 +32,193 @@
 import org.apache.webbeans.util.Asserts;
 
 public class XMLComponentImpl<T> extends ComponentImpl<T>
-{	
-	private static WebBeansLogger logger = WebBeansLogger.getLogger(XMLComponentImpl.class);
-	
-	/**Constructor injection point decleration*/
-	private XMLInjectableConstructor<T> injectableConstructor = null;
-	
-	/**Injection points for fields*/
-	private Map<Field,XMLInjectionPointModel> injectableFields = new HashMap<Field, XMLInjectionPointModel>();
-	
-	/**Injection points for initializer methods*/
-	private Map<Method,List<XMLInjectionPointModel>> injectableMethods = new HashMap<Method, List<XMLInjectionPointModel>>();
-	
-	/**Initial field values of the webbean defined in the XML*/
-	private Map<Field, Object> fieldValues = new HashMap<Field, Object>();
-		
-	/**
-	 * Creates new XML defined webbeans component.
-	 * 
-	 * @param returnType type of the webbeans component
-	 */
-	public XMLComponentImpl(Class<T> returnType)
-	{
-		super(returnType);
-	}
-	
-	
-	
-	/* (non-Javadoc)
-	 * @see org.apache.webbeans.component.ComponentImpl#createInstance()
-	 */
-	@Override
-	protected T createInstance()
-	{
-		T instance = null;
-		
-		if(this.injectableConstructor == null)
-		{
-			instance = super.createInstance();
-		}
-		else
-		{
-			instance = this.injectableConstructor.doInjection();
-			super.afterConstructor(instance);
-		}
-		
-		/*Inject initial field values*/
-		if(instance != null)
-		{
-			injectFieldValues(instance);	
-		}
-		
-		return instance;
-	}
-
-	
-	
-	/* (non-Javadoc)
-	 * @see org.apache.webbeans.component.ComponentImpl#injectFields(java.lang.Object)
-	 */
-	@Override
-	protected void injectFields(T instance)
-	{
-		Set<Field> fieldSet = this.injectableFields.keySet();
-		Iterator<Field> itField = fieldSet.iterator();
-		
-		while(itField.hasNext())
-		{	
-			Field field = itField.next();
-			XMLInjectionPointModel model = this.injectableFields.get(field);
-			XMLInjectableField injectableField = new XMLInjectableField(field, instance, this, model);
-			
-			injectableField.doInjection();
-		}
-	}
-
-	protected void injectFieldValues(T instance)
-	{
-		Set<Field> fieldSet = this.fieldValues.keySet();
-		Iterator<Field> itField = fieldSet.iterator();
-		
-		while(itField.hasNext())
-		{	
-			Field field = itField.next();
-			if(!field.isAccessible())
-			{
-				field.setAccessible(true);
-			}
-			
-			try
-			{
-				field.set(instance, this.fieldValues.get(field));
-				
-			} catch (IllegalArgumentException e)
-			{
-				logger.error("IllegalArgumentException is occured while calling the field : " + field.getName() + " on class " + instance.getClass().getName());
-				throw new WebBeansException(e);
-				
-			} catch (IllegalAccessException e)
-			{
-				logger.error("IllegalAccessException is occured while calling the field : " + field.getName() + " on class " + instance.getClass().getName());				
-				throw new WebBeansException(e);
-			}
-		}
-	}
-	
-
-	/* (non-Javadoc)
-	 * @see org.apache.webbeans.component.ComponentImpl#injectMethods(java.lang.Object)
-	 */
-	@Override
-	protected void injectMethods(T instance)
-	{
-		Set<Method> methodSet = this.injectableMethods.keySet();
-		Iterator<Method> itMethods = methodSet.iterator();
-		while(itMethods.hasNext())
-		{
-			Method method = itMethods.next();
-			List<XMLInjectionPointModel> listInjectionPointModel = this.injectableMethods.get(method);
-			XMLInjectableMethods<T> injectableMethod = new XMLInjectableMethods<T>(method, instance, this, listInjectionPointModel);
-			
-			injectableMethod.doInjection();
-		}
-		
-	}
-
-
-	/**
-	 * Sets injection point for constructor.
-	 * 
-	 * @param constructor constructor injection point
-	 */
-	public void setInjectableConstructor(XMLInjectableConstructor<T> constructor)
-	{
-		Asserts.assertNotNull(constructor, "constructor parameter can not be null");
-		this.injectableConstructor = constructor;
-	}
-	
-	/**
-	 * Adds new field injection point
-	 * 
-	 * @param field field injection point
-	 * @param model injection point model
-	 */
-	public void addFieldInjectionPoint(Field field, XMLInjectionPointModel model)
-	{
-		Asserts.assertNotNull(field,"field parameter can not be null");
-		Asserts.assertNotNull(model,"model parameter can not be null");
-		
-		this.injectableFields.put(field, model);
-	}
-	
-	/**
-	 * Adds new method injection point
-	 * 
-	 * @param method method injection point
-	 * @param model injection point model
-	 */
-	public void addMethodInjectionPoint(Method method, XMLInjectionPointModel model)
-	{
-		Asserts.assertNotNull(method,"method parameter can not be null");
-		Asserts.assertNotNull(model,"model parameter can not be null");
-		
-		List<XMLInjectionPointModel> listModel = this.injectableMethods.get(method);
-		if(listModel == null)
-		{
-			listModel = new ArrayList<XMLInjectionPointModel>();
-			this.injectableMethods.put(method, listModel);
-		}
-		
-		listModel.add(model);
-	}	
-	
-	/**
-	 * Add new field value.
-	 * 
-	 * @param name name of the field
-	 * @param value value of the field
-	 */
-	public void addFieldValue(Field name, Object value)
-	{
-		fieldValues.put(name, value);
-	}
-
-	/**
-	 * @return the fieldValues
-	 */
-	public Map<Field, Object> getFieldValues()
-	{
-		return fieldValues;
-	}
+{
+    private static WebBeansLogger logger = WebBeansLogger.getLogger(XMLComponentImpl.class);
+
+    /** Constructor injection point decleration */
+    private XMLInjectableConstructor<T> injectableConstructor = null;
+
+    /** Injection points for fields */
+    private Map<Field, XMLInjectionPointModel> injectableFields = new HashMap<Field, XMLInjectionPointModel>();
+
+    /** Injection points for initializer methods */
+    private Map<Method, List<XMLInjectionPointModel>> injectableMethods = new HashMap<Method, List<XMLInjectionPointModel>>();
+
+    /** Initial field values of the webbean defined in the XML */
+    private Map<Field, Object> fieldValues = new HashMap<Field, Object>();
+
+    /**
+     * Creates new XML defined webbeans component.
+     * 
+     * @param returnType type of the webbeans component
+     */
+    public XMLComponentImpl(Class<T> returnType)
+    {
+        super(returnType);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.webbeans.component.ComponentImpl#createInstance()
+     */
+    @Override
+    protected T createInstance()
+    {
+        T instance = null;
+
+        if (this.injectableConstructor == null)
+        {
+            instance = super.createInstance();
+        } else
+        {
+            instance = this.injectableConstructor.doInjection();
+            super.afterConstructor(instance);
+        }
+
+        /* Inject initial field values */
+        if (instance != null)
+        {
+            injectFieldValues(instance);
+        }
+
+        return instance;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.webbeans.component.ComponentImpl#injectFields(java.lang.Object)
+     */
+    @Override
+    protected void injectFields(T instance)
+    {
+        Set<Field> fieldSet = this.injectableFields.keySet();
+        Iterator<Field> itField = fieldSet.iterator();
+
+        while (itField.hasNext())
+        {
+            Field field = itField.next();
+            XMLInjectionPointModel model = this.injectableFields.get(field);
+            XMLInjectableField injectableField = new XMLInjectableField(field, instance, this, model);
+
+            injectableField.doInjection();
+        }
+    }
+
+    protected void injectFieldValues(T instance)
+    {
+        Set<Field> fieldSet = this.fieldValues.keySet();
+        Iterator<Field> itField = fieldSet.iterator();
+
+        while (itField.hasNext())
+        {
+            Field field = itField.next();
+            if (!field.isAccessible())
+            {
+                field.setAccessible(true);
+            }
+
+            try
+            {
+                field.set(instance, this.fieldValues.get(field));
+
+            } catch (IllegalArgumentException e)
+            {
+                logger.error("IllegalArgumentException is occured while calling the field : " + field.getName() + " on class " + instance.getClass().getName());
+                throw new WebBeansException(e);
+
+            } catch (IllegalAccessException e)
+            {
+                logger.error("IllegalAccessException is occured while calling the field : " + field.getName() + " on class " + instance.getClass().getName());
+                throw new WebBeansException(e);
+            }
+        }
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.webbeans.component.ComponentImpl#injectMethods(java.lang.Object)
+     */
+    @Override
+    protected void injectMethods(T instance)
+    {
+        Set<Method> methodSet = this.injectableMethods.keySet();
+        Iterator<Method> itMethods = methodSet.iterator();
+        while (itMethods.hasNext())
+        {
+            Method method = itMethods.next();
+            List<XMLInjectionPointModel> listInjectionPointModel = this.injectableMethods.get(method);
+            XMLInjectableMethods<T> injectableMethod = new XMLInjectableMethods<T>(method, instance, this, listInjectionPointModel);
+
+            injectableMethod.doInjection();
+        }
+
+    }
+
+    /**
+     * Sets injection point for constructor.
+     * 
+     * @param constructor constructor injection point
+     */
+    public void setInjectableConstructor(XMLInjectableConstructor<T> constructor)
+    {
+        Asserts.assertNotNull(constructor, "constructor parameter can not be null");
+        this.injectableConstructor = constructor;
+    }
+
+    /**
+     * Adds new field injection point
+     * 
+     * @param field field injection point
+     * @param model injection point model
+     */
+    public void addFieldInjectionPoint(Field field, XMLInjectionPointModel model)
+    {
+        Asserts.assertNotNull(field, "field parameter can not be null");
+        Asserts.assertNotNull(model, "model parameter can not be null");
+
+        this.injectableFields.put(field, model);
+    }
+
+    /**
+     * Adds new method injection point
+     * 
+     * @param method method injection point
+     * @param model injection point model
+     */
+    public void addMethodInjectionPoint(Method method, XMLInjectionPointModel model)
+    {
+        Asserts.assertNotNull(method, "method parameter can not be null");
+        Asserts.assertNotNull(model, "model parameter can not be null");
+
+        List<XMLInjectionPointModel> listModel = this.injectableMethods.get(method);
+        if (listModel == null)
+        {
+            listModel = new ArrayList<XMLInjectionPointModel>();
+            this.injectableMethods.put(method, listModel);
+        }
+
+        listModel.add(model);
+    }
+
+    /**
+     * Add new field value.
+     * 
+     * @param name name of the field
+     * @param value value of the field
+     */
+    public void addFieldValue(Field name, Object value)
+    {
+        fieldValues.put(name, value);
+    }
+
+    /**
+     * @return the fieldValues
+     */
+    public Map<Field, Object> getFieldValues()
+    {
+        return fieldValues;
+    }
 }
\ No newline at end of file

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/xml/XMLProducerComponentImpl.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/xml/XMLProducerComponentImpl.java?rev=732803&r1=732802&r2=732803&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/xml/XMLProducerComponentImpl.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/xml/XMLProducerComponentImpl.java Thu Jan  8 11:41:30 2009
@@ -1,18 +1,15 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- * 
- *       http://www.apache.org/licenses/LICENSE-2.0
- * 
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
  */
 package org.apache.webbeans.component.xml;
 
@@ -30,84 +27,82 @@
 
 public class XMLProducerComponentImpl<T> extends ProducerComponentImpl<T>
 {
-	private List<XMLInjectionPointModel> producerMethodParameters = new ArrayList<XMLInjectionPointModel>();
-	
-	private List<XMLInjectionPointModel> disposalMethodParameters = new ArrayList<XMLInjectionPointModel>();
-	
-	private Type[] actualTypeArguments = new Type[0];
-	
-	public XMLProducerComponentImpl(AbstractComponent<?> parent, Class<T> returnType)
-	{
-		super(parent, returnType);
-		this.parent = parent;
-	}
-	
-	public void addProducerMethodInjectionPointModel(XMLInjectionPointModel model)
-	{
-		Asserts.assertNotNull(model,"model parameter can not be null");
-		this.producerMethodParameters.add(model);
-	}
-	
-	public void addDisposalMethodInjectionPointModel(XMLInjectionPointModel model)
-	{
-		Asserts.assertNotNull(model,"model parameter can not be null");
-		this.disposalMethodParameters.add(model);
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.apache.webbeans.component.ProducerComponentImpl#getActualTypeArguments()
-	 */
-	@Override
-	public Type[] getActualTypeArguments()
-	{
-		return this.actualTypeArguments; 
-	}
-	
-	public void setActualTypeArguments(Type[] actualTypeArguments)
-	{
-		this.actualTypeArguments = actualTypeArguments;
-	}
-	 
-
-	protected void destroyInstance(T instance)
-	{
-		if(disposalMethod != null)
-		{
-			
-			Object object = getParentInstance();
-			
-			XMLInjectableMethods<T> methods = new XMLInjectableMethods<T>(creatorMethod,object,this,this.disposalMethodParameters);
-			methods.doInjection();
-			
-		}
-		
-		instance = null;
-	}
-	
-	
-	protected T createInstance()
-	{	
-		T instance = null;
-		Object  parentInstance = getParentInstance();
-
-		try
-		{
-			XMLInjectableMethods<T> methods = new XMLInjectableMethods<T>(creatorMethod,parentInstance,this,this.producerMethodParameters);
-			methods.doInjection();
-		}
-		finally
-		{
-			if(getParent().getScopeType().equals(Dependent.class))
-			{
-				destroyBean(getParent(), parentInstance);
-			}
-		}
-		
-		checkNullInstance(instance);
-		checkScopeType();
-		
-		return instance;
-	}
-	
+    private List<XMLInjectionPointModel> producerMethodParameters = new ArrayList<XMLInjectionPointModel>();
+
+    private List<XMLInjectionPointModel> disposalMethodParameters = new ArrayList<XMLInjectionPointModel>();
+
+    private Type[] actualTypeArguments = new Type[0];
+
+    public XMLProducerComponentImpl(AbstractComponent<?> parent, Class<T> returnType)
+    {
+        super(parent, returnType);
+        this.parent = parent;
+    }
+
+    public void addProducerMethodInjectionPointModel(XMLInjectionPointModel model)
+    {
+        Asserts.assertNotNull(model, "model parameter can not be null");
+        this.producerMethodParameters.add(model);
+    }
+
+    public void addDisposalMethodInjectionPointModel(XMLInjectionPointModel model)
+    {
+        Asserts.assertNotNull(model, "model parameter can not be null");
+        this.disposalMethodParameters.add(model);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.webbeans.component.ProducerComponentImpl#getActualTypeArguments()
+     */
+    @Override
+    public Type[] getActualTypeArguments()
+    {
+        return this.actualTypeArguments;
+    }
+
+    public void setActualTypeArguments(Type[] actualTypeArguments)
+    {
+        this.actualTypeArguments = actualTypeArguments;
+    }
+
+    protected void destroyInstance(T instance)
+    {
+        if (disposalMethod != null)
+        {
+
+            Object object = getParentInstance();
+
+            XMLInjectableMethods<T> methods = new XMLInjectableMethods<T>(creatorMethod, object, this, this.disposalMethodParameters);
+            methods.doInjection();
+
+        }
+
+        instance = null;
+    }
+
+    protected T createInstance()
+    {
+        T instance = null;
+        Object parentInstance = getParentInstance();
+
+        try
+        {
+            XMLInjectableMethods<T> methods = new XMLInjectableMethods<T>(creatorMethod, parentInstance, this, this.producerMethodParameters);
+            methods.doInjection();
+        } finally
+        {
+            if (getParent().getScopeType().equals(Dependent.class))
+            {
+                destroyBean(getParent(), parentInstance);
+            }
+        }
+
+        checkNullInstance(instance);
+        checkScopeType();
+
+        return instance;
+    }
 
 }



Mime
View raw message