1 15 package org.apache.examples.annotations.panorama; 16 17 import java.util.List ; 18 19 import org.apache.examples.panorama.mail.MailStartup; 20 import org.apache.examples.panorama.startup.Executable; 21 import org.apache.examples.panorama.startup.impl.Task; 22 import org.apache.hivemind.annotations.AbstractAnnotatedModule; 23 import org.apache.hivemind.annotations.definition.Contribution; 24 import org.apache.hivemind.annotations.definition.Service; 25 26 public class PanoramaMailModule extends AbstractAnnotatedModule 27 { 28 @Service( id="MailStartup" ) 29 public Executable getMailStartupService() 30 { 31 Executable startup = new MailStartup(); 32 return startup; 33 } 34 35 @Contribution( configurationId="panorama.startup.tasks" ) 36 public void contributeTaks(List <Task> tasks) 37 { 38 Task mailStartupTask = new Task(); 39 mailStartupTask.setExecutable(service("MailStartup", Executable.class)); 40 mailStartupTask.setId("mail"); 41 mailStartupTask.setTitle("Mail"); 42 43 tasks.add(mailStartupTask); 44 } 45 46 } 47 | Popular Tags |