org.apache.activemq.artemis.core.server.management.Notification.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(12.5k)|赞(0)|评价(0)|浏览(76)

本文整理了Java中org.apache.activemq.artemis.core.server.management.Notification.<init>()方法的一些代码示例,展示了Notification.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Notification.<init>()方法的具体详情如下:
包路径:org.apache.activemq.artemis.core.server.management.Notification
类名称:Notification
方法名:<init>

Notification.<init>介绍

暂无

代码示例

代码示例来源:origin: wildfly/wildfly

@Override
public synchronized void start() throws Exception {
 if (started) {
   return;
 }
 endpoint.openClient();
 started = true;
 thread = new Thread(new DiscoveryRunnable(), "activemq-discovery-group-thread-" + name);
 thread.setDaemon(true);
 thread.start();
 if (notificationService != null) {
   TypedProperties props = new TypedProperties();
   props.putSimpleStringProperty(new SimpleString("name"), new SimpleString(name));
   Notification notification = new Notification(nodeID, CoreNotificationType.DISCOVERY_GROUP_STARTED, props);
   notificationService.sendNotification(notification);
 }
}

代码示例来源:origin: wildfly/wildfly

TypedProperties props = new TypedProperties();
props.putSimpleStringProperty(new SimpleString("name"), new SimpleString(name));
Notification notification = new Notification(nodeID, CoreNotificationType.DISCOVERY_GROUP_STOPPED, props);
try {
 notificationService.sendNotification(notification);

代码示例来源:origin: apache/activemq-artemis

private void sendConnectionNotification(final RemotingConnection connection, final CoreNotificationType type) {
 final ManagementService managementService = getManagementService();
 if (managementService != null && sendConnectionNotifications) {
   try {
    final TypedProperties props = new TypedProperties();
    props.putSimpleStringProperty(ManagementHelper.HDR_CONNECTION_NAME, SimpleString.toSimpleString(connection.getID().toString()));
    props.putSimpleStringProperty(ManagementHelper.HDR_REMOTE_ADDRESS, SimpleString.toSimpleString(connection.getRemoteAddress()));
    managementService.sendNotification(new Notification(null, type, props));
   } catch (Exception e) {
    logger.warn("Error sending notification: " + type, e.getMessage(), e);
   }
 }
}

代码示例来源:origin: apache/activemq-artemis

@Override
public synchronized void start() throws Exception {
 if (started) {
   return;
 }
 endpoint.openClient();
 started = true;
 thread = new Thread(new DiscoveryRunnable(), "activemq-discovery-group-thread-" + name);
 thread.setDaemon(true);
 thread.start();
 if (notificationService != null) {
   TypedProperties props = new TypedProperties();
   props.putSimpleStringProperty(new SimpleString("name"), new SimpleString(name));
   Notification notification = new Notification(nodeID, CoreNotificationType.DISCOVERY_GROUP_STARTED, props);
   notificationService.sendNotification(notification);
 }
}

代码示例来源:origin: apache/activemq-artemis

@Override
public synchronized void start() throws Exception {
 if (started) {
   return;
 }
 endpoint.openClient();
 started = true;
 thread = new Thread(new DiscoveryRunnable(), "activemq-discovery-group-thread-" + name);
 thread.setDaemon(true);
 thread.start();
 if (notificationService != null) {
   TypedProperties props = new TypedProperties();
   props.putSimpleStringProperty(new SimpleString("name"), new SimpleString(name));
   Notification notification = new Notification(nodeID, CoreNotificationType.DISCOVERY_GROUP_STARTED, props);
   notificationService.sendNotification(notification);
 }
}

代码示例来源:origin: org.apache.activemq/artemis-jms-client-all

@Override
public synchronized void start() throws Exception {
 if (started) {
   return;
 }
 endpoint.openClient();
 started = true;
 thread = new Thread(new DiscoveryRunnable(), "activemq-discovery-group-thread-" + name);
 thread.setDaemon(true);
 thread.start();
 if (notificationService != null) {
   TypedProperties props = new TypedProperties();
   props.putSimpleStringProperty(new SimpleString("name"), new SimpleString(name));
   Notification notification = new Notification(nodeID, CoreNotificationType.DISCOVERY_GROUP_STARTED, props);
   notificationService.sendNotification(notification);
 }
}

代码示例来源:origin: apache/activemq-artemis

@Override
public synchronized void start() throws Exception {
 if (started) {
   return;
 }
 endpoint.openClient();
 started = true;
 thread = new Thread(new DiscoveryRunnable(), "activemq-discovery-group-thread-" + name);
 thread.setDaemon(true);
 thread.start();
 if (notificationService != null) {
   TypedProperties props = new TypedProperties();
   props.putSimpleStringProperty(new SimpleString("name"), new SimpleString(name));
   Notification notification = new Notification(nodeID, CoreNotificationType.DISCOVERY_GROUP_STARTED, props);
   notificationService.sendNotification(notification);
 }
}

代码示例来源:origin: org.apache.activemq/artemis-core-client

@Override
public synchronized void start() throws Exception {
 if (started) {
   return;
 }
 endpoint.openClient();
 started = true;
 thread = new Thread(new DiscoveryRunnable(), "activemq-discovery-group-thread-" + name);
 thread.setDaemon(true);
 thread.start();
 if (notificationService != null) {
   TypedProperties props = new TypedProperties();
   props.putSimpleStringProperty(new SimpleString("name"), new SimpleString(name));
   Notification notification = new Notification(nodeID, CoreNotificationType.DISCOVERY_GROUP_STARTED, props);
   notificationService.sendNotification(notification);
 }
}

代码示例来源:origin: apache/activemq-artemis

private void sendAddressNotification(AddressInfo addressInfo, final CoreNotificationType type) {
 final ManagementService managementService = getManagementService();
 if (managementService != null && sendAddressNotifications) {
   try {
    final TypedProperties props = new TypedProperties();
    props.putSimpleStringProperty(ManagementHelper.HDR_ADDRESS, addressInfo.getName());
    props.putByteProperty(ManagementHelper.HDR_ROUTING_TYPE, addressInfo.getRoutingType().getType());
    managementService.sendNotification(new Notification(null, type, props));
   } catch (Exception e) {
    logger.warn("Error sending notification: " + type, e.getMessage(), e);
   }
 }
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

@Override
public synchronized void start() throws Exception {
 if (started) {
   return;
 }
 endpoint.openClient();
 started = true;
 thread = new Thread(new DiscoveryRunnable(), "activemq-discovery-group-thread-" + name);
 thread.setDaemon(true);
 thread.start();
 if (notificationService != null) {
   TypedProperties props = new TypedProperties();
   props.putSimpleStringProperty(new SimpleString("name"), new SimpleString(name));
   Notification notification = new Notification(nodeID, CoreNotificationType.DISCOVERY_GROUP_STARTED, props);
   notificationService.sendNotification(notification);
 }
}

代码示例来源:origin: apache/activemq-artemis

@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);
   }
 }
}

代码示例来源:origin: apache/activemq-artemis

private Notification createProposalNotification(SimpleString groupId, SimpleString clusterName) {
 TypedProperties props = new TypedProperties();
 props.putSimpleStringProperty(ManagementHelper.HDR_PROPOSAL_GROUP_ID, groupId);
 props.putSimpleStringProperty(ManagementHelper.HDR_PROPOSAL_VALUE, clusterName);
 props.putIntProperty(ManagementHelper.HDR_BINDING_TYPE, BindingType.LOCAL_QUEUE_INDEX);
 props.putSimpleStringProperty(ManagementHelper.HDR_ADDRESS, address);
 props.putIntProperty(ManagementHelper.HDR_DISTANCE, 0);
 return new Notification(null, CoreNotificationType.PROPOSAL, props);
}

代码示例来源:origin: apache/activemq-artemis

private void sendSessionNotification(final ServerSession session, final CoreNotificationType type) {
 final ManagementService managementService = getManagementService();
 if (managementService != null && sendSessionNotifications) {
   try {
    final TypedProperties props = new TypedProperties();
    props.putSimpleStringProperty(ManagementHelper.HDR_CONNECTION_NAME, SimpleString.toSimpleString(session.getConnectionID().toString()));
    props.putSimpleStringProperty(ManagementHelper.HDR_USER, SimpleString.toSimpleString(session.getUsername()));
    props.putSimpleStringProperty(ManagementHelper.HDR_SESSION_NAME, SimpleString.toSimpleString(session.getName()));
    managementService.sendNotification(new Notification(null, type, props));
   } catch (Exception e) {
    logger.warn("Error sending notification: " + type, e.getMessage(), e);
   }
 }
}

代码示例来源:origin: apache/activemq-artemis

@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;
}

代码示例来源:origin: apache/activemq-artemis

@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);
 }
}

代码示例来源:origin: apache/activemq-artemis

private void sendNotification(JMSNotificationType type, String message) {
 TypedProperties prop = new TypedProperties();
 prop.putSimpleStringProperty(JMSNotificationType.MESSAGE, SimpleString.toSimpleString(message));
 Notification notif = new Notification(null, type, prop);
 try {
   server.getManagementService().sendNotification(notif);
 } catch (Exception e) {
   ActiveMQJMSServerLogger.LOGGER.failedToSendNotification(notif.toString());
 }
}

代码示例来源:origin: apache/activemq-artemis

protected void sendUnproposal(SimpleString groupid, SimpleString clusterName, int distance) {
 TypedProperties props = new TypedProperties();
 props.putSimpleStringProperty(ManagementHelper.HDR_PROPOSAL_GROUP_ID, groupid);
 props.putSimpleStringProperty(ManagementHelper.HDR_PROPOSAL_VALUE, clusterName);
 props.putIntProperty(ManagementHelper.HDR_BINDING_TYPE, BindingType.LOCAL_QUEUE_INDEX);
 props.putSimpleStringProperty(ManagementHelper.HDR_ADDRESS, address);
 props.putIntProperty(ManagementHelper.HDR_DISTANCE, distance);
 Notification notification = new Notification(null, CoreNotificationType.UNPROPOSAL, props);
 try {
   managementService.sendNotification(notification);
 } catch (Exception e) {
   ActiveMQServerLogger.LOGGER.errorHandlingMessage(e);
 }
}

代码示例来源:origin: apache/activemq-artemis

@Override
public Response receive(final Proposal proposal, final int distance) throws Exception {
 TypedProperties props = new TypedProperties();
 props.putSimpleStringProperty(ManagementHelper.HDR_PROPOSAL_GROUP_ID, proposal.getGroupId());
 props.putSimpleStringProperty(ManagementHelper.HDR_PROPOSAL_VALUE, proposal.getClusterName());
 props.putIntProperty(ManagementHelper.HDR_BINDING_TYPE, BindingType.LOCAL_QUEUE_INDEX);
 props.putSimpleStringProperty(ManagementHelper.HDR_ADDRESS, address);
 props.putIntProperty(ManagementHelper.HDR_DISTANCE, distance);
 Notification notification = new Notification(null, CoreNotificationType.PROPOSAL, props);
 managementService.sendNotification(notification);
 return null;
}

代码示例来源:origin: apache/activemq-artemis

@Override
public synchronized void start() throws Exception {
 if (started) {
   return;
 }
 endpoint.openBroadcaster();
 started = true;
 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_STARTED, props);
   notificationService.sendNotification(notification);
 }
 activate();
}

代码示例来源:origin: apache/activemq-artemis

@Override
public void sendProposalResponse(final Response response, final int distance) throws Exception {
 TypedProperties props = new TypedProperties();
 props.putSimpleStringProperty(ManagementHelper.HDR_PROPOSAL_GROUP_ID, response.getGroupId());
 props.putSimpleStringProperty(ManagementHelper.HDR_PROPOSAL_VALUE, response.getClusterName());
 props.putSimpleStringProperty(ManagementHelper.HDR_PROPOSAL_ALT_VALUE, response.getAlternativeClusterName());
 props.putIntProperty(ManagementHelper.HDR_BINDING_TYPE, BindingType.LOCAL_QUEUE_INDEX);
 props.putSimpleStringProperty(ManagementHelper.HDR_ADDRESS, address);
 props.putIntProperty(ManagementHelper.HDR_DISTANCE, distance);
 Notification notification = new Notification(null, CoreNotificationType.PROPOSAL_RESPONSE, props);
 managementService.sendNotification(notification);
}

相关文章

微信公众号

最新文章

更多