Skip to content
Snippets Groups Projects
Commit ebdad6be authored by Gwenaelle ABEILLE's avatar Gwenaelle ABEILLE
Browse files

release

parent de3010ce
No related branches found
No related tags found
No related merge requests found
Showing
with 114 additions and 134 deletions
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
<classpath> <classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/> <classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" including="**/*.java" kind="src" output="target/classes" path="src/main/resources"/> <classpathentry excluding="**" including="**/*.java" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/> <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/> <classpathentry kind="output" path="target/classes"/>
......
...@@ -27,11 +27,4 @@ ...@@ -27,11 +27,4 @@
<nature>org.devzuz.q.maven.jdt.core.mavenNature</nature> <nature>org.devzuz.q.maven.jdt.core.mavenNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature> <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures> </natures>
<linkedResources>
<link>
<name>ArchivingConf</name>
<type>2</type>
<location>C:/SOLEIL_ROOT/tango-soleil-win32-5.5.8RC3/tango/bin/ArchivingConf</location>
</link>
</linkedResources>
</projectDescription> </projectDescription>
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<artifactId>hdbtdbArchivingServers</artifactId> <artifactId>hdbtdbArchivingServers</artifactId>
<name>hdbtdbArchivingServers</name> <name>hdbtdbArchivingServers</name>
<version>2.2.15</version> <version>2.2.19</version>
<scm> <scm>
<connection>${scm.connection.svn.tango-cs}:archiving/server/hdbtdbArchivingServers</connection> <connection>${scm.connection.svn.tango-cs}:archiving/server/hdbtdbArchivingServers</connection>
...@@ -42,6 +42,10 @@ ...@@ -42,6 +42,10 @@
<groupId>org.tango</groupId> <groupId>org.tango</groupId>
<artifactId>TangORB-javadao</artifactId> <artifactId>TangORB-javadao</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.tango</groupId>
<artifactId>JTangoCommons</artifactId>
</dependency>
<dependency> <dependency>
<groupId>fr.esrf.atk</groupId> <groupId>fr.esrf.atk</groupId>
<artifactId>ATKCore</artifactId> <artifactId>ATKCore</artifactId>
......
...@@ -11,7 +11,7 @@ public abstract class ArchiverCollector { ...@@ -11,7 +11,7 @@ public abstract class ArchiverCollector {
// This hashtable contains the mode counters by attribute // This hashtable contains the mode counters by attribute
private final Map<String, ModesCounters> attributeModeCounterMap = new HashMap<String, ModesCounters>(); private final Map<String, ModesCounters> attributeModeCounterMap = new HashMap<String, ModesCounters>();
// Diary file // Diary file
protected ILogger m_logger; protected ILogger logger;
/** /**
* An ModeHandler is associated to each Collector to handle the archiving * An ModeHandler is associated to each Collector to handle the archiving
...@@ -24,14 +24,14 @@ public abstract class ArchiverCollector { ...@@ -24,14 +24,14 @@ public abstract class ArchiverCollector {
} }
public void setDiaryLogger(ILogger _logger) { public void setDiaryLogger(ILogger _logger) {
this.m_logger = _logger; this.logger = _logger;
} }
/* Allows to indicate to the collector that a new attribute must be managed */ /* Allows to indicate to the collector that a new attribute must be managed */
protected synchronized void addAttribute(String name) { protected synchronized void addAttribute(String name) {
String lower = name.toLowerCase(); String lower = name.toLowerCase();
if (attributeModeCounterMap.containsKey(lower)) { if (attributeModeCounterMap.containsKey(lower)) {
m_logger.trace(ILogger.LEVEL_WARNING, "ArchiverCollector.addAttribute : The attribute " + name logger.trace(ILogger.LEVEL_WARNING, "ArchiverCollector.addAttribute : The attribute " + name
+ "already exists in the map ==> Counter Re-init"); + "already exists in the map ==> Counter Re-init");
attributeModeCounterMap.get(lower).init(); attributeModeCounterMap.get(lower).init();
} else { } else {
...@@ -71,7 +71,7 @@ public abstract class ArchiverCollector { ...@@ -71,7 +71,7 @@ public abstract class ArchiverCollector {
doArchive = m_modeHandler.isDataArchivable(mc, dataType, readValueObject, lastValueObject); doArchive = m_modeHandler.isDataArchivable(mc, dataType, readValueObject, lastValueObject);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
this.m_logger.trace(ILogger.LEVEL_ERROR, this.getClass().getSimpleName() + "/doArchiveEvent/catch " + e this.logger.trace(ILogger.LEVEL_ERROR, this.getClass().getSimpleName() + "/doArchiveEvent/catch " + e
+ " with the value of " + attCompleteName); + " with the value of " + attCompleteName);
} }
......
...@@ -356,26 +356,13 @@ public class DbProxy implements IDbProxy { ...@@ -356,26 +356,13 @@ public class DbProxy implements IDbProxy {
} }
public Vector<AttributeLightMode> getArchiverCurrentTasks(final String archiverName) throws ArchivingException { public Vector<AttributeLightMode> getArchiverCurrentTasks(final String archiverName) throws ArchivingException {
Util.out4.println("DbProxy.getArchiverCurrentTasks");
// Vector<AttributeLightMode> archiverCurrentTasks = new
// Vector<AttributeLightMode>();
final boolean facility = manager.isM_Facility(); final boolean facility = manager.isM_Facility();
try { try {
final Vector<AttributeLightMode> archiverCurrentTasks = manager final Vector<AttributeLightMode> archiverCurrentTasks = manager
.getDataBase() .getDataBase()
.getMode() .getMode()
.getArchiverCurrentTasks( .getArchiverCurrentTasks(
(facility ? "//" + new Database().get_tango_host() + "/" : "") + archiverName); (facility ? "//" + new Database().get_tango_host() + "/" : "") + archiverName);
// System.out.println("Current Tasks - " +
// archiverCurrentTasks.size() + ": ");
// for (int i = 0; i < archiverCurrentTasks.size(); i++) {
// final AttributeLightMode attributeLightMode =
// archiverCurrentTasks.elementAt(i);
// System.out.println("******************* " + (i + 1)
// + " *******************");
// System.out.println(attributeLightMode);
// }
return archiverCurrentTasks; return archiverCurrentTasks;
} catch (final DevFailed devFailed) { } catch (final DevFailed devFailed) {
final String message = GlobalConst.ARCHIVING_ERROR_PREFIX + " : " + GlobalConst.DBT_UNREACH_EXCEPTION; final String message = GlobalConst.ARCHIVING_ERROR_PREFIX + " : " + GlobalConst.DBT_UNREACH_EXCEPTION;
......
...@@ -126,6 +126,7 @@ import java.util.Enumeration; ...@@ -126,6 +126,7 @@ import java.util.Enumeration;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import Common.Archiver.Collector.ArchiverCollector; import Common.Archiver.Collector.ArchiverCollector;
import HdbArchiver.HdbArchiver; import HdbArchiver.HdbArchiver;
...@@ -151,7 +152,7 @@ public abstract class HdbCollector extends ArchiverCollector { ...@@ -151,7 +152,7 @@ public abstract class HdbCollector extends ArchiverCollector {
*/ */
protected boolean refreshing; protected boolean refreshing;
protected boolean isFirstValue; protected volatile Map<String, Boolean> isFirstValueList = new ConcurrentHashMap<String, Boolean>();
/** /**
* This parameter specify the number of time a Collector retry the archiving * This parameter specify the number of time a Collector retry the archiving
...@@ -182,7 +183,6 @@ public abstract class HdbCollector extends ArchiverCollector { ...@@ -182,7 +183,6 @@ public abstract class HdbCollector extends ArchiverCollector {
public HdbCollector(final HdbModeHandler _modeHandler) { public HdbCollector(final HdbModeHandler _modeHandler) {
super(_modeHandler); super(_modeHandler);
isFirstValue = true;
} }
/** /**
...@@ -211,7 +211,7 @@ public abstract class HdbCollector extends ArchiverCollector { ...@@ -211,7 +211,7 @@ public abstract class HdbCollector extends ArchiverCollector {
*/ */
public void addSource(final AttributeLightMode attributeLightMode) throws ArchivingException { public void addSource(final AttributeLightMode attributeLightMode) throws ArchivingException {
isFirstValue = true; isFirstValueList.put(attributeLightMode.getAttribute_complete_name().toLowerCase(), true);
if (HdbArchiver.isUseEvents) { if (HdbArchiver.isUseEvents) {
addSourceForEvents(attributeLightMode); addSourceForEvents(attributeLightMode);
} else { } else {
...@@ -236,16 +236,19 @@ public abstract class HdbCollector extends ArchiverCollector { ...@@ -236,16 +236,19 @@ public abstract class HdbCollector extends ArchiverCollector {
/** /**
* Triggers the collecting action of this HdbCollector. * Triggers the collecting action of this HdbCollector.
*/ */
public synchronized void startCollecting() { protected synchronized void startCollecting() {
if (!attributeList.isEmpty()) { if (!attributeList.isEmpty()) {
if (attributeList.size() == 1) { if (!attributeList.isRefresherStarted()) {
attributeList.setRefreshInterval(m_modeHandler.getRefreshInterval()); attributeList.setRefreshInterval(m_modeHandler.getRefreshInterval());
attributeList.setSynchronizedPeriod(true); attributeList.setSynchronizedPeriod(true);
attributeList.startRefresher(); attributeList.startRefresher();
refreshing = true; refreshing = true;
logger.trace(ILogger.LEVEL_DEBUG, this.getClass() + " start refresh for " + attributeList.getSize()
+ " attributes");
} else { } else {
// force a refresh for newly added attributes // force a refresh for newly added attributes
attributeList.refresh(); attributeList.refresh();
logger.trace(ILogger.LEVEL_DEBUG, "FORCING refresh for " + this.getClass());
} }
} }
} }
...@@ -253,14 +256,12 @@ public abstract class HdbCollector extends ArchiverCollector { ...@@ -253,14 +256,12 @@ public abstract class HdbCollector extends ArchiverCollector {
/** /**
* Stops the collecting action of this HdbCollector. * Stops the collecting action of this HdbCollector.
*/ */
public synchronized void stopCollecting() { protected synchronized void stopCollecting() {
Util.out4.println("HdbCollector.stopCollecting");
m_logger.trace(ILogger.LEVEL_INFO, "HdbCollector.stopCollecting");
try { try {
if (attributeList.isEmpty()) { logger.trace(ILogger.LEVEL_DEBUG, this.getClass() + " stop refresh on " + attributeList.getSize()
+ " attributes");
attributeList.stopRefresher(); attributeList.stopRefresher();
refreshing = false; refreshing = false;
}
} catch (final Exception e) { } catch (final Exception e) {
Util.out2.println("ERROR !! " + "\r\n" + "\t Origin : \t " + "HdbCollector.stopCollecting" + "\r\n" Util.out2.println("ERROR !! " + "\r\n" + "\t Origin : \t " + "HdbCollector.stopCollecting" + "\r\n"
+ "\t Reason : \t " + "UNKNOWN_ERROR" + "\r\n" + "\t Description : \t " + e.getMessage() + "\r\n" + "\t Reason : \t " + "UNKNOWN_ERROR" + "\r\n" + "\t Description : \t " + e.getMessage() + "\r\n"
...@@ -325,7 +326,7 @@ public abstract class HdbCollector extends ArchiverCollector { ...@@ -325,7 +326,7 @@ public abstract class HdbCollector extends ArchiverCollector {
final long newTime = archivingEvent.getTimeStamp(); final long newTime = archivingEvent.getTimeStamp();
if (newTime == 0) { if (newTime == 0) {
m_logger.trace(ILogger.LEVEL_WARNING, "NOARCHIVING - received a zero timestamp for " + name logger.trace(ILogger.LEVEL_WARNING, "NOARCHIVING - received a zero timestamp for " + name
+ " - tableName: " + archivingEvent.getTable_name()); + " - tableName: " + archivingEvent.getTable_name());
return false; return false;
} }
...@@ -335,10 +336,10 @@ public abstract class HdbCollector extends ArchiverCollector { ...@@ -335,10 +336,10 @@ public abstract class HdbCollector extends ArchiverCollector {
return true; return true;
} }
final boolean isAlreadyRegisteredDate = lastTimestampStack.containsDate(newTime, m_logger); final boolean isAlreadyRegisteredDate = lastTimestampStack.containsDate(newTime, logger);
final boolean isValidDate = lastTimestampStack.validateDate(newTime, m_logger); final boolean isValidDate = lastTimestampStack.validateDate(newTime, logger);
if (isAlreadyRegisteredDate || !isValidDate) { if (isAlreadyRegisteredDate || !isValidDate) {
m_logger.trace(ILogger.LEVEL_DEBUG, "NOARCHIVING - AlreadyRegisteredDate - attribute: " + name logger.trace(ILogger.LEVEL_DEBUG, "NOARCHIVING - AlreadyRegisteredDate - attribute: " + name
+ " - timestamp: " + new Timestamp(newTime)); + " - timestamp: " + new Timestamp(newTime));
return false; return false;
} }
...@@ -368,7 +369,7 @@ public abstract class HdbCollector extends ArchiverCollector { ...@@ -368,7 +369,7 @@ public abstract class HdbCollector extends ArchiverCollector {
return ret; return ret;
} }
public List<String> getAttributeList() { public synchronized List<String> getAttributeList() {
final List<String> attributeListResult = new ArrayList<String>(); final List<String> attributeListResult = new ArrayList<String>();
final Enumeration<?> myAttList = attributeList.elements(); final Enumeration<?> myAttList = attributeList.elements();
while (myAttList.hasMoreElements()) { while (myAttList.hasMoreElements()) {
......
...@@ -203,8 +203,8 @@ public class Image_RO extends HdbCollector implements IImageListener { ...@@ -203,8 +203,8 @@ public class Image_RO extends HdbCollector implements IImageListener {
super.setLastTimestamp(snapImageEvent_RO); super.setLastTimestamp(snapImageEvent_RO);
} catch (final Exception e) { } catch (final Exception e) {
final String message = "Problem (ArchivingException) storing Image_RO value"; final String message = "Problem (ArchivingException) storing Image_RO value";
super.m_logger.trace(ILogger.LEVEL_ERROR, message); super.logger.trace(ILogger.LEVEL_ERROR, message);
super.m_logger.trace(ILogger.LEVEL_ERROR, e); super.logger.trace(ILogger.LEVEL_ERROR, e);
try_number--; try_number--;
if (try_number > 0) { if (try_number > 0) {
......
...@@ -130,7 +130,7 @@ public abstract class BooleanScalar extends HdbCollector implements IBooleanScal ...@@ -130,7 +130,7 @@ public abstract class BooleanScalar extends HdbCollector implements IBooleanScal
evtAdaptHMap = new HashMap<Device, TangoEventsAdapter>(); evtAdaptHMap = new HashMap<Device, TangoEventsAdapter>();
} }
/* synchronized */@Override @Override
public synchronized void removeSource(final String attributeName) throws ArchivingException { public synchronized void removeSource(final String attributeName) throws ArchivingException {
Util.out2.println("BooleanScalar.removeSource"); Util.out2.println("BooleanScalar.removeSource");
...@@ -143,20 +143,18 @@ public abstract class BooleanScalar extends HdbCollector implements IBooleanScal ...@@ -143,20 +143,18 @@ public abstract class BooleanScalar extends HdbCollector implements IBooleanScal
* while ( ( IBooleanScalar ) attributeList.get(attributeName) != * while ( ( IBooleanScalar ) attributeList.get(attributeName) !=
* null ) { * null ) {
*/ */
stopCollecting();
final IBooleanScalar attribute = (IBooleanScalar) attributeList.get(attributeName); final IBooleanScalar attribute = (IBooleanScalar) attributeList.get(attributeName);
if (attribute != null) { if (attribute != null) {
attribute.removeBooleanScalarListener(this); attribute.removeBooleanScalarListener(this);
attribute.removeErrorListener(this); attribute.removeErrorListener(this);
attributeList.remove(attributeName); attributeList.remove(attributeName);
isFirstValueList.remove(attributeName.toLowerCase());
// informs the mother class that one new attribute must be // informs the mother class that one new attribute must be
// removed // removed
removeAttribute(attributeName); removeAttribute(attributeName);
removeTimestamps(attributeName); removeTimestamps(attributeName);
Util.out4.println("\t The attribute named " + attributeName + " was fired from the Collector list..."); Util.out4.println("\t The attribute named " + attributeName + " was fired from the Collector list...");
if (attributeList.isEmpty()) {
stopCollecting();
}
} }
} catch (final Exception e) { } catch (final Exception e) {
final String message = GlobalConst.ARCHIVING_ERROR_PREFIX + " : " + "Failed removing '" + attributeName final String message = GlobalConst.ARCHIVING_ERROR_PREFIX + " : " + "Failed removing '" + attributeName
...@@ -165,6 +163,8 @@ public abstract class BooleanScalar extends HdbCollector implements IBooleanScal ...@@ -165,6 +163,8 @@ public abstract class BooleanScalar extends HdbCollector implements IBooleanScal
final String desc = "Failed while executing " + this.getClass().getSimpleName() final String desc = "Failed while executing " + this.getClass().getSimpleName()
+ ".removeSource() method..."; + ".removeSource() method...";
throw new ArchivingException(message, reason, ErrSeverity.WARN, desc, "", e); throw new ArchivingException(message, reason, ErrSeverity.WARN, desc, "", e);
} finally {
startCollecting();
} }
} }
...@@ -175,6 +175,7 @@ public abstract class BooleanScalar extends HdbCollector implements IBooleanScal ...@@ -175,6 +175,7 @@ public abstract class BooleanScalar extends HdbCollector implements IBooleanScal
final String attName = attributeLightMode.getAttribute_complete_name(); final String attName = attributeLightMode.getAttribute_complete_name();
if (attName != null) { if (attName != null) {
stopCollecting();
final IBooleanScalar attribute = (IBooleanScalar) attributeList.add(attName); final IBooleanScalar attribute = (IBooleanScalar) attributeList.add(attName);
attribute.addBooleanScalarListener(this); attribute.addBooleanScalarListener(this);
attribute.addErrorListener(this); attribute.addErrorListener(this);
...@@ -183,12 +184,8 @@ public abstract class BooleanScalar extends HdbCollector implements IBooleanScal ...@@ -183,12 +184,8 @@ public abstract class BooleanScalar extends HdbCollector implements IBooleanScal
// informs the mother class that one new attribute must be // informs the mother class that one new attribute must be
// managed // managed
addAttribute(attName); addAttribute(attName);
m_logger.trace(ILogger.LEVEL_INFO, "add archiving for " + attName); logger.trace(ILogger.LEVEL_INFO, "add archiving for " + attName);
startCollecting();
} else {
m_logger.trace(ILogger.LEVEL_ERROR, "archiving not started because attribute name is null "
+ attributeLightMode);
} }
} catch (final ConnectionException e) { } catch (final ConnectionException e) {
final String message = GlobalConst.ARCHIVING_ERROR_PREFIX + " : " + "Failed adding '" final String message = GlobalConst.ARCHIVING_ERROR_PREFIX + " : " + "Failed adding '"
...@@ -203,6 +200,8 @@ public abstract class BooleanScalar extends HdbCollector implements IBooleanScal ...@@ -203,6 +200,8 @@ public abstract class BooleanScalar extends HdbCollector implements IBooleanScal
final String reason = GlobalConst.TANGO_COMM_EXCEPTION; final String reason = GlobalConst.TANGO_COMM_EXCEPTION;
final String desc = "Failed while executing " + this.getClass().getSimpleName() + ".addSource() method..."; final String desc = "Failed while executing " + this.getClass().getSimpleName() + ".addSource() method...";
throw new ArchivingException(message, reason, ErrSeverity.WARN, desc, "", e); throw new ArchivingException(message, reason, ErrSeverity.WARN, desc, "", e);
} finally {
startCollecting();
} }
} }
...@@ -361,14 +360,14 @@ public abstract class BooleanScalar extends HdbCollector implements IBooleanScal ...@@ -361,14 +360,14 @@ public abstract class BooleanScalar extends HdbCollector implements IBooleanScal
String attributeName = scalarEvent.getAttribute_complete_name(); String attributeName = scalarEvent.getAttribute_complete_name();
try { try {
boolean doArchive = false; boolean doArchive = false;
if (isFirstValue) { if (isFirstValueList.get(attributeName.toLowerCase())) {
doArchive = true; doArchive = true;
isFirstValue = false; isFirstValueList.put(attributeName.toLowerCase(), false);
m_logger.trace(ILogger.LEVEL_DEBUG, attributeName + " first value, forcing archiving"); logger.trace(ILogger.LEVEL_DEBUG, attributeName + " first value, forcing archiving");
} else { } else {
final ModesCounters mc = getModeCounter(attributeName); final ModesCounters mc = getModeCounter(attributeName);
if (mc == null) { if (mc == null) {
m_logger.trace(ILogger.LEVEL_ERROR, attributeName + " Attribute Counters unknown"); logger.trace(ILogger.LEVEL_ERROR, attributeName + " Attribute Counters unknown");
} else { } else {
doArchive = doArchiveEvent(mc, scalarEvent.getData_type(), scalarEvent.getReadValue(), doArchive = doArchiveEvent(mc, scalarEvent.getData_type(), scalarEvent.getReadValue(),
getLastValue(scalarEvent), attributeName); getLastValue(scalarEvent), attributeName);
...@@ -382,8 +381,8 @@ public abstract class BooleanScalar extends HdbCollector implements IBooleanScal ...@@ -382,8 +381,8 @@ public abstract class BooleanScalar extends HdbCollector implements IBooleanScal
setLastValue(scalarEvent, scalarEvent.getReadValue()); setLastValue(scalarEvent, scalarEvent.getReadValue());
} catch (final Exception e) { } catch (final Exception e) {
final String message = "Problem storing BooleanScalar value"; final String message = "Problem storing BooleanScalar value";
super.m_logger.trace(ILogger.LEVEL_ERROR, message); super.logger.trace(ILogger.LEVEL_ERROR, message);
super.m_logger.trace(ILogger.LEVEL_ERROR, e); super.logger.trace(ILogger.LEVEL_ERROR, e);
try_number--; try_number--;
if (try_number > 0) { if (try_number > 0) {
...@@ -414,13 +413,13 @@ public abstract class BooleanScalar extends HdbCollector implements IBooleanScal ...@@ -414,13 +413,13 @@ public abstract class BooleanScalar extends HdbCollector implements IBooleanScal
final String errorMess = this.getClass().getSimpleName() + ".errorChange : Unable to read the attribute named " final String errorMess = this.getClass().getSimpleName() + ".errorChange : Unable to read the attribute named "
+ errorEvent.getSource().toString(); + errorEvent.getSource().toString();
Util.out3.println(errorMess); Util.out3.println(errorMess);
m_logger.trace(ILogger.LEVEL_ERROR, errorMess); logger.trace(ILogger.LEVEL_ERROR, errorMess);
try { try {
processEventScalar(getNullValueScalarEvent(errorEvent, TangoConst.Tango_DEV_BOOLEAN, getWritableValue()), processEventScalar(getNullValueScalarEvent(errorEvent, TangoConst.Tango_DEV_BOOLEAN, getWritableValue()),
DEFAULT_TRY_NUMBER); DEFAULT_TRY_NUMBER);
} catch (final Exception e) { } catch (final Exception e) {
super.m_logger.trace(ILogger.LEVEL_ERROR, this.getClass().getSimpleName() super.logger.trace(ILogger.LEVEL_ERROR, this.getClass().getSimpleName()
+ ".errorChange : during processEventScalar creation execp : " + e); + ".errorChange : during processEventScalar creation execp : " + e);
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -139,8 +139,8 @@ public class BooleanScalar_RO extends BooleanScalar { ...@@ -139,8 +139,8 @@ public class BooleanScalar_RO extends BooleanScalar {
processEventScalar(scalarEvent, tryNumber); processEventScalar(scalarEvent, tryNumber);
final String message = "Problem in BooleanScalar_RO/booleanScalarChange"; final String message = "Problem in BooleanScalar_RO/booleanScalarChange";
super.m_logger.trace(ILogger.LEVEL_ERROR, message); super.logger.trace(ILogger.LEVEL_ERROR, message);
super.m_logger.trace(ILogger.LEVEL_ERROR, exE); super.logger.trace(ILogger.LEVEL_ERROR, exE);
} }
} }
......
...@@ -143,8 +143,8 @@ public class BooleanScalar_RW extends BooleanScalar { ...@@ -143,8 +143,8 @@ public class BooleanScalar_RW extends BooleanScalar {
processEventScalar(scalarEvent, tryNumber); processEventScalar(scalarEvent, tryNumber);
final String message = "Problem in BooleanScalar_RW/booleanScalarChange"; final String message = "Problem in BooleanScalar_RW/booleanScalarChange";
super.m_logger.trace(ILogger.LEVEL_ERROR, message); super.logger.trace(ILogger.LEVEL_ERROR, message);
super.m_logger.trace(ILogger.LEVEL_ERROR, exE); super.logger.trace(ILogger.LEVEL_ERROR, exE);
} }
} }
......
...@@ -124,8 +124,8 @@ public class BooleanScalar_WO extends BooleanScalar { ...@@ -124,8 +124,8 @@ public class BooleanScalar_WO extends BooleanScalar {
processEventScalar(scalarEvent, tryNumber); processEventScalar(scalarEvent, tryNumber);
final String message = "Problem in BooleanScalar_WO/booleanScalarChange"; final String message = "Problem in BooleanScalar_WO/booleanScalarChange";
super.m_logger.trace(ILogger.LEVEL_ERROR, message); super.logger.trace(ILogger.LEVEL_ERROR, message);
super.m_logger.trace(ILogger.LEVEL_ERROR, exE); super.logger.trace(ILogger.LEVEL_ERROR, exE);
} }
} }
......
...@@ -176,7 +176,7 @@ public abstract class NumberScalar extends HdbCollector implements INumberScalar ...@@ -176,7 +176,7 @@ public abstract class NumberScalar extends HdbCollector implements INumberScalar
public synchronized void removeSource(final String attributeName) throws ArchivingException { public synchronized void removeSource(final String attributeName) throws ArchivingException {
Util.out2.println("NumberScalar.removeSource"); Util.out2.println("NumberScalar.removeSource");
m_logger.trace(ILogger.LEVEL_INFO, "===> Entering " + this.getClass().getSimpleName() + ".removeSource for " logger.trace(ILogger.LEVEL_INFO, "===> Entering " + this.getClass().getSimpleName() + ".removeSource for "
+ attributeName); + attributeName);
if (HdbArchiver.isUseEvents) { if (HdbArchiver.isUseEvents) {
...@@ -188,20 +188,18 @@ public abstract class NumberScalar extends HdbCollector implements INumberScalar ...@@ -188,20 +188,18 @@ public abstract class NumberScalar extends HdbCollector implements INumberScalar
* while ( ( INumberScalar ) attributeList.get(attributeName) != * while ( ( INumberScalar ) attributeList.get(attributeName) !=
* null ) { * null ) {
*/ */
stopCollecting();
final INumberScalar attribute = (INumberScalar) attributeList.get(attributeName); final INumberScalar attribute = (INumberScalar) attributeList.get(attributeName);
if (attribute != null) { if (attribute != null) {
attribute.removeNumberScalarListener(this); attribute.removeNumberScalarListener(this);
attribute.removeErrorListener(this); attribute.removeErrorListener(this);
attributeList.remove(attributeName); attributeList.remove(attributeName);
m_logger.trace(ILogger.LEVEL_INFO, "\t The attribute was fired from the Collector list..."); isFirstValueList.remove(attributeName.toLowerCase());
logger.trace(ILogger.LEVEL_INFO, "\t The attribute was fired from the Collector list...");
// informs the mother class that one new attribute must be // informs the mother class that one new attribute must be
// removed // removed
removeAttribute(attributeName); removeAttribute(attributeName);
removeTimestamps(attributeName); removeTimestamps(attributeName);
if (attributeList.isEmpty()) {
m_logger.trace(ILogger.LEVEL_INFO, "===> StopCollecting is requested ");
stopCollecting();
}
} }
} catch (final Exception e) { } catch (final Exception e) {
final String message = GlobalConst.ARCHIVING_ERROR_PREFIX + " : " + "Failed removing '" + attributeName final String message = GlobalConst.ARCHIVING_ERROR_PREFIX + " : " + "Failed removing '" + attributeName
...@@ -211,8 +209,7 @@ public abstract class NumberScalar extends HdbCollector implements INumberScalar ...@@ -211,8 +209,7 @@ public abstract class NumberScalar extends HdbCollector implements INumberScalar
+ ".removeSource() method..."; + ".removeSource() method...";
throw new ArchivingException(message, reason, ErrSeverity.WARN, desc, "", e); throw new ArchivingException(message, reason, ErrSeverity.WARN, desc, "", e);
} finally { } finally {
m_logger.trace(ILogger.LEVEL_INFO, "===> Exiting " + this.getClass().getSimpleName() + ".removeSource for " startCollecting();
+ attributeName);
} }
} }
...@@ -223,6 +220,7 @@ public abstract class NumberScalar extends HdbCollector implements INumberScalar ...@@ -223,6 +220,7 @@ public abstract class NumberScalar extends HdbCollector implements INumberScalar
final String attName = attributeLightMode.getAttribute_complete_name(); final String attName = attributeLightMode.getAttribute_complete_name();
if (attName != null) { if (attName != null) {
INumberScalar attribute = null; INumberScalar attribute = null;
stopCollecting();
attribute = (INumberScalar) attributeList.add(attName); attribute = (INumberScalar) attributeList.add(attName);
attribute.addNumberScalarListener(this); attribute.addNumberScalarListener(this);
attribute.addErrorListener(this); attribute.addErrorListener(this);
...@@ -231,11 +229,7 @@ public abstract class NumberScalar extends HdbCollector implements INumberScalar ...@@ -231,11 +229,7 @@ public abstract class NumberScalar extends HdbCollector implements INumberScalar
// informs the mother class that one new attribute must be // informs the mother class that one new attribute must be
// managed // managed
addAttribute(attName); addAttribute(attName);
m_logger.trace(ILogger.LEVEL_INFO, "add archiving for " + attName); logger.trace(ILogger.LEVEL_INFO, "add archiving for " + attName);
startCollecting();
} else {
m_logger.trace(ILogger.LEVEL_ERROR, "archiving not started because attribute name is null "
+ attributeLightMode);
} }
} catch (final ConnectionException e) { } catch (final ConnectionException e) {
final String message = GlobalConst.ARCHIVING_ERROR_PREFIX + " : " + "Failed adding '" final String message = GlobalConst.ARCHIVING_ERROR_PREFIX + " : " + "Failed adding '"
...@@ -249,6 +243,8 @@ public abstract class NumberScalar extends HdbCollector implements INumberScalar ...@@ -249,6 +243,8 @@ public abstract class NumberScalar extends HdbCollector implements INumberScalar
final String reason = GlobalConst.TANGO_COMM_EXCEPTION; final String reason = GlobalConst.TANGO_COMM_EXCEPTION;
final String desc = "Failed while executing " + this.getClass().getSimpleName() + ".addSource() method..."; final String desc = "Failed while executing " + this.getClass().getSimpleName() + ".addSource() method...";
throw new ArchivingException(message, reason, ErrSeverity.WARN, desc, "", e); throw new ArchivingException(message, reason, ErrSeverity.WARN, desc, "", e);
} finally {
startCollecting();
} }
} }
...@@ -419,17 +415,18 @@ public abstract class NumberScalar extends HdbCollector implements INumberScalar ...@@ -419,17 +415,18 @@ public abstract class NumberScalar extends HdbCollector implements INumberScalar
scalarEvent.avoidUnderFlow(); scalarEvent.avoidUnderFlow();
boolean doArchive = false; boolean doArchive = false;
if (isFirstValue) { if (isFirstValueList.get(attributeName.toLowerCase())) {
doArchive = true; doArchive = true;
isFirstValue = false; isFirstValueList.put(attributeName.toLowerCase(), false);
m_logger.trace(ILogger.LEVEL_DEBUG, attributeName + " first value, forcing archiving"); logger.trace(ILogger.LEVEL_DEBUG, attributeName + " first value, forcing archiving");
} else { } else {
final ModesCounters mc = getModeCounter(attributeName); final ModesCounters mc = getModeCounter(attributeName);
if (mc == null) { if (mc == null) {
m_logger.trace(ILogger.LEVEL_ERROR, attributeName + " Attribute Counters unknown "); logger.trace(ILogger.LEVEL_ERROR, attributeName + " Attribute Counters unknown ");
} else { } else {
doArchive = doArchiveEvent(mc, scalarEvent.getData_type(), scalarEvent.getReadValue(), doArchive = doArchiveEvent(mc, scalarEvent.getData_type(), scalarEvent.getReadValue(),
getLastValue(scalarEvent), attributeName); getLastValue(scalarEvent), attributeName);
} }
} }
...@@ -441,8 +438,8 @@ public abstract class NumberScalar extends HdbCollector implements INumberScalar ...@@ -441,8 +438,8 @@ public abstract class NumberScalar extends HdbCollector implements INumberScalar
} catch (final Exception e) { } catch (final Exception e) {
e.printStackTrace(); e.printStackTrace();
final String message = "Problem storing NumberScalar value"; final String message = "Problem storing NumberScalar value";
super.m_logger.trace(ILogger.LEVEL_ERROR, message); super.logger.trace(ILogger.LEVEL_ERROR, message);
super.m_logger.trace(ILogger.LEVEL_ERROR, e); super.logger.trace(ILogger.LEVEL_ERROR, e);
try_number--; try_number--;
if (try_number > 0) { if (try_number > 0) {
...@@ -473,7 +470,7 @@ public abstract class NumberScalar extends HdbCollector implements INumberScalar ...@@ -473,7 +470,7 @@ public abstract class NumberScalar extends HdbCollector implements INumberScalar
final String errorMess = this.getClass().getSimpleName() + ".errorChange : Unable to read the attribute named " final String errorMess = this.getClass().getSimpleName() + ".errorChange : Unable to read the attribute named "
+ errorEvent.getSource().toString(); + errorEvent.getSource().toString();
Util.out3.println(errorMess); Util.out3.println(errorMess);
super.m_logger.trace(ILogger.LEVEL_ERROR, errorMess); super.logger.trace(ILogger.LEVEL_ERROR, errorMess);
/* Must be change because the number scalar are not only double */ /* Must be change because the number scalar are not only double */
try { try {
...@@ -481,7 +478,7 @@ public abstract class NumberScalar extends HdbCollector implements INumberScalar ...@@ -481,7 +478,7 @@ public abstract class NumberScalar extends HdbCollector implements INumberScalar
getNullValueScalarEvent(errorEvent, ((AAttribute) errorEvent.getSource()).getTangoDataType(), getNullValueScalarEvent(errorEvent, ((AAttribute) errorEvent.getSource()).getTangoDataType(),
getWritableValue()), tryNumber); getWritableValue()), tryNumber);
} catch (final Exception e) { } catch (final Exception e) {
super.m_logger.trace(ILogger.LEVEL_ERROR, this.getClass().getSimpleName() super.logger.trace(ILogger.LEVEL_ERROR, this.getClass().getSimpleName()
+ ".errorChange : during processEventScalar creation execp : " + e); + ".errorChange : during processEventScalar creation execp : " + e);
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -157,8 +157,8 @@ public class NumberScalar_RO extends NumberScalar { ...@@ -157,8 +157,8 @@ public class NumberScalar_RO extends NumberScalar {
processEventScalar(scalarEvent, tryNumber); processEventScalar(scalarEvent, tryNumber);
final String message = "Problem in NumberScalar_RO/numberScalarChange"; final String message = "Problem in NumberScalar_RO/numberScalarChange";
super.m_logger.trace(ILogger.LEVEL_ERROR, message); super.logger.trace(ILogger.LEVEL_ERROR, message);
super.m_logger.trace(ILogger.LEVEL_ERROR, exE); super.logger.trace(ILogger.LEVEL_ERROR, exE);
} }
} }
......
...@@ -182,8 +182,8 @@ public class NumberScalar_RW extends NumberScalar { ...@@ -182,8 +182,8 @@ public class NumberScalar_RW extends NumberScalar {
processEventScalar(scalarEvent, tryNumber); processEventScalar(scalarEvent, tryNumber);
final String message = "Problem in NumberScalar_RW/numberScalarChange"; final String message = "Problem in NumberScalar_RW/numberScalarChange";
super.m_logger.trace(ILogger.LEVEL_ERROR, message); super.logger.trace(ILogger.LEVEL_ERROR, message);
super.m_logger.trace(ILogger.LEVEL_ERROR, exE); super.logger.trace(ILogger.LEVEL_ERROR, exE);
} }
} }
......
...@@ -140,8 +140,8 @@ public class NumberScalar_WO extends NumberScalar { ...@@ -140,8 +140,8 @@ public class NumberScalar_WO extends NumberScalar {
processEventScalar(scalarEvent, tryNumber); processEventScalar(scalarEvent, tryNumber);
final String message = "Problem in NumberScalar_RW/numberScalarChange"; final String message = "Problem in NumberScalar_RW/numberScalarChange";
super.m_logger.trace(ILogger.LEVEL_ERROR, message); super.logger.trace(ILogger.LEVEL_ERROR, message);
super.m_logger.trace(ILogger.LEVEL_ERROR, exE); super.logger.trace(ILogger.LEVEL_ERROR, exE);
} }
} }
......
...@@ -80,19 +80,18 @@ public abstract class StateScalar extends HdbCollector implements IDevStateScala ...@@ -80,19 +80,18 @@ public abstract class StateScalar extends HdbCollector implements IDevStateScala
* while ( ( IDevStateScalar ) attributeList.get(attributeName) != * while ( ( IDevStateScalar ) attributeList.get(attributeName) !=
* null ) { * null ) {
*/ */
stopCollecting();
final IDevStateScalar attribute = (IDevStateScalar) attributeList.get(attributeName); final IDevStateScalar attribute = (IDevStateScalar) attributeList.get(attributeName);
if (attribute != null) { if (attribute != null) {
attribute.removeDevStateScalarListener(this); attribute.removeDevStateScalarListener(this);
attribute.removeErrorListener(this); attribute.removeErrorListener(this);
attributeList.remove(attributeName); attributeList.remove(attributeName);
isFirstValueList.remove(attributeName.toLowerCase());
Util.out4.println("\t The attribute named " + attributeName + " was fired from the Collector list..."); Util.out4.println("\t The attribute named " + attributeName + " was fired from the Collector list...");
// informs the mother class that one new attribute must be // informs the mother class that one new attribute must be
// removed // removed
removeAttribute(attributeName); removeAttribute(attributeName);
removeTimestamps(attributeName); removeTimestamps(attributeName);
if (attributeList.isEmpty()) {
stopCollecting();
}
} }
} catch (final Exception e) { } catch (final Exception e) {
final String message = GlobalConst.ARCHIVING_ERROR_PREFIX + " : " + "Failed removing '" + attributeName final String message = GlobalConst.ARCHIVING_ERROR_PREFIX + " : " + "Failed removing '" + attributeName
...@@ -101,6 +100,8 @@ public abstract class StateScalar extends HdbCollector implements IDevStateScala ...@@ -101,6 +100,8 @@ public abstract class StateScalar extends HdbCollector implements IDevStateScala
final String desc = "Failed while executing " + this.getClass().getSimpleName() final String desc = "Failed while executing " + this.getClass().getSimpleName()
+ ".removeSource() method..."; + ".removeSource() method...";
throw new ArchivingException(message, reason, ErrSeverity.WARN, desc, "", e); throw new ArchivingException(message, reason, ErrSeverity.WARN, desc, "", e);
} finally {
startCollecting();
} }
} }
...@@ -114,6 +115,7 @@ public abstract class StateScalar extends HdbCollector implements IDevStateScala ...@@ -114,6 +115,7 @@ public abstract class StateScalar extends HdbCollector implements IDevStateScala
// == // ==
// null ) // null )
// { // {
stopCollecting();
IDevStateScalar attribute = null; IDevStateScalar attribute = null;
attribute = (IDevStateScalar) attributeList.add(attName); attribute = (IDevStateScalar) attributeList.add(attName);
...@@ -123,11 +125,7 @@ public abstract class StateScalar extends HdbCollector implements IDevStateScala ...@@ -123,11 +125,7 @@ public abstract class StateScalar extends HdbCollector implements IDevStateScala
// informs the mother class that one new attribute must be // informs the mother class that one new attribute must be
// managed // managed
addAttribute(attName); addAttribute(attName);
m_logger.trace(ILogger.LEVEL_INFO, "add archiving for " + attName); logger.trace(ILogger.LEVEL_INFO, "add archiving for " + attName);
startCollecting();
} else {
m_logger.trace(ILogger.LEVEL_ERROR, "archiving not started because attribute name is null "
+ attributeLightMode);
} }
} catch (final ConnectionException e) { } catch (final ConnectionException e) {
...@@ -143,6 +141,8 @@ public abstract class StateScalar extends HdbCollector implements IDevStateScala ...@@ -143,6 +141,8 @@ public abstract class StateScalar extends HdbCollector implements IDevStateScala
final String reason = GlobalConst.TANGO_COMM_EXCEPTION; final String reason = GlobalConst.TANGO_COMM_EXCEPTION;
final String desc = "Failed while executing " + this.getClass().getSimpleName() + ".addSource() method..."; final String desc = "Failed while executing " + this.getClass().getSimpleName() + ".addSource() method...";
throw new ArchivingException(message, reason, ErrSeverity.WARN, desc, "", e); throw new ArchivingException(message, reason, ErrSeverity.WARN, desc, "", e);
} finally {
startCollecting();
} }
} }
...@@ -300,15 +300,15 @@ public abstract class StateScalar extends HdbCollector implements IDevStateScala ...@@ -300,15 +300,15 @@ public abstract class StateScalar extends HdbCollector implements IDevStateScala
String attributeName = scalarEvent.getAttribute_complete_name(); String attributeName = scalarEvent.getAttribute_complete_name();
try { try {
boolean doArchive = false; boolean doArchive = false;
if (isFirstValue) { if (isFirstValueList.get(attributeName.toLowerCase())) {
doArchive = true; doArchive = true;
isFirstValue = false; isFirstValueList.put(attributeName.toLowerCase(), false);
m_logger.trace(ILogger.LEVEL_DEBUG, attributeName + " first value, forcing archiving"); logger.trace(ILogger.LEVEL_DEBUG, attributeName + " first value, forcing archiving");
} else { } else {
final ModesCounters mc = getModeCounter(attributeName); final ModesCounters mc = getModeCounter(attributeName);
if (mc == null) { if (mc == null) {
m_logger.trace(ILogger.LEVEL_ERROR, attributeName + "attribute Counters unknown"); logger.trace(ILogger.LEVEL_ERROR, attributeName + "attribute Counters unknown");
} else { } else {
doArchive = doArchiveEvent(mc, scalarEvent.getData_type(), scalarEvent.getReadValue(), doArchive = doArchiveEvent(mc, scalarEvent.getData_type(), scalarEvent.getReadValue(),
getLastValue(scalarEvent), attributeName); getLastValue(scalarEvent), attributeName);
...@@ -322,8 +322,8 @@ public abstract class StateScalar extends HdbCollector implements IDevStateScala ...@@ -322,8 +322,8 @@ public abstract class StateScalar extends HdbCollector implements IDevStateScala
setLastValue(scalarEvent, scalarEvent.getReadValue()); setLastValue(scalarEvent, scalarEvent.getReadValue());
} catch (final Exception e) { } catch (final Exception e) {
final String message = "Problem storing StateScalar value"; final String message = "Problem storing StateScalar value";
super.m_logger.trace(ILogger.LEVEL_ERROR, message); super.logger.trace(ILogger.LEVEL_ERROR, message);
super.m_logger.trace(ILogger.LEVEL_ERROR, e); super.logger.trace(ILogger.LEVEL_ERROR, e);
try_number--; try_number--;
if (try_number > 0) { if (try_number > 0) {
...@@ -358,13 +358,13 @@ public abstract class StateScalar extends HdbCollector implements IDevStateScala ...@@ -358,13 +358,13 @@ public abstract class StateScalar extends HdbCollector implements IDevStateScala
final String errorMess = this.getClass().getSimpleName() + ".errorChange : Unable to read the attribute named " final String errorMess = this.getClass().getSimpleName() + ".errorChange : Unable to read the attribute named "
+ errorEvent.getSource().toString(); + errorEvent.getSource().toString();
Util.out3.println(errorMess); Util.out3.println(errorMess);
super.m_logger.trace(ILogger.LEVEL_ERROR, errorMess); super.logger.trace(ILogger.LEVEL_ERROR, errorMess);
try { try {
processEventScalar(getNullValueScalarEvent(errorEvent, TangoConst.Tango_DEV_STATE, getWritableValue()), processEventScalar(getNullValueScalarEvent(errorEvent, TangoConst.Tango_DEV_STATE, getWritableValue()),
tryNumber); tryNumber);
} catch (final Exception e) { } catch (final Exception e) {
super.m_logger.trace(ILogger.LEVEL_ERROR, this.getClass().getSimpleName() super.logger.trace(ILogger.LEVEL_ERROR, this.getClass().getSimpleName()
+ ".errorChange : during processEventScalar creation execp : " + e); + ".errorChange : during processEventScalar creation execp : " + e);
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -104,8 +104,8 @@ public class StateScalar_RO extends StateScalar { ...@@ -104,8 +104,8 @@ public class StateScalar_RO extends StateScalar {
processEventScalar(scalarEvent, tryNumber); processEventScalar(scalarEvent, tryNumber);
final String message = "Problem in StateScalar_RO/devStateScalarChange"; final String message = "Problem in StateScalar_RO/devStateScalarChange";
super.m_logger.trace(ILogger.LEVEL_ERROR, message); super.logger.trace(ILogger.LEVEL_ERROR, message);
super.m_logger.trace(ILogger.LEVEL_ERROR, exE); super.logger.trace(ILogger.LEVEL_ERROR, exE);
} }
} }
......
...@@ -82,19 +82,18 @@ public abstract class StringScalar extends HdbCollector implements IStringScalar ...@@ -82,19 +82,18 @@ public abstract class StringScalar extends HdbCollector implements IStringScalar
* while ( ( IStringScalar ) attributeList.get(attributeName) != * while ( ( IStringScalar ) attributeList.get(attributeName) !=
* null ) { * null ) {
*/ */
stopCollecting();
final IStringScalar attribute = (IStringScalar) attributeList.get(attributeName); final IStringScalar attribute = (IStringScalar) attributeList.get(attributeName);
if (attribute != null) { if (attribute != null) {
attribute.removeStringScalarListener(this); attribute.removeStringScalarListener(this);
attribute.removeErrorListener(this); attribute.removeErrorListener(this);
attributeList.remove(attributeName); attributeList.remove(attributeName);
isFirstValueList.remove(attributeName.toLowerCase());
Util.out4.println("\t The attribute named " + attributeName + " was fired from the Collector list..."); Util.out4.println("\t The attribute named " + attributeName + " was fired from the Collector list...");
// informs the mother class that one new attribute must be // informs the mother class that one new attribute must be
// removed // removed
removeAttribute(attributeName); removeAttribute(attributeName);
removeTimestamps(attributeName); removeTimestamps(attributeName);
if (attributeList.isEmpty()) {
stopCollecting();
}
} }
} catch (final Exception e) { } catch (final Exception e) {
final String message = GlobalConst.ARCHIVING_ERROR_PREFIX + " : " + "Failed removing '" + attributeName final String message = GlobalConst.ARCHIVING_ERROR_PREFIX + " : " + "Failed removing '" + attributeName
...@@ -103,6 +102,8 @@ public abstract class StringScalar extends HdbCollector implements IStringScalar ...@@ -103,6 +102,8 @@ public abstract class StringScalar extends HdbCollector implements IStringScalar
final String desc = "Failed while executing " + this.getClass().getSimpleName() final String desc = "Failed while executing " + this.getClass().getSimpleName()
+ ".removeSource() method..."; + ".removeSource() method...";
throw new ArchivingException(message, reason, ErrSeverity.WARN, desc, "", e); throw new ArchivingException(message, reason, ErrSeverity.WARN, desc, "", e);
} finally {
startCollecting();
} }
} }
...@@ -113,6 +114,7 @@ public abstract class StringScalar extends HdbCollector implements IStringScalar ...@@ -113,6 +114,7 @@ public abstract class StringScalar extends HdbCollector implements IStringScalar
try { try {
final String attName = attributeLightMode.getAttribute_complete_name(); final String attName = attributeLightMode.getAttribute_complete_name();
if (attName != null) { if (attName != null) {
stopCollecting();
IStringScalar attribute = null; IStringScalar attribute = null;
attribute = (IStringScalar) attributeList.add(attName); attribute = (IStringScalar) attributeList.add(attName);
...@@ -122,11 +124,7 @@ public abstract class StringScalar extends HdbCollector implements IStringScalar ...@@ -122,11 +124,7 @@ public abstract class StringScalar extends HdbCollector implements IStringScalar
// informs the mother class that one new attribute must be // informs the mother class that one new attribute must be
// managed // managed
addAttribute(attName); addAttribute(attName);
m_logger.trace(ILogger.LEVEL_INFO, "add archiving for " + attName); logger.trace(ILogger.LEVEL_INFO, "add archiving for " + attName);
startCollecting();
} else {
m_logger.trace(ILogger.LEVEL_ERROR, "archiving not started because attribute name is null "
+ attributeLightMode);
} }
} catch (final ConnectionException e) { } catch (final ConnectionException e) {
final String message = GlobalConst.ARCHIVING_ERROR_PREFIX + " : " + "Failed adding '" final String message = GlobalConst.ARCHIVING_ERROR_PREFIX + " : " + "Failed adding '"
...@@ -141,6 +139,8 @@ public abstract class StringScalar extends HdbCollector implements IStringScalar ...@@ -141,6 +139,8 @@ public abstract class StringScalar extends HdbCollector implements IStringScalar
final String reason = GlobalConst.TANGO_COMM_EXCEPTION; final String reason = GlobalConst.TANGO_COMM_EXCEPTION;
final String desc = "Failed while executing " + this.getClass().getSimpleName() + ".addSource() method..."; final String desc = "Failed while executing " + this.getClass().getSimpleName() + ".addSource() method...";
throw new ArchivingException(message, reason, ErrSeverity.WARN, desc, "", e); throw new ArchivingException(message, reason, ErrSeverity.WARN, desc, "", e);
} finally {
startCollecting();
} }
} }
...@@ -304,15 +304,15 @@ public abstract class StringScalar extends HdbCollector implements IStringScalar ...@@ -304,15 +304,15 @@ public abstract class StringScalar extends HdbCollector implements IStringScalar
String attributeName = scalarEvent.getAttribute_complete_name(); String attributeName = scalarEvent.getAttribute_complete_name();
try { try {
boolean doArchive = false; boolean doArchive = false;
if (isFirstValue) { if (isFirstValueList.get(attributeName.toLowerCase())) {
doArchive = true; doArchive = true;
isFirstValue = false; isFirstValueList.put(attributeName.toLowerCase(), false);
m_logger.trace(ILogger.LEVEL_DEBUG, attributeName + " first value, forcing archiving"); logger.trace(ILogger.LEVEL_DEBUG, attributeName + " first value, forcing archiving");
} else { } else {
final ModesCounters mc = getModeCounter(attributeName); final ModesCounters mc = getModeCounter(attributeName);
if (mc == null) { if (mc == null) {
m_logger.trace(ILogger.LEVEL_ERROR, attributeName + " Attribute Counters unknown"); logger.trace(ILogger.LEVEL_ERROR, attributeName + " Attribute Counters unknown");
} else { } else {
doArchive = doArchiveEvent(mc, scalarEvent.getData_type(), scalarEvent.getReadValue(), doArchive = doArchiveEvent(mc, scalarEvent.getData_type(), scalarEvent.getReadValue(),
getLastValue(scalarEvent), attributeName); getLastValue(scalarEvent), attributeName);
...@@ -326,8 +326,8 @@ public abstract class StringScalar extends HdbCollector implements IStringScalar ...@@ -326,8 +326,8 @@ public abstract class StringScalar extends HdbCollector implements IStringScalar
setLastValue(scalarEvent, scalarEvent.getReadValue()); setLastValue(scalarEvent, scalarEvent.getReadValue());
} catch (final Exception e) { } catch (final Exception e) {
final String message = "Problem storing StringScalar value"; final String message = "Problem storing StringScalar value";
super.m_logger.trace(ILogger.LEVEL_ERROR, message); super.logger.trace(ILogger.LEVEL_ERROR, message);
super.m_logger.trace(ILogger.LEVEL_ERROR, e); super.logger.trace(ILogger.LEVEL_ERROR, e);
try_number--; try_number--;
if (try_number > 0) { if (try_number > 0) {
...@@ -357,13 +357,13 @@ public abstract class StringScalar extends HdbCollector implements IStringScalar ...@@ -357,13 +357,13 @@ public abstract class StringScalar extends HdbCollector implements IStringScalar
final String errorMess = this.getClass().getSimpleName() + ".errorChange : Unable to read the attribute named " final String errorMess = this.getClass().getSimpleName() + ".errorChange : Unable to read the attribute named "
+ errorEvent.getSource().toString(); + errorEvent.getSource().toString();
Util.out3.println(errorMess); Util.out3.println(errorMess);
super.m_logger.trace(ILogger.LEVEL_ERROR, errorMess); super.logger.trace(ILogger.LEVEL_ERROR, errorMess);
try { try {
processEventScalar(getNullValueScalarEvent(errorEvent, TangoConst.Tango_DEV_STRING, getWritableValue()), processEventScalar(getNullValueScalarEvent(errorEvent, TangoConst.Tango_DEV_STRING, getWritableValue()),
tryNumber); tryNumber);
} catch (final Exception e) { } catch (final Exception e) {
super.m_logger.trace(ILogger.LEVEL_ERROR, this.getClass().getSimpleName() super.logger.trace(ILogger.LEVEL_ERROR, this.getClass().getSimpleName()
+ ".errorChange : during processEventScalar creation execp : " + e); + ".errorChange : during processEventScalar creation execp : " + e);
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -102,8 +102,8 @@ public class StringScalar_RO extends StringScalar { ...@@ -102,8 +102,8 @@ public class StringScalar_RO extends StringScalar {
processEventScalar(scalarEvent, tryNumber); processEventScalar(scalarEvent, tryNumber);
final String message = "Problem in StringScalar_RO/stringScalarChange"; final String message = "Problem in StringScalar_RO/stringScalarChange";
super.m_logger.trace(ILogger.LEVEL_ERROR, message); super.logger.trace(ILogger.LEVEL_ERROR, message);
super.m_logger.trace(ILogger.LEVEL_ERROR, exE); super.logger.trace(ILogger.LEVEL_ERROR, exE);
} }
} }
......
...@@ -105,8 +105,8 @@ public class StringScalar_RW extends StringScalar { ...@@ -105,8 +105,8 @@ public class StringScalar_RW extends StringScalar {
processEventScalar(scalarEvent, tryNumber); processEventScalar(scalarEvent, tryNumber);
final String message = "Problem in StringScalar_RW/stringScalarChange"; final String message = "Problem in StringScalar_RW/stringScalarChange";
super.m_logger.trace(ILogger.LEVEL_ERROR, message); super.logger.trace(ILogger.LEVEL_ERROR, message);
super.m_logger.trace(ILogger.LEVEL_ERROR, exE); super.logger.trace(ILogger.LEVEL_ERROR, exE);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment