Commit 35ca6c14 authored by Andre Freyssinet's avatar Andre Freyssinet

JORAM-331: Adds methods to detect engine freeze.

parent af56e478
/*
* Copyright (C) 2013 ScalAgent Distributed Technologies
* Copyright (C) 2013 - 2019 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
......@@ -155,6 +155,20 @@ public interface AgentEngine extends MessageConsumer {
*/
int getNbWaitingMessages();
/**
* Returns the number of agent's reaction since last boot.
*
* @return the number of agent's reaction since last boot
*/
public long getNbReactions();
/**
* Returns the unique id. of the running agent if any, null otherwise.
*
* @return the unique id. of the running agent if any, null otherwise.
*/
public String getRunningAgent();
/**
* Returns a string representation of the specified agent. If the agent
* is not present it is loaded in memory, be careful it is not initialized
......
/*
* Copyright (C) 2001 - 2015 ScalAgent Distributed Technologies
* Copyright (C) 2001 - 2019 ScalAgent Distributed Technologies
* Copyright (C) 1996 - 2000 BULL
* Copyright (C) 1996 - 2000 INRIA
*
......@@ -214,6 +214,19 @@ class Engine implements Runnable, AgentEngine, EngineMBean {
*/
Agent agent = null;
/**
* Returns the unique id. of the running agent if any, null otherwise.
*
* @return the unique id. of the running agent if any, null otherwise.
*/
public String getRunningAgent() {
// Gets a copy of reference to avoid NPE
Agent ag = agent;
if (ag != null)
return ag.getAgentId();
return null;
}
/**
* The message in progress.
*/
......
/*
* Copyright (C) 2001 - 2013 ScalAgent Distributed Technologies
* Copyright (C) 2001 - 2019 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
......@@ -58,10 +58,17 @@ public interface EngineMBean {
/**
* Gets the number of messages posted to this engine since creation.
*
* return the number of messages.
* @return the number of messages.
*/
public int getNbMessages();
/**
* Returns the unique id. of the running agent if any, null otherwise.
*
* @return the unique id. of the running agent if any, null otherwise.
*/
public String getRunningAgent();
/**
* Gets the number of waiting messages in this engine.
*
......
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