Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored some of the injection point metadata bean code.
git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@835 1c488680-804c-0410-94cd-c6b725194a0e
- Loading branch information
Showing
5 changed files
with
135 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
webbeans-ri/src/main/java/org/jboss/webbeans/bean/InjectionPointBean.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* 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.bean; | ||
|
||
import org.jboss.webbeans.ManagerImpl; | ||
import org.jboss.webbeans.introspector.AnnotatedItem; | ||
|
||
/** | ||
* Bean for InjectionPoint metadata | ||
* | ||
* @author David Allen | ||
* | ||
*/ | ||
public class InjectionPointBean<T, S> extends AbstractFacadeBean<T, S, Object> | ||
{ | ||
|
||
/** | ||
* Creates an InjectionPoint Web Bean for the injection of the containing bean owning | ||
* the field, constructor or method for the annotated item | ||
* | ||
* @param <T> must be InjectionPoint | ||
* @param <S> | ||
* @param field The annotated member field/parameter for the injection | ||
* @param manager The RI manager implementation | ||
* @return a new bean for this injection point | ||
*/ | ||
public static <T, S> InjectionPointBean<T, S> of(AnnotatedItem<T, S> field, ManagerImpl manager) | ||
{ | ||
return new InjectionPointBean<T, S>(field, manager); | ||
} | ||
|
||
protected InjectionPointBean(AnnotatedItem<T, S> field, ManagerImpl manager) | ||
{ | ||
super(field, manager); | ||
} | ||
|
||
@SuppressWarnings("unchecked") | ||
@Override | ||
public T create() | ||
{ | ||
return (T) manager.getInjectionPointFactory().getPreviousInjectionPoint(); | ||
} | ||
|
||
@Override | ||
public void destroy(T instance) | ||
{ | ||
// The instance is always in the Dependent context and can be garbage | ||
// collected | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters