Commit b00d7324 authored by Andre Freyssinet's avatar Andre Freyssinet

Adds an INFO message in log with Joram version (+ JMX attribute).

parent 8494f22a
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2009 ScalAgent Distributed Technologies
* Copyright (C) 2009 - 2021 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -91,6 +91,10 @@ public class LocalConnections implements LocalConnectionsMBean {
public String getMBeanName() {
return MBEAN_NAME;
}
public String getVersion() {
return ConnectionManager.version;
}
public int getFailedLoginCount() {
return failedLoginCount;
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2004 - 2020 ScalAgent Distributed Technologies
* Copyright (C) 2004 - 2021 ScalAgent Distributed Technologies
* Copyright (C) 2004 France-Telecom R&D
*
* This library is free software; you can redistribute it and/or
......@@ -48,6 +48,7 @@ import org.objectweb.joram.shared.client.ServerReply;
import org.objectweb.joram.shared.excepts.DestinationException;
import org.objectweb.joram.shared.excepts.MomException;
import org.objectweb.joram.shared.security.Identity;
import org.objectweb.joram.shared.stream.MetaData;
import org.objectweb.util.monolog.api.BasicLevel;
import org.objectweb.util.monolog.api.Logger;
......@@ -300,6 +301,12 @@ public class ConnectionManager implements ConnectionManagerMBean {
*/
public static int inFlow = -1;
public final static String version = "" + MetaData.major + '.' + MetaData.minor + '.' + MetaData.build;
public String getVersion() {
return version;
}
/**
* Initializes the connection manager as a service.
* Creates and deploys the administration topic, the connection manager
......@@ -375,6 +382,9 @@ public class ConnectionManager implements ConnectionManagerMBean {
}
}
logger.log(BasicLevel.INFO,
"Joram/JMS " + version + " ConnectionManager initialized.");
try {
MXWrapper.registerMBean(getCurrentInstance(), "Joram#" + AgentServer.getServerId(), MBEAN_NAME);
} catch (Exception e) {
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2009 ScalAgent Distributed Technologies
* Copyright (C) 2009 - 2021 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -25,6 +25,10 @@ package org.objectweb.joram.mom.proxies;
* Adds JMX monitoring for a connection manager.
*/
public interface ConnectionManagerMBean {
/**
* Gets the name of the MBean.
*/
public String getVersion();
/**
* Closes all opened connections.
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2001 - 2020 ScalAgent Distributed Technologies
* Copyright (C) 2001 - 2021 ScalAgent Distributed Technologies
* Copyright (C) 1996 - 2000 Dyade
*
* This library is free software; you can redistribute it and/or
......@@ -168,6 +168,10 @@ public class TcpProxyService implements TcpProxyServiceMBean {
return serverSocket;
}
public String getVersion() {
return ConnectionManager.version;
}
/**
* Initializes the TCP entry point by creating a server socket listening
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment