Commit 4501ea62 authored by Andre Freyssinet's avatar Andre Freyssinet
Browse files

Adds an INFO message in log with Joram version.

Adds a JMX attribute.
parent 4eb76a89
/*
* 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
......@@ -92,6 +92,10 @@ public class LocalConnections implements LocalConnectionsMBean {
return MBEAN_NAME;
}
public String getVersion() {
return ConnectionManager.version;
}
public int getFailedLoginCount() {
return failedLoginCount;
}
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2004 - 2018 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
......@@ -37,7 +37,6 @@ import org.objectweb.joram.mom.notifications.ClientMessages;
import org.objectweb.joram.mom.notifications.GetProxyIdNot;
import org.objectweb.joram.mom.notifications.TopicForwardNot;
import org.objectweb.joram.mom.util.JoramHelper;
import org.objectweb.joram.mom.util.MessageIdListFactory;
import org.objectweb.joram.mom.util.MessageIdListImpl;
import org.objectweb.joram.shared.admin.AdminCommandConstant;
import org.objectweb.joram.shared.client.AbstractJmsRequest;
......@@ -49,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;
......@@ -301,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
......@@ -337,8 +343,8 @@ public class ConnectionManager implements ConnectionManagerMBean {
if (st.hasMoreTokens()) {
initialAdminPass = st.nextToken();
}
logger.log(BasicLevel.INFO,
"ConnectionManager.init admin=(" + initialAdminName + ',' + initialAdminPass + ')');
logger.log(BasicLevel.DEBUG,
"ConnectionManager.init admin=(" + initialAdminName + ", ****)");
}
if (firstTime) {
......@@ -354,7 +360,7 @@ public class ConnectionManager implements ConnectionManagerMBean {
Identity.getRootIdentityClass(initialAdminName));
AdminNotification adminNot = new AdminNotification(userAgent.getId(), identity);
logger.log(BasicLevel.INFO,
logger.log(BasicLevel.DEBUG,
"ConnectionManager.init send adminNot to " + adminTopic.getId());
Channel.sendTo(adminTopic.getId(), adminNot);
}
......@@ -366,12 +372,15 @@ public class ConnectionManager implements ConnectionManagerMBean {
Identity.getRootIdentityClass(initialAdminName));
AdminNotification adminNot = new AdminNotification(null, identity);
AgentId adminId = new AgentId(AgentServer.getServerId(), AgentServer.getServerId(), AgentId.JoramAdminStamp);
logger.log(BasicLevel.INFO,
logger.log(BasicLevel.DEBUG,
"ConnectionManager.init send adminNot to " + adminId);
Channel.sendTo(adminId, adminNot);
}
}
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
......@@ -169,6 +169,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
* to the specified port.
......
Supports Markdown
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