KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejbca > core > model > services > IWorker


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;
14
15 import org.ejbca.core.model.log.Admin;
16
17 /**
18  * The worker interface of a service. It is the main class of a service.
19  * A worker has one IInterval and one IAction.
20  *
21  * The methods work() method is used to signal to this service that
22  * it is time to work.
23  *
24  * @author Philip Vendil 2006 sep 27
25  *
26  * @version $Id: IWorker.java,v 1.3 2006/10/14 05:01:46 herrvendil Exp $
27  */

28 public interface IWorker {
29
30     /**
31      * Method that configures this worker and also sets up it's action and interval.
32      *
33      * @param serviceConfiguration
34      * @param serviceName
35      */

36     public void init(Admin admin, ServiceConfiguration serviceConfiguration, String JavaDoc serviceName);
37     
38     /**
39      * The main method that is called by the TimeSessionBean each time
40      * it is time to activate this service
41      *
42      */

43     public void work() throws ServiceExecutionFailedException;
44     
45     /**
46      *
47      * @return the time in seconds to next execution.
48      */

49     public long getNextInterval();
50     
51 }
52
Popular Tags