org.beanlet.naming
Annotation Type NamingContext


@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:

Members marked with this annotation MUST also be annoted with Inject, otherwise the beanlet definition fails.

XML Representation

The following xml-fragment shows how to express this annotation in xml.

 <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>

See Also:
Inject, Wiring

Optional Element Summary
 NamingProperty[] value
          Used to specify properties for the naming context.
 

value

public abstract NamingProperty[] value
Used to specify properties for the naming context.

Default:
{}


Copyright © 2006-2012. All Rights Reserved.