KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > mybatchfwk > jmx > ManagedBatchServiceMBean


1 /*
2  * MyBatchFramework - Open-source batch framework.
3  * Copyright (C) 2006 Jérôme Bertèche cyberteche@users.sourceforge.net
4  *
5  * This library 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 (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * Jérôme Bertèche
16  * Email: cyberteche@users.sourceforge.net
17  */

18 package net.sf.mybatchfwk.jmx;
19
20 import java.util.Date JavaDoc;
21
22 /**
23  * The MBean interface of the batch service.<br>
24  * Provide the operations pause, resume, restart and shutdown.<br>
25  * Provide attributes that give informations about the batch execution: number of
26  * completed and failed tasks, current state, begin date and end date of the execution.
27  * @author Jérôme Bertèche (cyberteche@users.sourceforge.net)
28  */

29 public interface ManagedBatchServiceMBean {
30     
31     /**
32      * Pause operation.<br>
33      * Suspends the execution of the batch/executor/schedule services.<br>
34      * <i>Required batch state:</i> running
35      * @throws Exception if the state of the batch cannot permit this operation.
36      */

37     public void pause() throws Exception JavaDoc;
38     
39     /**
40      * Resume operation.<br>
41      * Resume the execution of the batch/executor/schedule services.<br>
42      * <i>Required batch state:</i> sleeping, waiting for launch, waiting for shutdown
43      * @throws Exception if the state of the batch cannot permit this operation.
44      */

45     public void resume() throws Exception JavaDoc;
46     
47     /**
48      * Shutdown operation.<br>
49      * Stop the execution of the batch. Wait for the execution of the submitted tasks before to terminate.<br>
50      * <i>Required batch state:</i> all
51      * @throws Exception if the state of the batch cannot permit this operation.
52      */

53     public void shutdown() throws Exception JavaDoc;
54     
55     /**
56      * Shutdown now operation.<br>
57      * Stop the execution of the batch immediately.<br>
58      * <b>Warning:</b> the running tasks will be stopped abruptly.<br>
59      * <i>Required batch state:</i> all
60      * @throws Exception if the state of the batch cannot permit this operation.
61      */

62     public void shutdownNow() throws Exception JavaDoc;
63     
64     /**
65      * Restart operation.<br>
66      * Restart the execution of the batch.<br>
67      * <i>Required batch state:</i> waiting for shutdown
68      * @throws Exception if the state of the batch cannot permit this operation.
69      */

70     public void restart() throws Exception JavaDoc;
71     
72     /**
73      * Return the number of completed tasks
74      * @return
75      */

76     public long getNumberOfCompletedTasks();
77     
78     /**
79      * Return the number of failed tasks
80      * @return
81      */

82     public long getNumberOfFailedTasks();
83     
84     /**
85      * Return the current batch state
86      * @return
87      */

88     public String JavaDoc getState();
89     
90     /**
91      * Return the begin date of the execution
92      * @return
93      */

94     public Date JavaDoc getBeginDate();
95     
96     /**
97      * Return the end date of the execution
98      * @return
99      */

100     public Date JavaDoc getEndDate();
101 }
102
Popular Tags