Your browser does not support JavaScript and this site utilizes JavaScript to build content and provide links to additional information. You should either enable JavaScript in your browser settings or use a browser that supports JavaScript in order to take full advantage of this site.

1 /*2 * Copyright 2000-2001,2004 The Apache Software Foundation.3 * 4 * Licensed under the Apache License, Version 2.0 (the "License");5 * you may not use this file except in compliance with the License.6 * You may obtain a copy of the License at7 * 8 * http://www.apache.org/licenses/LICENSE-2.09 * 10 * Unless required by applicable law or agreed to in writing, software11 * distributed under the License is distributed on an "AS IS" BASIS,12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13 * See the License for the specific language governing permissions and14 * limitations under the License.15 */16 17 package org.apache.jetspeed.daemon;18 19 20 /**21 A simple interface to create Daemons within Jetspeed. These are basically 22 threads that get work done to facilitate content serving.23 24 @author <a HREF="mailto:burton@apache.org">Kevin A. Burton</a>25 @version $Id: Daemon.java,v 1.9 2004/02/23 02:48:57 jford Exp $26 */27 publicinterface Daemon extendsRunnable {28 29 publicfinalstaticint STATUS_UNKNOWN = 0;30 publicfinalstaticint STATUS_NOT_PROCESSED = 1;31 publicfinalstaticint STATUS_PROCESSED = 2;32 publicfinalstaticint STATUS_PROCESSING = 3;33 publicfinalstaticint STATUS_NOT_STARTED = 4;34 publicfinalstaticint STATUS_STARTED = 5;35 36 /**37 The result for this daemon is not yet known.38 */39 publicfinalstaticint RESULT_UNKNOWN = 0;40 41 /**42 A daemon has processed and it was successful43 */44 publicfinalstaticint RESULT_SUCCESS = 1;45 46 /**47 A daemon has processed but it has failed48 */49 publicfinalstaticint RESULT_FAILED = 2;50 51 /**52 A daemon is processing so its result is not yet known53 */54 publicfinalstaticint RESULT_PROCESSING = 3;55 56 /**57 Initialize this daemon providing configuration data.58 */59 publicvoid init(DaemonConfig config, DaemonEntry entry);60 61 /**62 Require that Daemons have a getter for the DaemonConfig63 */64 publicDaemonConfig getDaemonConfig();65 66 /**67 Report on the status of this daemon. Should be of STATUS_NOT_PROCESSED, 68 STATUS_PROCESSED, or STATUS_PROCESSING 69 */70 publicint getStatus();71 72 /**73 Force the status on this Daemon74 */75 publicvoid setStatus(int status);76 77 /**78 Get the entry for this daemon.79 */80 publicDaemonEntry getDaemonEntry();81 82 /**83 <p>84 Get the result of this daemons processing. All Daemon implementations 85 are responsible for defining this.86 </p>87 88 <p>89 The default for this should be RESULT_UNKNOWN. This usually means that90 this daemon has never been called for processing. 91 </p>92 */93 publicint getResult();94 95 /**96 Force the result of this Daemon97 */98 publicvoid setResult( int result );99 100 /**101 Provided so that a Daemon can provide a message to users. Null if it has102 nothing to give to the user.103 */104 publicString getMessage();105 }106 107