01 package net.sf.annocon.examples.configuration.topdown;
02
03 import java.util.List;
04
05 import net.sf.annocon.annotations.Context;
06 import net.sf.annocon.annotations.Contribution;
07 import net.sf.annocon.annotations.Subcontext;
08
09 /**
10 * Demonstrates top down contribution. The main context contributes to the
11 * configuration of a subcontext. The subcontext can be regarded as reusable
12 * component that is linked in the application.
13 *
14 * @author Achim Huegen
15 */
16 @Context
17 public class TopdownContext
18 {
19 @Contribution(configurationId = "management.MBeans")
20 public void contributeMBeans(List mbeans)
21 {
22 ManagedObject object = new ManagedObjectImpl();
23 mbeans.add(object);
24 }
25
26 @Subcontext()
27 public ManagementContext getManagement()
28 {
29 return new ManagementContext();
30 }
31
32 }
|