Package org.apache.activemq.maven
Class MavenBrokerSingletonManager
- java.lang.Object
-
- org.apache.activemq.maven.MavenBrokerSingletonManager
-
- All Implemented Interfaces:
MavenBrokerManager
public class MavenBrokerSingletonManager extends Object implements MavenBrokerManager
Broker manager for use with Maven; uses the original singleton to track the broker instance.
-
-
Constructor Summary
Constructors Constructor Description MavenBrokerSingletonManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BrokerService
getBroker()
Return the broker service created.void
setBroker(BrokerService broker)
Override the default creation of the broker service.void
start(boolean fork, String configUri)
Start the broker using the fork setting and configuration at the given URI.void
stop()
Stop the broker.protected void
waitForShutdown()
Wait for a shutdown invocation elsewhere
-
-
-
Method Detail
-
start
public void start(boolean fork, String configUri) throws org.apache.maven.plugin.MojoExecutionException
Description copied from interface:MavenBrokerManager
Start the broker using the fork setting and configuration at the given URI.- Specified by:
start
in interfaceMavenBrokerManager
- Parameters:
fork
- true => run the broker asynchronously; false => run the broker synchronously (this method does not return until the broker shuts down)configUri
- URI of the broker configuration; prefix with "xbean:file" to read XML configuration from a file.- Throws:
org.apache.maven.plugin.MojoExecutionException
-
stop
public void stop() throws org.apache.maven.plugin.MojoExecutionException
Description copied from interface:MavenBrokerManager
Stop the broker.- Specified by:
stop
in interfaceMavenBrokerManager
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
waitForShutdown
protected void waitForShutdown() throws Exception
Wait for a shutdown invocation elsewhere- Throws:
Exception
-
getBroker
public BrokerService getBroker()
Return the broker service created.- Specified by:
getBroker
in interfaceMavenBrokerManager
-
setBroker
public void setBroker(BrokerService broker)
Override the default creation of the broker service. Primarily added for testing purposes.- Specified by:
setBroker
in interfaceMavenBrokerManager
- Parameters:
broker
-
-
-