KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > examples > annotations > panorama > PanoramaMailModule


1 // Copyright 2007 The Apache Software Foundation
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15 package org.apache.examples.annotations.panorama;
16
17 import java.util.List JavaDoc;
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 JavaDoc<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