KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > oddjob > scheduling > ScheduleInstructionFactory


1 /*
2  * (c) Rob Gordon 2005
3  */

4 package org.oddjob.scheduling;
5
6 import org.oddjob.arooa.ArooaException;
7 import org.oddjob.arooa.ArooaHandler;
8 import org.oddjob.arooa.ArooaContext;
9 import org.oddjob.arooa.ObjectFactory;
10 import org.oddjob.arooa.SimpleObjectFactory;
11 import org.oddjob.arooa.handlers.ValueHandler;
12
13 public class ScheduleInstructionFactory implements ObjectFactory {
14
15     private final SimpleObjectFactory delegate;
16     
17     public ScheduleInstructionFactory() {
18         delegate = new SimpleObjectFactory();
19         delegate.addResource("/org/oddjob/scheduling/scheduling.properties");
20     }
21     
22     public Object JavaDoc createObject(String JavaDoc name) throws ArooaException {
23         return delegate.createObject(name);
24     }
25     
26     /**
27      * Return a handler capable of handling a SchedulingInstruction element.
28      *
29      * @param context The ArooaContext
30      * @return The handler.
31      */

32     public static ArooaHandler handlerFor(ArooaContext context) {
33         ValueHandler handler = new ValueHandler();
34         handler.setValueFactory(new ScheduleInstructionFactory());
35         return handler;
36     }
37 }
38
Popular Tags