Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • master
  • release_1_5_4
  • release_1_5_5
  • release_1_5_6
  • release_1_5_7
  • release_1_5_8
  • release_1_6_0
  • release_1_6_1
  • release_1_6_2
  • release_1_6_3
  • snapArchivingApi-1.6.4
  • snapArchivingApi-1.6.5
  • snapArchivingApi-1.6.6
  • snapArchivingApi-1.7.0
  • snapArchivingApi-1.7.1
  • snapArchivingApi-1.7.2
  • snapArchivingApi-1.7.3
  • snapArchivingApi-1.7.4
  • snapArchivingApi-1.7.5
  • snapArchivingApi-1.7.6
  • snapArchivingApi-1.7.7
  • snapArchivingApi-1.7.8
  • snapArchivingApi-1.8.0
  • snapArchivingApi-1.8.1
  • snapArchivingApi-1.8.2
  • snapArchivingApi-1.8.3
  • snapArchivingApi-1.8.4
  • trunk
28 results

Target

Select target project
  • software-control-system/tango-controls-archiving/snaparchivingapi
1 result
Select Git revision
  • master
  • release_1_5_4
  • release_1_5_5
  • release_1_5_6
  • release_1_5_7
  • release_1_5_8
  • release_1_6_0
  • release_1_6_1
  • release_1_6_2
  • release_1_6_3
  • snapArchivingApi-1.6.4
  • snapArchivingApi-1.6.5
  • snapArchivingApi-1.6.6
  • snapArchivingApi-1.7.0
  • snapArchivingApi-1.7.1
  • snapArchivingApi-1.7.2
  • snapArchivingApi-1.7.3
  • snapArchivingApi-1.7.4
  • snapArchivingApi-1.7.5
  • snapArchivingApi-1.7.6
  • snapArchivingApi-1.7.7
  • snapArchivingApi-1.7.8
  • snapArchivingApi-1.8.0
  • snapArchivingApi-1.8.1
  • snapArchivingApi-1.8.2
  • snapArchivingApi-1.8.3
  • snapArchivingApi-1.8.4
  • trunk
28 results
Show changes
Commits on Source (2)
Showing
with 261 additions and 429 deletions
/target/
.project
.settings
.classpath
/*
* Synchrotron Soleil
*
* File : GroupResponse.java
*
* Project : DynamicTangoUtilities
*
* Description :
*
* Author : CLAISSE
*
* Original : 1 févr. 07
*
* Revision: Author:
* Date: State:
*
* Log: GroupResponse.java,v
*/
/*
* Created on 1 févr. 07
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package fr.soleil.actiongroup.collectiveaction.components.response;
import java.util.Collection;
import java.util.Hashtable;
import java.util.Map;
/**
* Implementation of CollectiveResponse
*
* @author CLAISSE
*/
public class CollectiveResponseImpl implements CollectiveResponse {
private final Map<String, IndividualResponse> individualResponses;
private boolean hasFailed;
private boolean isFailureDueToATimeout;
public CollectiveResponseImpl() {
this.individualResponses = new Hashtable<String, IndividualResponse>();
this.individualResponses = new Hashtable<>();
}
@Override
......@@ -50,10 +31,8 @@ public class CollectiveResponseImpl implements CollectiveResponse {
@Override
public synchronized void addIndividualResponse(IndividualResponse individualResponse) {
individualResponses.put(individualResponse.dev_name(), individualResponse);
if (individualResponse.has_failed()) {
this.hasFailed = true;
if (individualResponse.has_timeout()) {
this.isFailureDueToATimeout = true;
}
......
/*
* Synchrotron Soleil
*
* File : IndividualAttributesResponse.java
*
* Project : DynamicTangoUtilities
*
* Description :
*
* Author : CLAISSE
*
* Original : 1 févr. 07
*
* Revision: Author:
* Date: State:
*
* Log: IndividualAttributesResponse.java,v
*/
/*
* Created on 1 févr. 07
*
* To change the template for this generated file go to
* Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
*/
package fr.soleil.actiongroup.collectiveaction.components.response;
import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.DeviceAttributeWrapper;
/**
* Implementation of IndividualAttributesResponse
*
* @author CLAISSE
*/
public class IndividualAttributesResponseImpl extends IndividualResponseImpl implements IndividualAttributesResponse {
private DeviceAttributeWrapper[] data;
public IndividualAttributesResponseImpl(String _deviceName) {
super(_deviceName);
public IndividualAttributesResponseImpl(String deviceName) {
super(deviceName);
}
@Override
......
/*
* Synchrotron Soleil
*
* File : IIndividualCommandResponse.java
*
* Project : DynamicTangoUtilities
*
* Description :
*
* Author : CLAISSE
*
* Original : 1 févr. 07
*
* Revision: Author:
* Date: State:
*
* Log: IIndividualCommandResponse.java,v
*/
/*
* Created on 1 févr. 07
*
* To change the template for this generated file go to
* Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
*/
package fr.soleil.actiongroup.collectiveaction.components.response;
import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.DeviceDataWrapper;
/**
* IndividualCommandResponse
*
* @author CLAISSE
*/
public interface IndividualCommandResponse extends IndividualResponse {
public DeviceDataWrapper get_data();
......
......@@ -2,22 +2,25 @@ package fr.soleil.actiongroup.collectiveaction.components.response;
import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.DeviceDataWrapper;
public class IndividualCommandResponseImpl extends IndividualResponseImpl implements IndividualCommandResponse
{
/**
* Implementation of IndividualCommandResponse
*
* @author CLAISSE
*/
public class IndividualCommandResponseImpl extends IndividualResponseImpl implements IndividualCommandResponse {
private DeviceDataWrapper data;
public IndividualCommandResponseImpl(String deviceName)
{
public IndividualCommandResponseImpl(String deviceName) {
super(deviceName);
}
public DeviceDataWrapper get_data()
{
@Override
public DeviceDataWrapper get_data() {
return this.data;
}
public void setData(DeviceDataWrapper _data)
{
this.data = _data;
@Override
public void setData(DeviceDataWrapper data) {
this.data = data;
}
}
/*
* Synchrotron Soleil
*
* File : dd.java
*
* Project : DynamicTangoUtilities
*
* Description :
*
* Author : CLAISSE
*
* Original : 1 févr. 07
*
* Revision: Author:
* Date: State:
*
* Log: dd.java,v
*/
/*
* Created on 1 févr. 07
*
* To change the template for this generated file go to
* Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
*/
package fr.soleil.actiongroup.collectiveaction.components.response;
import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.DevErrorWrapper;
/**
* IndividualResponse
*
* @author CLAISSE
*/
public interface IndividualResponse {
public boolean has_failed();
......@@ -35,9 +16,9 @@ public interface IndividualResponse {
public boolean has_timeout();
public void set_err_stack(DevErrorWrapper[] _err_stack);
public void set_err_stack(DevErrorWrapper[] err_stack);
public void set_failed(boolean _has_failed);
public void set_failed(boolean has_failed);
public void set_timeout(boolean _has_timeout);
public void set_timeout(boolean has_timeout);
}
/*
* Synchrotron Soleil
*
* File : IndividualResponse.java
*
* Project : DynamicTangoUtilities
*
* Description :
*
* Author : CLAISSE
*
* Original : 1 févr. 07
*
* Revision: Author:
* Date: State:
*
* Log: IndividualResponse.java,v
*/
/*
* Created on 1 févr. 07
*
* To change the template for this generated file go to
* Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
*/
package fr.soleil.actiongroup.collectiveaction.components.response;
import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.DevErrorWrapper;
/**
* Implementation of IndividualResponse
*
* @author CLAISSE
*/
public class IndividualResponseImpl implements IndividualResponse {
protected String deviceName;
protected DevErrorWrapper[] err_stack;
protected boolean has_failed;
protected boolean has_timeout;
public IndividualResponseImpl(String _deviceName) {
this.deviceName = _deviceName;
public IndividualResponseImpl(String deviceName) {
this.deviceName = deviceName;
}
@Override
......@@ -57,17 +38,17 @@ public class IndividualResponseImpl implements IndividualResponse {
}
@Override
public void set_err_stack(DevErrorWrapper[] _err_stack) {
this.err_stack = _err_stack;
public void set_err_stack(DevErrorWrapper[] err_stack) {
this.err_stack = err_stack;
}
@Override
public void set_failed(boolean _has_failed) {
this.has_failed = _has_failed;
public void set_failed(boolean has_failed) {
this.has_failed = has_failed;
}
@Override
public void set_timeout(boolean _has_timeout) {
this.has_timeout = _has_timeout;
public void set_timeout(boolean has_timeout) {
this.has_timeout = has_timeout;
}
}
package fr.soleil.actiongroup.collectiveaction.components.singleaction.atomic;
import fr.soleil.actiongroup.collectiveaction.components.singleactioncompletelistener.MinimalistActionListener;
import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.ActionResult;
import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.DeviceDataWrapper;
......@@ -6,10 +7,10 @@ import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.target.Ta
/**
* Executes a void (no return) command on a device. Notifies its listener on completion.
*
* @author CLAISSE
*/
public class ExecuteCommand extends AtomicIndividualAction
{
public class ExecuteCommand extends AtomicIndividualAction {
/**
* The command's name
*/
......@@ -21,21 +22,20 @@ public class ExecuteCommand extends AtomicIndividualAction
private DeviceDataWrapper commandParameters;
/**
* @param _listener The listener to notify on command execution completion
* @param _deviceToReadfrom The device to call the command on
* @param _commandName The command's name
* @param _commandParameters The command's parameters
* @param listener The listener to notify on command execution completion
* @param deviceToReadfrom The device to call the command on
* @param commandName The command's name
* @param commandParameters The command's parameters
*/
public ExecuteCommand ( MinimalistActionListener _listener , Target _deviceToReadfrom , String _commandName , DeviceDataWrapper _commandParameters )
{
super ( _listener , _deviceToReadfrom );
this.commandName = _commandName;
this.commandParameters = _commandParameters;
public ExecuteCommand(MinimalistActionListener listener, Target deviceToReadfrom, String commandName,
DeviceDataWrapper commandParameters) {
super(listener, deviceToReadfrom);
this.commandName = commandName;
this.commandParameters = commandParameters;
}
@Override
protected ActionResult executeAtomicAction() throws Throwable
{
protected ActionResult executeAtomicAction() throws Throwable {
DeviceDataWrapper response = this.target.command_inout(this.commandName, this.commandParameters);
return new ActionResult(response);
}
......
package fr.soleil.actiongroup.collectiveaction.components.singleaction.atomic;
import fr.soleil.actiongroup.collectiveaction.components.singleactioncompletelistener.MinimalistActionListener;
import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.target.Target;
/**
* Executes a void (no return) command on a device. Notifies its listener on completion.
*
* @author CLAISSE
*/
public class ExecuteStateCommand extends ExecuteCommand
{
public class ExecuteStateCommand extends ExecuteCommand {
/**
* @param _listener The listener to notify on command execution completion
* @param _deviceToReadfrom The device to call the command on
* @param _commandName The command's name
* @param _commandParameters The command's parameters
* @param listener The listener to notify on command execution completion
* @param deviceToReadfrom The device to call the command on
* @param commandName The command's name
* @param commandParameters The command's parameters
*/
public ExecuteStateCommand ( MinimalistActionListener _listener , Target _deviceToReadfrom )
{
super ( _listener , _deviceToReadfrom , "State" , null);
public ExecuteStateCommand(MinimalistActionListener listener, Target deviceToReadfrom) {
super(listener, deviceToReadfrom, "State", null);
}
}
\ No newline at end of file
/*
* Synchrotron Soleil
*
* File : ActionResultListenerDecorator.java
*
* Project : DynamicTangoUtilities
*
* Description :
*
* Author : CLAISSE
*
* Original : 7 févr. 07
*
* Revision: Author:
* Date: State:
*
* Log: ActionResultListenerDecorator.java,v
*/
/*
* Created on 7 févr. 07
*
* To change the template for this generated file go to
* Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
*/
package fr.soleil.actiongroup.collectiveaction.components.singleactioncompletelistener;
import java.util.Map;
import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.ActionResult;
/**
* ActionListenerDecorator
*
* @author CLAISSE
*/
public class ActionListenerDecorator implements ActionListener {
private final ActionListener decorator;
public ActionListenerDecorator(ActionListener _decorator) {
this.decorator = _decorator;
public ActionListenerDecorator(ActionListener decorator) {
this.decorator = decorator;
}
@Override
......@@ -52,11 +33,11 @@ public class ActionListenerDecorator implements ActionListener {
@Override
public synchronized boolean hasBeenNotifiedOfFailedActions() {
return this.decorator.hasBeenNotifiedOfFailedActions();
return decorator.hasBeenNotifiedOfFailedActions();
}
@Override
public synchronized Map<String, String> getMessages() {
return this.decorator.getMessages();
return decorator.getMessages();
}
}
......@@ -3,11 +3,12 @@ package fr.soleil.actiongroup.collectiveaction.components.singleactioncompleteli
import java.util.Map;
/**
* Defines the error management interface used to share error messages between a group and its action result listener, and between the group and its client.
* Defines the error management interface used to share error messages between a group and its action result listener,
* and between the group and its client.
*
* @author CLAISSE
*/
public interface Messages
{
public interface Messages {
/**
* @return A map which keys are the failed action's target, and which values are the correseponding error messages.
*/
......
......@@ -2,14 +2,13 @@ package fr.soleil.actiongroup.collectiveaction.components.singleactioncompleteli
import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.ActionResult;
/**
* A listener, notified by each individual action thread of the result of the group operation on an individual target.
* After the information from all devices has been accumulated, it is used to get the global information.
*
* @author CLAISSE
*/
public interface MinimalistActionListener
{
public interface MinimalistActionListener {
/**
* An individual task has been completed
*/
......@@ -17,6 +16,7 @@ public interface MinimalistActionListener
/**
* An individual task has succeeded
*
* @param targetName The name of the individual target
* @param actionResult The task's result
*/
......@@ -24,6 +24,7 @@ public interface MinimalistActionListener
/**
* An individual task has failed
*
* @param targetName The name of the individual target
* @param exception The exception that made the task fail
*/
......@@ -31,6 +32,7 @@ public interface MinimalistActionListener
/**
* Returns true if at least one individual task has failed.
*
* @return True if at least one individual task has failed
*/
public boolean hasBeenNotifiedOfFailedActions();
......
......@@ -22,7 +22,7 @@ import fr.soleil.actiongroup.collectiveaction.onattributes.plugin.context.Plugin
* @author CLAISSE
*/
public class UsePluginListener extends ActionListenerDecorator implements ActionListener {
private Logger logger = LoggerFactory.getLogger(UsePluginListener.class);
private static final Logger LOGGER = LoggerFactory.getLogger(UsePluginListener.class);
private final Plugin action;
private final PluginContext context;
......@@ -45,9 +45,9 @@ public class UsePluginListener extends ActionListenerDecorator implements Action
try {
action.execute(context, targetName, element);
} catch (final Exception e) {
logger.error("error", e);
LOGGER.error("error", e);
if (e instanceof DevFailed) {
logger.error("tango error {}", DevFailedUtils.toString((DevFailed) e));
LOGGER.error("tango error {}", DevFailedUtils.toString((DevFailed) e));
}
super.actionFailed(targetName, actionResult, e);
}
......
......@@ -2,15 +2,14 @@ package fr.soleil.actiongroup.collectiveaction.components.singleactioncompleteli
import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.ActionResult;
public class ActionCompleteMessageBuilder extends AbstractMessageBuilder implements MessageBuilder
{
public String getSuccessMessage ( String targetName , ActionResult actionResult )
{
public class ActionCompleteMessageBuilder extends AbstractMessageBuilder implements MessageBuilder {
@Override
public String getSuccessMessage(String targetName, ActionResult actionResult) {
return null;
}
public String getFailureMessage ( String targetName , ActionResult actionResult , Throwable e )
{
@Override
public String getFailureMessage(String targetName, ActionResult actionResult, Throwable e) {
return e.getMessage();
}
}
......@@ -4,16 +4,15 @@ import java.util.Date;
import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.ActionResult;
public class AttributePropertyUpdatedMessageBuilder extends AbstractMessageBuilder implements MessageBuilder
{
public String getSuccessMessage ( String targetName , ActionResult actionResult )
{
public class AttributePropertyUpdatedMessageBuilder extends AbstractMessageBuilder implements MessageBuilder {
@Override
public String getSuccessMessage(String targetName, ActionResult actionResult) {
String message = dateFormat.format(new Date()) + " : Update property : SUCCESS";
return message;
}
public String getFailureMessage ( String targetName , ActionResult actionResult , Throwable e )
{
@Override
public String getFailureMessage(String targetName, ActionResult actionResult, Throwable e) {
String message = dateFormat.format(new Date()) + " : Update property : FAILURE";
return message;
}
......
......@@ -14,10 +14,10 @@ import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.Tools;
/**
* A listener for the event "the numeric attributes reading operation from a device is complete".
* If the operation succeeded, the numeric values are stored.
*
* @author CLAISSE
*/
public class BuildNumericListenerImpl extends ActionListenerDecorator implements BuildNumericListener
{
public class BuildNumericListenerImpl extends ActionListenerDecorator implements BuildNumericListener {
/**
* The object that stores the numeric values
*/
......@@ -33,8 +33,8 @@ public class BuildNumericListenerImpl extends ActionListenerDecorator implements
*/
protected IAttributeQualityRegister attributeQualityRegister;
public BuildNumericListenerImpl ( ActionListener _decorator , Map<String, Integer> _deviceNameToIndexMap , IAttributeQualityRegister _attributeQualityRegister )
{
public BuildNumericListenerImpl(ActionListener _decorator, Map<String, Integer> _deviceNameToIndexMap,
IAttributeQualityRegister _attributeQualityRegister) {
super(_decorator);
this.deviceNameToIndexMap = _deviceNameToIndexMap;
......@@ -42,26 +42,22 @@ public class BuildNumericListenerImpl extends ActionListenerDecorator implements
this.attributeQualityRegister = _attributeQualityRegister;
}
public void actionSucceeded ( String deviceName , ActionResult readResult )
{
@Override
public void actionSucceeded(String deviceName, ActionResult readResult) {
DeviceAttributeWrapper[] attributesAnswer = readResult.getAttributesValue();
int idx = deviceNameToIndexMap.get(deviceName);
double[] res = null;
try
{
try {
res = this.toDoubleTab(deviceName, attributesAnswer);
synchronized ( this )
{
synchronized (this) {
result[idx] = res;
}
super.actionSucceeded(deviceName, readResult);
}
catch ( Throwable e )
{
} catch (Throwable e) {
super.actionFailed(deviceName, readResult, e);
}
}
......@@ -69,24 +65,24 @@ public class BuildNumericListenerImpl extends ActionListenerDecorator implements
/* (non-Javadoc)
* @see fr.soleil.core.CLA.listener.AbstractDeviceReaderListenerImpl#getResult()
*/
public synchronized double[][] getResult()
{
@Override
public synchronized double[][] getResult() {
return result;
}
/**
* Extracts the numeric values from raw numeric attributes.
* Delegates attributes quality management (or lack thereof) to mother class AbstractAttributesReadListener
*
* @param deviceName The device that was read from
* @param deviceAttributes The result of the read operation
* @return The corresponding numeric values
* @throws DevFailed The numeric values extraction failed
*/
private synchronized double[] toDoubleTab(String deviceName, DeviceAttributeWrapper [] deviceAttributes) throws DevFailedWrapper
{
private synchronized double[] toDoubleTab(String deviceName, DeviceAttributeWrapper[] deviceAttributes)
throws DevFailedWrapper {
double[] ret = new double[deviceAttributes.length];
for ( int i = 0 ; i < deviceAttributes.length ; i ++ )
{
for (int i = 0; i < deviceAttributes.length; i++) {
ret[i] = Tools.toDouble(deviceAttributes[i].getAttribute());
this.registerAttributeQuality(deviceName, deviceAttributes[i]);
}
......@@ -98,13 +94,12 @@ public class BuildNumericListenerImpl extends ActionListenerDecorator implements
* @param deviceName The target of the attributes reading task
* @param attribute A particular attribute within the attributes to read set
*/
public synchronized void registerAttributeQuality ( String deviceName, DeviceAttributeWrapper attribute )
{
public synchronized void registerAttributeQuality(String deviceName, DeviceAttributeWrapper attribute) {
this.attributeQualityRegister.registerAttributeQuality(deviceName, attribute);
}
public Map<String, String> getMessages()
{
@Override
public Map<String, String> getMessages() {
return null; // TO DO?
}
}
......@@ -7,25 +7,22 @@ import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.ActionRes
/**
* A listener for the event "the numeric attributes reading operation from a device is complete".
* If the operation succeeded, the numeric values are stored.
*
* @author CLAISSE
*/
public class FindSlowestDeviceListenerImpl extends ActionListenerDecorator implements FindSlowestDeviceListener
{
public class FindSlowestDeviceListenerImpl extends ActionListenerDecorator implements FindSlowestDeviceListener {
private String slowestDevice;
private long slowestTime;
public FindSlowestDeviceListenerImpl ( ActionListener _decorator )
{
super ( _decorator );
public FindSlowestDeviceListenerImpl(ActionListener decorator) {
super(decorator);
}
public void actionSucceeded ( String deviceName , ActionResult readResult )
{
@Override
public void actionSucceeded(String deviceName, ActionResult readResult) {
long actionTime = readResult.getActionTime();
synchronized ( this )
{
if ( actionTime > this.slowestTime )
{
synchronized (this) {
if (actionTime > this.slowestTime) {
this.slowestTime = actionTime;
this.slowestDevice = deviceName;
}
......@@ -34,13 +31,13 @@ public class FindSlowestDeviceListenerImpl extends ActionListenerDecorator imple
super.actionSucceeded(deviceName, readResult);
}
public synchronized String getSlowestDevice ()
{
return this.slowestDevice;
@Override
public synchronized String getSlowestDevice() {
return slowestDevice;
}
public synchronized long getSlowestTime ()
{
return this.slowestTime;
@Override
public synchronized long getSlowestTime() {
return slowestTime;
}
}
/* Synchrotron Soleil
*
* File : AttributeQualityRegister.java
*
* Project : TangoParser
*
* Description :
*
* Author : CLAISSE
*
* Original : 12 janv. 07
*
* Revision: Author:
* Date: State:
*
* Log: AttributeQualityRegister.java,v
*
*/
/*
* Created on 12 janv. 07
*
* To change the template for this generated file go to
* Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
*/
package fr.soleil.actiongroup.collectiveaction.components.singleactioncompletelistener.extraction.qualities;
import java.util.Hashtable;
......@@ -33,11 +9,12 @@ import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.DeviceAtt
/**
* Manages the qualities of the read attributes.
* Extracts the read attributes qualities and stores them into a Map.
* If the quality extraction fails, the attribute will be considered invalid (its quality will be AttrQuality.ATTR_INVALID)
* If the quality extraction fails, the attribute will be considered invalid (its quality will be
* AttrQuality.ATTR_INVALID)
*
* @author CLAISSE
*/
public class AttributeQualityRegister implements IAttributeQualityRegister
{
public class AttributeQualityRegister implements IAttributeQualityRegister {
/**
* An attribute complete name-->quality mapping
*/
......@@ -46,23 +23,19 @@ public class AttributeQualityRegister implements IAttributeQualityRegister
/**
*
*/
public AttributeQualityRegister ()
{
public AttributeQualityRegister() {
this.qualities = new Hashtable<String, AttrQualityWrapper>();
}
public void registerAttributeQuality(String deviceName, DeviceAttributeWrapper attribute)
{
@Override
public void registerAttributeQuality(String deviceName, DeviceAttributeWrapper attribute) {
AttrQualityWrapper quality = null;
String attributeName = null;
try
{
try {
attributeName = attribute.getName();
quality = new AttrQualityWrapper(attribute.getQuality());
}
catch (Throwable e)
{
} catch (Throwable e) {
quality = new AttrQualityWrapper(AttrQualityWrapper.ATTR_INVALID);
}
......@@ -71,13 +44,12 @@ public class AttributeQualityRegister implements IAttributeQualityRegister
/**
* Stores the quality of the specified attribute
*
* @param attributeName The attribute's complete name
* @param quality The attribute's quality
*/
private void setQuality ( String attributeName , AttrQualityWrapper quality )
{
synchronized ( this )
{
private void setQuality(String attributeName, AttrQualityWrapper quality) {
synchronized (this) {
this.qualities.put(attributeName, quality);
}
}
......@@ -85,16 +57,16 @@ public class AttributeQualityRegister implements IAttributeQualityRegister
/* (non-Javadoc)
* @see fr.soleil.core.groupactions.apis.listener.attributes.read.quality.IAttributeQualityReader#getQualities()
*/
public synchronized Map<String, AttrQualityWrapper> getQualities()
{
@Override
public synchronized Map<String, AttrQualityWrapper> getQualities() {
return qualities;
}
/* (non-Javadoc)
* @see fr.soleil.core.groupactions.apis.listener.attributes.read.quality.IAttributeQualityReader#getQuality(java.lang.String)
*/
public synchronized AttrQualityWrapper getQuality(String attributeName)
{
@Override
public synchronized AttrQualityWrapper getQuality(String attributeName) {
return qualities.get(attributeName);
}
}
/* Synchrotron Soleil
*
* File : aa.java
*
* Project : TangoParser
*
* Description :
*
* Author : CLAISSE
*
* Original : 12 janv. 07
*
* Revision: Author:
* Date: State:
*
* Log: aa.java,v
*
*/
/*
* Created on 12 janv. 07
*
* To change the template for this generated file go to
* Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
*/
package fr.soleil.actiongroup.collectiveaction.components.singleactioncompletelistener.extraction.qualities;
import java.util.Map;
......@@ -31,28 +7,28 @@ import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.DeviceAtt
/**
* A do-nothing implementation
*
* @author CLAISSE
*/
public class DoNothingAttributeQualityRegister implements IAttributeQualityRegister
{
public class DoNothingAttributeQualityRegister implements IAttributeQualityRegister {
/* (non-Javadoc)
* @see fr.soleil.core.groupactions.apis.listener.attributes.read.quality.IAttributeQualityReader#getQualities()
*/
public Map<String, AttrQualityWrapper> getQualities()
{
@Override
public Map<String, AttrQualityWrapper> getQualities() {
return null;
}
/* (non-Javadoc)
* @see fr.soleil.core.groupactions.apis.listener.attributes.read.quality.IAttributeQualityReader#getQuality(java.lang.String)
*/
public AttrQualityWrapper getQuality(String attributeName)
{
@Override
public AttrQualityWrapper getQuality(String attributeName) {
return null;
}
public void registerAttributeQuality(String deviceName, DeviceAttributeWrapper attribute)
{
@Override
public void registerAttributeQuality(String deviceName, DeviceAttributeWrapper attribute) {
}
}
......@@ -122,7 +122,7 @@ public class DeviceAttributeWrapper {
return this.attribute.getQuality();
}
public DevState[] extractDevStateArray() throws DevFailed {
return attribute.extractDevStateArray();
public DevState extractState() throws DevFailed {
return attribute.extractState();
}
}