|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||
@Retention(value=RUNTIME)
@Target(value={PACKAGE,TYPE,CONSTRUCTOR,METHOD,FIELD,PARAMETER})
public @interface NamingContext
Used to enable JNDI dependency injection.
A member can be injected with an object from the JNDI tree if a
NamingContext is available for the specified member. Such a
NamingContext can be defined at package-, class- or at member-level.
There are two more requirements for members to support JNDI injection:
Inject annotation.
NamingContext is made available at package-
or class-level, must enable wiring BY_NAME or wiring BY_TYPE
through the Wiring annotation. Members that are marked with the
NamingContext support wiring BY_NAME and BY_TYPE by
default.
Members marked with this annotation MUST also be annoted with
Inject, otherwise the beanlet definition fails.
<beanlets xmlns="http://beanlet.org/schema/beanlet"
xmlns:jndi="http://beanlet.org/schema/naming"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://beanlet.org/schema/beanlet http://beanlet.org/schema/beanlet/beanlet_1_0.xsd
http://beanlet.org/schema/naming http://beanlet.org/schema/naming/beanlet_naming_1_0.xsd">
<beanlet name="foo" type="com.acme.Foo">
<jndi:naming-context>
<jndi:property name="java.naming.factory.initial" value="com.sun.jndi.cosnaming.CNCtxFactory"/>
</jndi:naming-context>
</beanlet>
</beanlets>
Inject,
Wiring| Optional Element Summary | |
|---|---|
NamingProperty[] |
value
Used to specify properties for the naming context. |
public abstract NamingProperty[] value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||