Top Description Fields Constructors Methods
org.mortbay.jetty.plus.annotation

public Class Injection

extends Object
Class Inheritance
Imports
java.lang.reflect.Field, .Member, .Method, javax.naming.InitialContext, .NamingException, org.mortbay.log.Log, org.mortbay.util.IntrospectionUtil

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.

Field Summary

Modifier and TypeField and Description
private String
private String
private Member
private Class<T>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the jndiName
getJndiName
()

public String

Returns:

the mappingName
getMappingName
()

public Member

Returns:

the target
getTarget
()

public Class<T>

Returns:

the _className
getTargetClass
()

public void
inject(Object injectable)

Inject a value for a Resource from JNDI into an object

public void
injectField(Field field, Object injectable)

Inject value from jndi into a field of an instance

public void
injectMethod(Method method, Object injectable)

Inject value from jndi into a setter method of an instance

public Object
lookupInjectedValue()

The Resource must already exist in the ENC of this webapp.

public void
setJndiName(String
the jndiName to set
jndiName
)

public void
setMappingName(String
the mappingName to set
mappingName
)

public void
setTarget(Member
the target to set
target
)

public void
setTarget(Class<T> clazz, String targetName, Class<T> targetType)

public void
setTargetClass(Class<T>
the _className to set
clazz
)

private void
validateInjection(Method method, Object injectable)

private void
validateInjection(Field field, Object injectable)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_jndiNameback to summary
private String _jndiName
_mappingNameback to summary
private String _mappingName
_targetback to summary
private Member _target
_targetClassback to summary
private Class<T> _targetClass

Constructor Detail

Injectionback to summary
public Injection()

Method Detail

getJndiNameback to summary
public String getJndiName()
Returns:String

the jndiName

getMappingNameback to summary
public String getMappingName()
Returns:String

the mappingName

getTargetback to summary
public Member getTarget()
Returns:Member

the target

getTargetClassback to summary
public Class<T> getTargetClass()
Returns:Class<T>

the _className

injectback to summary
public void inject(Object injectable)

Inject a value for a Resource from JNDI into an object

injectFieldback to summary
public void injectField(Field field, Object injectable)

Inject value from jndi into a field of an instance

injectMethodback to summary
public void injectMethod(Method method, Object injectable)

Inject value from jndi into a setter method of an instance

lookupInjectedValueback to summary
public Object lookupInjectedValue() throws NamingException

The Resource must already exist in the ENC of this webapp.

setJndiNameback to summary
public void setJndiName(String jndiName)
Parameters
jndiName:String

the jndiName to set

setMappingNameback to summary
public void setMappingName(String mappingName)
Parameters
mappingName:String

the mappingName to set

setTargetback to summary
public void setTarget(Member target)
Parameters
target:Member

the target to set

setTargetback to summary
public void setTarget(Class<T> clazz, String targetName, Class<T> targetType)
setTargetClassback to summary
public void setTargetClass(Class<T> clazz)
Parameters
clazz:Class<T>

the _className to set

validateInjectionback to summary
private void validateInjection(Method method, Object injectable) throws NoSuchMethodException
validateInjectionback to summary
private void validateInjection(Field field, Object injectable) throws NoSuchFieldException