|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jetty.plus.annotation.Injection
public class Injection
Injection Represents the injection of a resource into a target (method or field). The injection is performed by doing an ENC lookup using the jndi name provided, and setting the object obtained on the target.
Constructor Summary | |
---|---|
Injection()
|
Method Summary | |
---|---|
String |
getFieldName()
|
String |
getJndiName()
|
String |
getMappingName()
|
String |
getMethodName()
|
String |
getParamCanonicalName()
|
Member |
getTarget()
|
Class |
getTargetClass()
|
String |
getTargetClassName()
|
void |
inject(Object injectable)
Inject a value for a Resource from JNDI into an object |
protected void |
injectField(Field field,
Object injectable)
Inject value from jndi into a field of an instance |
protected void |
injectMethod(Method method,
Object injectable)
Inject value from jndi into a setter method of an instance |
boolean |
isField()
|
boolean |
isMethod()
|
protected void |
loadField()
|
protected void |
loadMethod()
Load the target class and method. |
Object |
lookupInjectedValue()
The Resource must already exist in the ENC of this webapp. |
void |
setJndiName(String jndiName)
|
void |
setMappingName(String mappingName)
|
void |
setTarget(Class clazz,
String targetName,
Class targetType)
|
void |
setTarget(String className,
String fieldName,
String annotationResourceType)
Set up an injection target that is a field |
void |
setTarget(String className,
String methodName,
String paramCanonicalName,
String annotationResourceType)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Injection()
Method Detail |
---|
public Class getTargetClass()
public String getTargetClassName()
public String getFieldName()
public String getMethodName()
public String getParamCanonicalName()
public boolean isField()
public boolean isMethod()
public String getJndiName()
public void setJndiName(String jndiName)
jndiName
- the jndiName to setpublic String getMappingName()
public void setMappingName(String mappingName)
mappingName
- the mappingName to setpublic Member getTarget()
public void setTarget(String className, String fieldName, String annotationResourceType)
className
- fieldName
- public void setTarget(String className, String methodName, String paramCanonicalName, String annotationResourceType)
public void setTarget(Class clazz, String targetName, Class targetType)
public void inject(Object injectable)
injectable
- public Object lookupInjectedValue() throws NamingException
NamingException
protected void injectField(Field field, Object injectable)
field
- injectable
- protected void injectMethod(Method method, Object injectable)
method
- injectable
- protected void loadField() throws ClassNotFoundException, NoSuchFieldException
ClassNotFoundException
NoSuchFieldException
protected void loadMethod() throws ClassNotFoundException, NoSuchMethodException
ClassNotFoundException
NoSuchMethodException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |