KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > notification > engine > TaskProcessor


1 package org.jacorb.notification.engine;
2
3 /*
4  * JacORB - a free Java ORB
5  *
6  * Copyright (C) 1999-2004 Gerald Brose
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the Free
20  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21  *
22  */

23
24 import org.jacorb.notification.interfaces.IProxyPushSupplier;
25 import org.jacorb.notification.interfaces.Message;
26 import org.jacorb.notification.interfaces.MessageSupplier;
27
28 /**
29  * @author Alphonse Bendt
30  * @version $Id: TaskProcessor.java,v 1.25 2005/04/27 10:48:40 alphonse.bendt Exp $
31  */

32
33
34 public interface TaskProcessor
35 {
36     TaskFactory getTaskFactory();
37
38
39     TaskExecutor getFilterTaskExecutor();
40
41
42     /**
43      * process a Message. the various settings for the Message
44      * (timeout, starttime, stoptime) are checked and applied.
45      */

46      void processMessage( Message mesg );
47
48
49     /**
50      * Schedule ProxyPullConsumer for pull-Operation.
51      * If a Supplier connects to a ProxyPullConsumer the
52      * ProxyPullConsumer needs to regularely poll the Supplier.
53      * This method queues a Task to run runPullEvent on the specified
54      * TimerEventSupplier
55      */

56      void scheduleTimedPullTask( MessageSupplier dest )
57         throws InterruptedException JavaDoc;
58
59     /**
60      * Schedule MessageConsumer for a deliver-Operation.
61      * Some MessageConsumers (namely SequenceProxyPushSuppliers) need to
62      * push Messages regularely to its
63      * connected Consumer. Schedule a Task to call
64      * deliverPendingEvents on the specified MessageConsumer.
65      * Also used after a disabled MessageConsumer is enabled again to
66      * push the pending Messages.
67      */

68      void schedulePushOperation( IProxyPushSupplier consumer )
69         throws InterruptedException JavaDoc;
70
71     ////////////////////////////////////////
72
// Timer Operations
73
////////////////////////////////////////
74

75
76
77      Object JavaDoc executeTaskPeriodically( long intervall,
78                      Runnable JavaDoc task,
79                      boolean startImmediately );
80
81
82     void cancelTask( Object JavaDoc id );
83
84
85     Object JavaDoc executeTaskAfterDelay( long delay, Runnable JavaDoc task );
86
87     // Object executeTaskAt( Date startTime, Runnable task );
88

89 }
90
Popular Tags