KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejbca > core > model > services > workers > DummyWorker


1 /*************************************************************************
2  * *
3  * EJBCA: The OpenSource Certificate Authority *
4  * *
5  * This software is free software; you can redistribute it and/or *
6  * modify it under the terms of the GNU Lesser General Public *
7  * License as published by the Free Software Foundation; either *
8  * version 2.1 of the License, or any later version. *
9  * *
10  * See terms of license at gnu.org. *
11  * *
12  *************************************************************************/

13 package org.ejbca.core.model.services.workers;
14
15 import org.apache.log4j.Logger;
16 import org.ejbca.core.model.services.ActionException;
17 import org.ejbca.core.model.services.BaseWorker;
18 import org.ejbca.core.model.services.ServiceExecutionFailedException;
19
20 /**
21  * Dummy class used for demonstration and test puporses
22  * Shows what is needed to create a custom worker
23  *
24  * @author Philip Vendil 2006 sep 27
25  *
26  * @version $Id: DummyWorker.java,v 1.2 2006/10/26 11:01:24 herrvendil Exp $
27  */

28 public class DummyWorker extends BaseWorker {
29
30     private static final Logger log = Logger.getLogger(DummyWorker.class);
31     
32     /**
33      * @see org.ejbca.core.model.services.IWorker#work()
34      */

35     public void work() throws ServiceExecutionFailedException {
36         log.debug(">DummyWorker.work");
37         try {
38             log.info("DummyWorker executed");
39             getAction().performAction(null);
40         } catch (ActionException e) {
41            // This should never happen
42
}
43         log.debug("<DummyWorker.work");
44     }
45
46 }
47
Popular Tags