1 package org.apache.commons.jelly.tags.quartz;
2
3 /*
4 * $Header: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/quartz/WaitForSchedulerTag.java,v 1.1 2002/07/25 01:51:20 werken Exp $
5 * $Revision: 1.1 $
6 * $Date: 2002/07/25 01:51:20 $
7 *
8 * ====================================================================
9 *
10 * The Apache Software License, Version 1.1
11 *
12 * Copyright (c) 1999-2001 The Apache Software Foundation. All rights
13 * reserved.
14 *
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions
17 * are met:
18 *
19 * 1. Redistributions of source code must retain the above copyright
20 * notice, this list of conditions and the following disclaimer.
21 *
22 * 2. Redistributions in binary form must reproduce the above copyright
23 * notice, this list of conditions and the following disclaimer in
24 * the documentation and/or other materials provided with the
25 * distribution.
26 *
27 * 3. The end-user documentation included with the redistribution, if
28 * any, must include the following acknowlegement:
29 * "This product includes software developed by the
30 * Apache Software Foundation (http://www.apache.org/)."
31 * Alternately, this acknowlegement may appear in the software itself,
32 * if and wherever such third-party acknowlegements normally appear.
33 *
34 * 4. The names "The Jakarta Project", "Commons", and "Apache Software
35 * Foundation" must not be used to endorse or promote products derived
36 * from this software without prior written permission. For written
37 * permission, please contact apache@apache.org.
38 *
39 * 5. Products derived from this software may not be called "Apache"
40 * nor may "Apache" appear in their names without prior written
41 * permission of the Apache Group.
42 *
43 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
44 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
45 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
46 * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
47 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
48 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
49 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
50 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
51 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
52 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
53 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
54 * SUCH DAMAGE.
55 * ====================================================================
56 *
57 * This software consists of voluntary contributions made by many
58 * individuals on behalf of the Apache Software Foundation. For more
59 * information on the Apache Software Foundation, please see
60 * <http://www.apache.org/>.
61 *
62 */
63
64 import org.apache.commons.jelly.XMLOutput;
65
66 import org.quartz.Scheduler;
67
68 /*** Block and wait for the Quartz scheduler to shutdown.
69 *
70 * @author <a href="mailto:bob@eng.werken.com">bob mcwhirter</a>
71 */
72 public class WaitForSchedulerTag extends QuartzTagSupport
73 {
74 // ------------------------------------------------------------
75 // Constructors
76 // ------------------------------------------------------------
77
78 /*** Construct.
79 */
80 public WaitForSchedulerTag()
81 {
82 // intentionally left blank.
83 }
84
85 // ------------------------------------------------------------
86 // Instance methods
87 // ------------------------------------------------------------
88
89 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
90 // org.apache.commons.jelly.Tag
91 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
92
93 /*** Perform this tag.
94 *
95 * @param output Output sink.
96 *
97 * @throws Exception If an error occurs.
98 */
99 public void doTag(XMLOutput output) throws Exception
100 {
101 Scheduler sched = getScheduler();
102
103 while ( ! sched.isShutdown() )
104 {
105 try
106 {
107 Thread.sleep( 500 );
108 }
109 catch (InterruptedException e)
110 {
111 break;
112 }
113 }
114 }
115 }
116
This page was automatically generated by Maven