|
||||||||||
| 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 SpringContext
Used to enabled Spring dependency injection.
A member can be injected with a Spring bean if a SpringContext is
available for the specified member. Such a SpringContext can be
defined at package-, class- or at member-level. There are two more requirements
for members to support Spring beanlet injection:
Inject annotation.
SpringContext 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
SpringContext 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:sf="http://beanlet.org/schema/springframework"
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/springframework http://beanlet.org/schema/springframework/beanlet_springframework_1_0.xsd">
<beanlet name="foo" type="com.acme.Foo">
<sf:spring-contex path="spring.xml" type="CLASSPATH" format="XML" application-context="false"/>
</beanlet>
</beanlets>
Or:
<beanlets xmlns="http://beanlet.org/schema/beanlet"
xmlns:sf="http://beanlet.org/schema/springframework"
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/springframework http://beanlet.org/schema/springframework/beanlet_springframework_1_0.xsd">
<beanlet name="foo" type="com.acme.Foo">
<sf:spring-contex application-context="false">
<resource path="spring.xml" type="CLASSPATH" format="XML"/>
<resource path="http://demo.beanlet.org/spring.xml" type="URL" format="XML"/>
</sf:spring-context>
</beanlet>
</beanlets>
Or alternatively:
<beanlets xmlns="http://beanlet.org/schema/beanlet"
xmlns:sf="http://beanlet.org/schema/springframework"
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/springframework http://beanlet.org/schema/springframework/beanlet_springframework_1_0.xsd">
<beanlet name="foo" type="com.acme.Foo">
<sf:spring-contex type="CLASSPATH" format="XML" application-context="false">
<resource path="spring.xml"/>
<resource path="http://demo.beanlet.org/spring.xml" type="URL"/>
</sf:spring-context>
</beanlet>
</beanlets>
Inject,
Wiring| Required Element Summary | |
|---|---|
SpringResource[] |
value
Spring configuration resources. |
| Optional Element Summary | |
|---|---|
boolean |
applicationContext
Set to true for creating defining a Spring
ApplicationContext, set to false to define a
BeanFactory. |
| Element Detail |
|---|
public abstract SpringResource[] value
public abstract boolean applicationContext
true for creating defining a Spring
ApplicationContext, set to false to define a
BeanFactory.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||