activemq-cpp-3.9.5
CompositeTaskRunner.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef _ACTIVEMQ_THREADS_COMPOSITETASKRUNNER_H_
19#define _ACTIVEMQ_THREADS_COMPOSITETASKRUNNER_H_
20
24#include <decaf/util/StlSet.h>
26#include <decaf/lang/Thread.h>
27#include <decaf/lang/Runnable.h>
29#include <decaf/lang/Pointer.h>
30
31namespace activemq {
32namespace threads {
33
34 class CompositeTaskRunnerImpl;
35
42 class AMQCPP_API CompositeTaskRunner : public activemq::threads::TaskRunner,
45 private:
46
47 CompositeTaskRunnerImpl* impl;
48
49 private:
50
51 CompositeTaskRunner(const CompositeTaskRunner&);
52 CompositeTaskRunner& operator=(const CompositeTaskRunner&);
53
54 public:
55
57
59
60 virtual void start();
61
62 virtual bool isStarted() const;
63
69
75
82 virtual void shutdown(long long timeout);
83
87 virtual void shutdown();
88
94 virtual void wakeup();
95
96 protected:
97
98 virtual void run();
99
100 virtual bool iterate();
101
102 };
103
104}}
105
106#endif /* _ACTIVEMQ_THREADS_COMPOSITETASKRUNNER_H_ */
#define AMQCPP_API
Definition Config.h:30
Represents a single task that can be part of a set of Tasks that are contained in a CompositeTaskRunn...
Definition CompositeTask.h:33
virtual void run()
Run method - called by the Thread class in the context of the thread.
void removeTask(CompositeTask *task)
Removes a CompositeTask that was added previously.
void addTask(CompositeTask *task)
Adds a new CompositeTask to the Set of Tasks that this class manages.
virtual void wakeup()
Signal the TaskRunner to wakeup and execute another iteration cycle on the task, the Task instance wi...
virtual void shutdown()
Shutdown once the task has finished and the TaskRunner's thread has exited.
virtual bool iterate()
Perform one iteration of work, returns true if the task needs to run again to complete or false to in...
virtual void shutdown(long long timeout)
Shutdown after a timeout, does not guarantee that the task's iterate method has completed and the thr...
virtual void start()
Starts the task runner.
Represents a unit of work that requires one or more iterations to complete.
Definition Task.h:31
Definition TaskRunner.h:27
Interface for a runnable object - defines a task that can be run by a thread.
Definition Runnable.h:29
Definition CompositeTask.h:25
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition CachedConsumer.h:24