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

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

### getClassName

    public String getClassName()

  Returns:
    the _className

### setClassName

    public void setClassName(String name)

  Parameters:
    `name` - the _className to set

### getJndiName

    public String getJndiName()

  Returns:
    the jndiName

### setJndiName

    public void setJndiName(String jndiName)

  Parameters:
    `jndiName` - the jndiName to set

### getMappingName

    public String getMappingName()

  Returns:
    the mappingName

### setMappingName

    public void setMappingName(String mappingName)

  Parameters:
    `mappingName` - the mappingName to set

### getTarget

    public Member getTarget()

  Returns:
    the target

### setTarget

    public void setTarget(Member target)

  Parameters:
    `target` - the target to set

### setTarget

    public void setTarget(Class clazz,
                          String targetName,
                          Class targetType)

### inject

    public void inject(Object injectable)
                throws Exception

  Inject a value for a Resource from JNDI into an object

  Parameters:
    `injectable` -
  Throws:
    `Exception`

### lookupInjectedValue

    public Object lookupInjectedValue()
                               throws Exception

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

  Returns:
  Throws:
    `Exception`

### injectField

    public void injectField(Field field,
                            Object injectable)
                     throws Exception

  Inject value from jndi into a field of an instance

  Parameters:
    `field` -
    `injectable` -
  Throws:
    `Exception`

### injectMethod

    public void injectMethod(Method method,
                             Object injectable)
                      throws Exception

  Inject value from jndi into a setter method of an instance

  Parameters:
    `method` -
    `injectable` -
  Throws:
    `Exception`

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 © 2007 Mort Bay Consulting. All Rights Reserved.