use of org.apache.activemq.artemis.utils.collections.TypedProperties in project activemq-artemis by apache.
the class InVMAcceptor method stop.
@Override
public synchronized void stop() {
if (!started) {
return;
}
if (!paused) {
InVMRegistry.instance.unregisterAcceptor(id);
}
for (Connection connection : connections.values()) {
listener.connectionDestroyed(connection.getID());
}
connections.clear();
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_STOPPED, props);
try {
notificationService.sendNotification(notification);
} catch (Exception e) {
ActiveMQServerLogger.LOGGER.failedToSendNotification(e);
}
}
started = false;
paused = false;
}
use of org.apache.activemq.artemis.utils.collections.TypedProperties in project activemq-artemis by apache.
the class OpenWireMessageConverter method writeMapType.
private static void writeMapType(final ByteSequence contents, final boolean messageCompressed, final ActiveMQBuffer body) throws IOException {
InputStream mis = new ByteArrayInputStream(contents);
if (messageCompressed) {
mis = new InflaterInputStream(mis);
}
DataInputStream mdataIn = new DataInputStream(mis);
Map<String, Object> map = MarshallingSupport.unmarshalPrimitiveMap(mdataIn);
mdataIn.close();
TypedProperties props = new TypedProperties();
loadMapIntoProperties(props, map);
props.encode(body.byteBuf());
}
use of org.apache.activemq.artemis.utils.collections.TypedProperties in project activemq-artemis by apache.
the class AMQPMessagePersisterV2 method getEncodeSize.
@Override
public int getEncodeSize(Message record) {
int encodeSize = super.getEncodeSize(record) + DataConstants.SIZE_INT;
TypedProperties properties = ((AMQPMessage) record).getExtraProperties();
return encodeSize + (properties != null ? properties.getEncodeSize() : 0);
}
use of org.apache.activemq.artemis.utils.collections.TypedProperties in project activemq-artemis by apache.
the class JMSServerManagerImpl method sendNotification.
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());
}
}
use of org.apache.activemq.artemis.utils.collections.TypedProperties in project activemq-artemis by apache.
the class GroupHandlingAbstract method sendUnproposal.
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);
}
}
Aggregations