public BrokerConnector getEmbeddedBrokerConnector() throws JMSException {
try {
if (brokerConnector == null) {
BrokerContainer container = new BrokerContainerImpl(brokerName, serviceName);
if( !persistent ) {
container.setPersistenceAdapter(new VMPersistenceAdapter());
}
NetworkConnector networkConnector = null;
if (doDiscovery) {
networkConnector = new DiscoveryNetworkConnector(container);
MulticastDiscoveryAgent agent = new MulticastDiscoveryAgent(serviceName);