use of org.apache.activemq.artemis.utils.collections.TypedProperties in project activemq-artemis by apache.
the class BridgeImpl method pause.
@Override
public void pause() throws Exception {
if (logger.isDebugEnabled()) {
logger.debug("Bridge " + this.name + " being paused");
}
executor.execute(new PauseRunnable());
if (notificationService != null) {
TypedProperties props = new TypedProperties();
props.putSimpleStringProperty(new SimpleString("name"), name);
Notification notification = new Notification(nodeUUID.toString(), CoreNotificationType.BRIDGE_STOPPED, props);
try {
notificationService.sendNotification(notification);
} catch (Exception e) {
ActiveMQServerLogger.LOGGER.notificationBridgeStoppedError(e);
}
}
}
use of org.apache.activemq.artemis.utils.collections.TypedProperties in project activemq-artemis by apache.
the class BridgeImpl method start.
@Override
public synchronized void start() throws Exception {
if (started) {
return;
}
started = true;
stopping = false;
activate();
if (notificationService != null) {
TypedProperties props = new TypedProperties();
props.putSimpleStringProperty(new SimpleString("name"), name);
Notification notification = new Notification(nodeUUID.toString(), CoreNotificationType.BRIDGE_STARTED, props);
notificationService.sendNotification(notification);
}
}
use of org.apache.activemq.artemis.utils.collections.TypedProperties in project activemq-artemis by apache.
the class BroadcastGroupImpl method stop.
@Override
public synchronized void stop() {
if (!started) {
return;
}
if (future != null) {
future.cancel(false);
}
try {
endpoint.close(true);
} catch (Exception e1) {
ActiveMQServerLogger.LOGGER.broadcastGroupClosed(e1);
}
started = false;
if (notificationService != null) {
TypedProperties props = new TypedProperties();
props.putSimpleStringProperty(new SimpleString("name"), new SimpleString(name));
Notification notification = new Notification(nodeManager.getNodeId().toString(), CoreNotificationType.BROADCAST_GROUP_STOPPED, props);
try {
notificationService.sendNotification(notification);
} catch (Exception e) {
ActiveMQServerLogger.LOGGER.broadcastGroupClosed(e);
}
}
}
use of org.apache.activemq.artemis.utils.collections.TypedProperties in project activemq-artemis by apache.
the class ClusterConnectionImpl method activate.
private synchronized void activate() throws Exception {
if (!started) {
return;
}
if (logger.isDebugEnabled()) {
logger.debug("Activating cluster connection nodeID=" + nodeManager.getNodeId() + " for server=" + this.server);
}
liveNotifier = new LiveNotifier();
liveNotifier.updateAsLive();
liveNotifier.schedule();
serverLocator = clusterConnector.createServerLocator();
if (serverLocator != null) {
if (!useDuplicateDetection) {
logger.debug("DuplicateDetection is disabled, sending clustered messages blocked");
}
final TopologyMember currentMember = topology.getMember(manager.getNodeId());
if (currentMember == null) {
// sanity check only
throw new IllegalStateException("InternalError! The ClusterConnection doesn't know about its own node = " + this);
}
serverLocator.setNodeID(nodeManager.getNodeId().toString());
serverLocator.setIdentity("(main-ClusterConnection::" + server.toString() + ")");
serverLocator.setReconnectAttempts(0);
serverLocator.setClusterConnection(true);
serverLocator.setClusterTransportConfiguration(connector);
serverLocator.setInitialConnectAttempts(-1);
serverLocator.setClientFailureCheckPeriod(clientFailureCheckPeriod);
serverLocator.setConnectionTTL(connectionTTL);
serverLocator.setConfirmationWindowSize(confirmationWindowSize);
// if not using duplicate detection, we will send blocked
serverLocator.setBlockOnDurableSend(!useDuplicateDetection);
serverLocator.setBlockOnNonDurableSend(!useDuplicateDetection);
serverLocator.setCallTimeout(callTimeout);
serverLocator.setCallFailoverTimeout(callFailoverTimeout);
serverLocator.setProducerWindowSize(producerWindowSize);
if (retryInterval > 0) {
this.serverLocator.setRetryInterval(retryInterval);
}
serverLocator.setAfterConnectionInternalListener(this);
serverLocator.setProtocolManagerFactory(ActiveMQServerSideProtocolManagerFactory.getInstance(serverLocator));
serverLocator.start(server.getExecutorFactory().getExecutor());
}
if (managementService != null) {
TypedProperties props = new TypedProperties();
props.putSimpleStringProperty(new SimpleString("name"), name);
Notification notification = new Notification(nodeManager.getNodeId().toString(), CoreNotificationType.CLUSTER_CONNECTION_STARTED, props);
logger.debug("sending notification: " + notification);
managementService.sendNotification(notification);
}
// we add as a listener after we have sent the cluster start notif as the listener may start sending notifs before
addClusterTopologyListener(this);
}
use of org.apache.activemq.artemis.utils.collections.TypedProperties in project activemq-artemis by apache.
the class InVMAcceptor method start.
@Override
public synchronized void start() throws Exception {
if (started) {
return;
}
InVMRegistry.instance.registerAcceptor(id, this);
if (notificationService != null) {
TypedProperties props = new TypedProperties();
props.putSimpleStringProperty(new SimpleString("factory"), new SimpleString(InVMAcceptorFactory.class.getName()));
props.putIntProperty(new SimpleString("id"), id);
Notification notification = new Notification(null, CoreNotificationType.ACCEPTOR_STARTED, props);
notificationService.sendNotification(notification);
}
started = true;
paused = false;
}
Aggregations