Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mortbay.jetty.plus.annotation
Class Injection

    java.lang.Object
      org.mortbay.jetty.plus.annotation.Injection

    public class Injection

extends java.lang.Object

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
`java.lang.String` | `getJndiName()`
`java.lang.String` | `getMappingName()`
`java.lang.reflect.Member` | `getTarget()`
`java.lang.Class` | `getTargetClass()`
`void` | `inject(java.lang.Object injectable)` Inject a value for a Resource from JNDI into an object
`void` | `injectField(java.lang.reflect.Field field, java.lang.Object injectable)` Inject value from jndi into a field of an instance
`void` | `injectMethod(java.lang.reflect.Method method, java.lang.Object injectable)` Inject value from jndi into a setter method of an instance
`java.lang.Object` | `lookupInjectedValue()` The Resource must already exist in the ENC of this webapp.
`void` | `setJndiName(java.lang.String jndiName)`
`void` | `setMappingName(java.lang.String mappingName)`
`void` | `setTarget(java.lang.Class clazz, java.lang.String targetName, java.lang.Class targetType)`
`void` | `setTarget(java.lang.reflect.Member target)`
`void` | `setTargetClass(java.lang.Class clazz)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Injection

    public Injection()

Method Detail

### getTargetClass

    public java.lang.Class getTargetClass()

  Returns:
    the _className

### setTargetClass

    public void setTargetClass(java.lang.Class clazz)

  Parameters:
    `name` - the _className to set

### getJndiName

    public java.lang.String getJndiName()

  Returns:
    the jndiName

### setJndiName

    public void setJndiName(java.lang.String jndiName)

  Parameters:
    `jndiName` - the jndiName to set

### getMappingName

    public java.lang.String getMappingName()

  Returns:
    the mappingName

### setMappingName

    public void setMappingName(java.lang.String mappingName)

  Parameters:
    `mappingName` - the mappingName to set

### getTarget

    public java.lang.reflect.Member getTarget()

  Returns:
    the target

### setTarget

    public void setTarget(java.lang.reflect.Member target)

  Parameters:
    `target` - the target to set

### setTarget

    public void setTarget(java.lang.Class clazz,
                          java.lang.String targetName,
                          java.lang.Class targetType)

### inject

    public void inject(java.lang.Object injectable)

  Inject a value for a Resource from JNDI into an object

  Parameters:
    `injectable` -
  Throws:
    `java.lang.Exception`

### lookupInjectedValue

    public java.lang.Object lookupInjectedValue()
                                         throws javax.naming.NamingException

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

  Returns:
  Throws:
    `java.lang.Exception`
    `javax.naming.NamingException`

### injectField

    public void injectField(java.lang.reflect.Field field,
                            java.lang.Object injectable)

  Inject value from jndi into a field of an instance

  Parameters:
    `field` -
    `injectable` -

### injectMethod

    public void injectMethod(java.lang.reflect.Method method,
                             java.lang.Object injectable)

  Inject value from jndi into a setter method of an instance

  Parameters:
    `method` -
    `injectable` -

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 1995-2010 Mort Bay Consulting. All Rights Reserved.