public class PubSubExecutor extends ComponentClient
About termination of pub-sub runs:
numberOfEvents can control
how many events a publisher sends or a subscriber receives.
This is useful only when these times are short, since this PubSubExecutor will
keep open calls to these components.
numberOfEvents is missing or has a non-positive value,
then the PubSubExecutor commands all publisher and subscriber
components to do their work, and the calls to these components return.
This makes sense for longer times.
Therefore, if at least one pub/sub component is configured for an unbounded number of events,
the method execute(PubSubScenario, long, TimeUnit)
must be called with a timeout, so that the pub/sub components can be stopped
and their containers as well.
m_logger, m_shutdownHook| Constructor and Description |
|---|
PubSubExecutor()
Constructor, which is independent of a concrete pub-sub scenario.
|
| Modifier and Type | Method and Description |
|---|---|
void |
execute(PubSubScenario scenario)
Run the specified pub/sub container and components.
|
void |
execute(PubSubScenario scenario,
long executionTimeMax,
java.util.concurrent.TimeUnit executionTimeMaxUnit)
Run the specified pub/sub container and components.
|
static void |
main(java.lang.String[] args)
Parameters:
XML config file name.
|
void |
tearDown()
This method must be called when done, so that this
PubSubExecutor
can release resources. |
getContainerServices, initAlarmSystem, initRemoteLogging, registerShutdownHook, tearDownAlarmSystempublic PubSubExecutor()
throws java.lang.Exception
PubSubExecutor to execute more than one scenario.java.lang.Exceptionpublic void tearDown()
throws java.lang.Exception
PubSubExecutor
can release resources.tearDown in class ComponentClientjava.lang.ExceptionComponentClient.tearDown()public void execute(PubSubScenario scenario) throws java.lang.Throwable
Termination element
that defines a timeout, or
numberOfEvents attribute.
scenario - java.lang.Throwablepublic void execute(PubSubScenario scenario, long executionTimeMax, java.util.concurrent.TimeUnit executionTimeMaxUnit) throws java.lang.Throwable
execute(PubSubScenario),
the executionTime parameter can overwrite the timeout setting from the XML, or can
set a timeout complementary to a finite PubSubSpecCommonT#numberOfEvents.java.lang.Throwablepublic static void main(java.lang.String[] args)
container1=host1:container2=host2.
args -