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; package fr.soleil.actiongroup.collectiveaction.components.response;
import java.util.Collection; import java.util.Collection;
import java.util.Hashtable; import java.util.Hashtable;
import java.util.Map; import java.util.Map;
/**
* Implementation of CollectiveResponse
*
* @author CLAISSE
*/
public class CollectiveResponseImpl implements CollectiveResponse { public class CollectiveResponseImpl implements CollectiveResponse {
private final Map<String, IndividualResponse> individualResponses; private final Map<String, IndividualResponse> individualResponses;
private boolean hasFailed; private boolean hasFailed;
private boolean isFailureDueToATimeout; private boolean isFailureDueToATimeout;
public CollectiveResponseImpl() { public CollectiveResponseImpl() {
this.individualResponses = new Hashtable<String, IndividualResponse>(); this.individualResponses = new Hashtable<>();
} }
@Override @Override
...@@ -50,10 +31,8 @@ public class CollectiveResponseImpl implements CollectiveResponse { ...@@ -50,10 +31,8 @@ public class CollectiveResponseImpl implements CollectiveResponse {
@Override @Override
public synchronized void addIndividualResponse(IndividualResponse individualResponse) { public synchronized void addIndividualResponse(IndividualResponse individualResponse) {
individualResponses.put(individualResponse.dev_name(), individualResponse); individualResponses.put(individualResponse.dev_name(), individualResponse);
if (individualResponse.has_failed()) { if (individualResponse.has_failed()) {
this.hasFailed = true; this.hasFailed = true;
if (individualResponse.has_timeout()) { if (individualResponse.has_timeout()) {
this.isFailureDueToATimeout = true; 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; package fr.soleil.actiongroup.collectiveaction.components.response;
import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.DeviceAttributeWrapper; import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.DeviceAttributeWrapper;
/**
* Implementation of IndividualAttributesResponse
*
* @author CLAISSE
*/
public class IndividualAttributesResponseImpl extends IndividualResponseImpl implements IndividualAttributesResponse { public class IndividualAttributesResponseImpl extends IndividualResponseImpl implements IndividualAttributesResponse {
private DeviceAttributeWrapper[] data; private DeviceAttributeWrapper[] data;
public IndividualAttributesResponseImpl(String _deviceName) { public IndividualAttributesResponseImpl(String deviceName) {
super(_deviceName); super(deviceName);
} }
@Override @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; package fr.soleil.actiongroup.collectiveaction.components.response;
import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.DeviceDataWrapper; import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.DeviceDataWrapper;
/**
* IndividualCommandResponse
*
* @author CLAISSE
*/
public interface IndividualCommandResponse extends IndividualResponse { public interface IndividualCommandResponse extends IndividualResponse {
public DeviceDataWrapper get_data(); public DeviceDataWrapper get_data();
......
...@@ -2,22 +2,25 @@ package fr.soleil.actiongroup.collectiveaction.components.response; ...@@ -2,22 +2,25 @@ package fr.soleil.actiongroup.collectiveaction.components.response;
import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.DeviceDataWrapper; 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; private DeviceDataWrapper data;
public IndividualCommandResponseImpl(String deviceName) public IndividualCommandResponseImpl(String deviceName) {
{
super(deviceName); super(deviceName);
} }
public DeviceDataWrapper get_data() @Override
{ public DeviceDataWrapper get_data() {
return this.data; return this.data;
} }
public void setData(DeviceDataWrapper _data) @Override
{ public void setData(DeviceDataWrapper data) {
this.data = _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; package fr.soleil.actiongroup.collectiveaction.components.response;
import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.DevErrorWrapper; import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.DevErrorWrapper;
/**
* IndividualResponse
*
* @author CLAISSE
*/
public interface IndividualResponse { public interface IndividualResponse {
public boolean has_failed(); public boolean has_failed();
...@@ -35,9 +16,9 @@ public interface IndividualResponse { ...@@ -35,9 +16,9 @@ public interface IndividualResponse {
public boolean has_timeout(); 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; package fr.soleil.actiongroup.collectiveaction.components.response;
import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.DevErrorWrapper; import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.DevErrorWrapper;
/**
* Implementation of IndividualResponse
*
* @author CLAISSE
*/
public class IndividualResponseImpl implements IndividualResponse { public class IndividualResponseImpl implements IndividualResponse {
protected String deviceName; protected String deviceName;
protected DevErrorWrapper[] err_stack; protected DevErrorWrapper[] err_stack;
protected boolean has_failed; protected boolean has_failed;
protected boolean has_timeout; protected boolean has_timeout;
public IndividualResponseImpl(String _deviceName) { public IndividualResponseImpl(String deviceName) {
this.deviceName = _deviceName; this.deviceName = deviceName;
} }
@Override @Override
...@@ -57,17 +38,17 @@ public class IndividualResponseImpl implements IndividualResponse { ...@@ -57,17 +38,17 @@ public class IndividualResponseImpl implements IndividualResponse {
} }
@Override @Override
public void set_err_stack(DevErrorWrapper[] _err_stack) { public void set_err_stack(DevErrorWrapper[] err_stack) {
this.err_stack = _err_stack; this.err_stack = err_stack;
} }
@Override @Override
public void set_failed(boolean _has_failed) { public void set_failed(boolean has_failed) {
this.has_failed = _has_failed; this.has_failed = has_failed;
} }
@Override @Override
public void set_timeout(boolean _has_timeout) { public void set_timeout(boolean has_timeout) {
this.has_timeout = _has_timeout; this.has_timeout = has_timeout;
} }
} }
package fr.soleil.actiongroup.collectiveaction.components.singleaction.atomic; package fr.soleil.actiongroup.collectiveaction.components.singleaction.atomic;
import fr.soleil.actiongroup.collectiveaction.components.singleactioncompletelistener.MinimalistActionListener; import fr.soleil.actiongroup.collectiveaction.components.singleactioncompletelistener.MinimalistActionListener;
import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.ActionResult; import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.ActionResult;
import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.DeviceDataWrapper; import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.DeviceDataWrapper;
...@@ -6,10 +7,10 @@ import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.target.Ta ...@@ -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. * Executes a void (no return) command on a device. Notifies its listener on completion.
*
* @author CLAISSE * @author CLAISSE
*/ */
public class ExecuteCommand extends AtomicIndividualAction public class ExecuteCommand extends AtomicIndividualAction {
{
/** /**
* The command's name * The command's name
*/ */
...@@ -21,21 +22,20 @@ public class ExecuteCommand extends AtomicIndividualAction ...@@ -21,21 +22,20 @@ public class ExecuteCommand extends AtomicIndividualAction
private DeviceDataWrapper commandParameters; private DeviceDataWrapper commandParameters;
/** /**
* @param _listener The listener to notify on command execution completion * @param listener The listener to notify on command execution completion
* @param _deviceToReadfrom The device to call the command on * @param deviceToReadfrom The device to call the command on
* @param _commandName The command's name * @param commandName The command's name
* @param _commandParameters The command's parameters * @param commandParameters The command's parameters
*/ */
public ExecuteCommand ( MinimalistActionListener _listener , Target _deviceToReadfrom , String _commandName , DeviceDataWrapper _commandParameters ) public ExecuteCommand(MinimalistActionListener listener, Target deviceToReadfrom, String commandName,
{ DeviceDataWrapper commandParameters) {
super ( _listener , _deviceToReadfrom ); super(listener, deviceToReadfrom);
this.commandName = _commandName; this.commandName = commandName;
this.commandParameters = _commandParameters; this.commandParameters = commandParameters;
} }
@Override @Override
protected ActionResult executeAtomicAction() throws Throwable protected ActionResult executeAtomicAction() throws Throwable {
{
DeviceDataWrapper response = this.target.command_inout(this.commandName, this.commandParameters); DeviceDataWrapper response = this.target.command_inout(this.commandName, this.commandParameters);
return new ActionResult(response); return new ActionResult(response);
} }
......
package fr.soleil.actiongroup.collectiveaction.components.singleaction.atomic; package fr.soleil.actiongroup.collectiveaction.components.singleaction.atomic;
import fr.soleil.actiongroup.collectiveaction.components.singleactioncompletelistener.MinimalistActionListener; import fr.soleil.actiongroup.collectiveaction.components.singleactioncompletelistener.MinimalistActionListener;
import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.target.Target; import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.target.Target;
/** /**
* Executes a void (no return) command on a device. Notifies its listener on completion. * Executes a void (no return) command on a device. Notifies its listener on completion.
*
* @author CLAISSE * @author CLAISSE
*/ */
public class ExecuteStateCommand extends ExecuteCommand public class ExecuteStateCommand extends ExecuteCommand {
{
/** /**
* @param _listener The listener to notify on command execution completion * @param listener The listener to notify on command execution completion
* @param _deviceToReadfrom The device to call the command on * @param deviceToReadfrom The device to call the command on
* @param _commandName The command's name * @param commandName The command's name
* @param _commandParameters The command's parameters * @param commandParameters The command's parameters
*/ */
public ExecuteStateCommand ( MinimalistActionListener _listener , Target _deviceToReadfrom ) public ExecuteStateCommand(MinimalistActionListener listener, Target deviceToReadfrom) {
{ super(listener, deviceToReadfrom, "State", null);
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; package fr.soleil.actiongroup.collectiveaction.components.singleactioncompletelistener;
import java.util.Map; import java.util.Map;
import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.ActionResult; import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.ActionResult;
/**
* ActionListenerDecorator
*
* @author CLAISSE
*/
public class ActionListenerDecorator implements ActionListener { public class ActionListenerDecorator implements ActionListener {
private final ActionListener decorator; private final ActionListener decorator;
public ActionListenerDecorator(ActionListener _decorator) { public ActionListenerDecorator(ActionListener decorator) {
this.decorator = _decorator; this.decorator = decorator;
} }
@Override @Override
...@@ -52,11 +33,11 @@ public class ActionListenerDecorator implements ActionListener { ...@@ -52,11 +33,11 @@ public class ActionListenerDecorator implements ActionListener {
@Override @Override
public synchronized boolean hasBeenNotifiedOfFailedActions() { public synchronized boolean hasBeenNotifiedOfFailedActions() {
return this.decorator.hasBeenNotifiedOfFailedActions(); return decorator.hasBeenNotifiedOfFailedActions();
} }
@Override @Override
public synchronized Map<String, String> getMessages() { public synchronized Map<String, String> getMessages() {
return this.decorator.getMessages(); return decorator.getMessages();
} }
} }
...@@ -3,11 +3,12 @@ package fr.soleil.actiongroup.collectiveaction.components.singleactioncompleteli ...@@ -3,11 +3,12 @@ package fr.soleil.actiongroup.collectiveaction.components.singleactioncompleteli
import java.util.Map; 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 * @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. * @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 ...@@ -2,14 +2,13 @@ package fr.soleil.actiongroup.collectiveaction.components.singleactioncompleteli
import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.ActionResult; 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. * 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. * After the information from all devices has been accumulated, it is used to get the global information.
*
* @author CLAISSE * @author CLAISSE
*/ */
public interface MinimalistActionListener public interface MinimalistActionListener {
{
/** /**
* An individual task has been completed * An individual task has been completed
*/ */
...@@ -17,6 +16,7 @@ public interface MinimalistActionListener ...@@ -17,6 +16,7 @@ public interface MinimalistActionListener
/** /**
* An individual task has succeeded * An individual task has succeeded
*
* @param targetName The name of the individual target * @param targetName The name of the individual target
* @param actionResult The task's result * @param actionResult The task's result
*/ */
...@@ -24,6 +24,7 @@ public interface MinimalistActionListener ...@@ -24,6 +24,7 @@ public interface MinimalistActionListener
/** /**
* An individual task has failed * An individual task has failed
*
* @param targetName The name of the individual target * @param targetName The name of the individual target
* @param exception The exception that made the task fail * @param exception The exception that made the task fail
*/ */
...@@ -31,6 +32,7 @@ public interface MinimalistActionListener ...@@ -31,6 +32,7 @@ public interface MinimalistActionListener
/** /**
* Returns true if at least one individual task has failed. * Returns true if at least one individual task has failed.
*
* @return True if at least one individual task has failed * @return True if at least one individual task has failed
*/ */
public boolean hasBeenNotifiedOfFailedActions(); public boolean hasBeenNotifiedOfFailedActions();
......
...@@ -22,7 +22,7 @@ import fr.soleil.actiongroup.collectiveaction.onattributes.plugin.context.Plugin ...@@ -22,7 +22,7 @@ import fr.soleil.actiongroup.collectiveaction.onattributes.plugin.context.Plugin
* @author CLAISSE * @author CLAISSE
*/ */
public class UsePluginListener extends ActionListenerDecorator implements ActionListener { 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 Plugin action;
private final PluginContext context; private final PluginContext context;
...@@ -45,9 +45,9 @@ public class UsePluginListener extends ActionListenerDecorator implements Action ...@@ -45,9 +45,9 @@ public class UsePluginListener extends ActionListenerDecorator implements Action
try { try {
action.execute(context, targetName, element); action.execute(context, targetName, element);
} catch (final Exception e) { } catch (final Exception e) {
logger.error("error", e); LOGGER.error("error", e);
if (e instanceof DevFailed) { 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); super.actionFailed(targetName, actionResult, e);
} }
......
...@@ -2,15 +2,14 @@ package fr.soleil.actiongroup.collectiveaction.components.singleactioncompleteli ...@@ -2,15 +2,14 @@ package fr.soleil.actiongroup.collectiveaction.components.singleactioncompleteli
import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.ActionResult; import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.ActionResult;
public class ActionCompleteMessageBuilder extends AbstractMessageBuilder implements MessageBuilder public class ActionCompleteMessageBuilder extends AbstractMessageBuilder implements MessageBuilder {
{ @Override
public String getSuccessMessage ( String targetName , ActionResult actionResult ) public String getSuccessMessage(String targetName, ActionResult actionResult) {
{
return null; return null;
} }
public String getFailureMessage ( String targetName , ActionResult actionResult , Throwable e ) @Override
{ public String getFailureMessage(String targetName, ActionResult actionResult, Throwable e) {
return e.getMessage(); return e.getMessage();
} }
} }
...@@ -4,16 +4,15 @@ import java.util.Date; ...@@ -4,16 +4,15 @@ import java.util.Date;
import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.ActionResult; import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.ActionResult;
public class AttributePropertyUpdatedMessageBuilder extends AbstractMessageBuilder implements MessageBuilder public class AttributePropertyUpdatedMessageBuilder extends AbstractMessageBuilder implements MessageBuilder {
{ @Override
public String getSuccessMessage ( String targetName , ActionResult actionResult ) public String getSuccessMessage(String targetName, ActionResult actionResult) {
{
String message = dateFormat.format(new Date()) + " : Update property : SUCCESS"; String message = dateFormat.format(new Date()) + " : Update property : SUCCESS";
return message; 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"; String message = dateFormat.format(new Date()) + " : Update property : FAILURE";
return message; return message;
} }
......
...@@ -14,10 +14,10 @@ import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.Tools; ...@@ -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". * A listener for the event "the numeric attributes reading operation from a device is complete".
* If the operation succeeded, the numeric values are stored. * If the operation succeeded, the numeric values are stored.
*
* @author CLAISSE * @author CLAISSE
*/ */
public class BuildNumericListenerImpl extends ActionListenerDecorator implements BuildNumericListener public class BuildNumericListenerImpl extends ActionListenerDecorator implements BuildNumericListener {
{
/** /**
* The object that stores the numeric values * The object that stores the numeric values
*/ */
...@@ -33,8 +33,8 @@ public class BuildNumericListenerImpl extends ActionListenerDecorator implements ...@@ -33,8 +33,8 @@ public class BuildNumericListenerImpl extends ActionListenerDecorator implements
*/ */
protected IAttributeQualityRegister attributeQualityRegister; 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); super(_decorator);
this.deviceNameToIndexMap = _deviceNameToIndexMap; this.deviceNameToIndexMap = _deviceNameToIndexMap;
...@@ -42,26 +42,22 @@ public class BuildNumericListenerImpl extends ActionListenerDecorator implements ...@@ -42,26 +42,22 @@ public class BuildNumericListenerImpl extends ActionListenerDecorator implements
this.attributeQualityRegister = _attributeQualityRegister; this.attributeQualityRegister = _attributeQualityRegister;
} }
public void actionSucceeded ( String deviceName , ActionResult readResult ) @Override
{ public void actionSucceeded(String deviceName, ActionResult readResult) {
DeviceAttributeWrapper[] attributesAnswer = readResult.getAttributesValue(); DeviceAttributeWrapper[] attributesAnswer = readResult.getAttributesValue();
int idx = deviceNameToIndexMap.get(deviceName); int idx = deviceNameToIndexMap.get(deviceName);
double[] res = null; double[] res = null;
try try {
{
res = this.toDoubleTab(deviceName, attributesAnswer); res = this.toDoubleTab(deviceName, attributesAnswer);
synchronized ( this ) synchronized (this) {
{
result[idx] = res; result[idx] = res;
} }
super.actionSucceeded(deviceName, readResult); super.actionSucceeded(deviceName, readResult);
} } catch (Throwable e) {
catch ( Throwable e )
{
super.actionFailed(deviceName, readResult, e); super.actionFailed(deviceName, readResult, e);
} }
} }
...@@ -69,24 +65,24 @@ public class BuildNumericListenerImpl extends ActionListenerDecorator implements ...@@ -69,24 +65,24 @@ public class BuildNumericListenerImpl extends ActionListenerDecorator implements
/* (non-Javadoc) /* (non-Javadoc)
* @see fr.soleil.core.CLA.listener.AbstractDeviceReaderListenerImpl#getResult() * @see fr.soleil.core.CLA.listener.AbstractDeviceReaderListenerImpl#getResult()
*/ */
public synchronized double[][] getResult() @Override
{ public synchronized double[][] getResult() {
return result; return result;
} }
/** /**
* Extracts the numeric values from raw numeric attributes. * Extracts the numeric values from raw numeric attributes.
* Delegates attributes quality management (or lack thereof) to mother class AbstractAttributesReadListener * Delegates attributes quality management (or lack thereof) to mother class AbstractAttributesReadListener
*
* @param deviceName The device that was read from * @param deviceName The device that was read from
* @param deviceAttributes The result of the read operation * @param deviceAttributes The result of the read operation
* @return The corresponding numeric values * @return The corresponding numeric values
* @throws DevFailed The numeric values extraction failed * @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]; 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()); ret[i] = Tools.toDouble(deviceAttributes[i].getAttribute());
this.registerAttributeQuality(deviceName, deviceAttributes[i]); this.registerAttributeQuality(deviceName, deviceAttributes[i]);
} }
...@@ -98,13 +94,12 @@ public class BuildNumericListenerImpl extends ActionListenerDecorator implements ...@@ -98,13 +94,12 @@ public class BuildNumericListenerImpl extends ActionListenerDecorator implements
* @param deviceName The target of the attributes reading task * @param deviceName The target of the attributes reading task
* @param attribute A particular attribute within the attributes to read set * @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); this.attributeQualityRegister.registerAttributeQuality(deviceName, attribute);
} }
public Map<String, String> getMessages() @Override
{ public Map<String, String> getMessages() {
return null; // TO DO? return null; // TO DO?
} }
} }
...@@ -7,25 +7,22 @@ import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.ActionRes ...@@ -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". * A listener for the event "the numeric attributes reading operation from a device is complete".
* If the operation succeeded, the numeric values are stored. * If the operation succeeded, the numeric values are stored.
*
* @author CLAISSE * @author CLAISSE
*/ */
public class FindSlowestDeviceListenerImpl extends ActionListenerDecorator implements FindSlowestDeviceListener public class FindSlowestDeviceListenerImpl extends ActionListenerDecorator implements FindSlowestDeviceListener {
{
private String slowestDevice; private String slowestDevice;
private long slowestTime; private long slowestTime;
public FindSlowestDeviceListenerImpl ( ActionListener _decorator ) public FindSlowestDeviceListenerImpl(ActionListener decorator) {
{ super(decorator);
super ( _decorator );
} }
public void actionSucceeded ( String deviceName , ActionResult readResult ) @Override
{ public void actionSucceeded(String deviceName, ActionResult readResult) {
long actionTime = readResult.getActionTime(); long actionTime = readResult.getActionTime();
synchronized ( this ) synchronized (this) {
{ if (actionTime > this.slowestTime) {
if ( actionTime > this.slowestTime )
{
this.slowestTime = actionTime; this.slowestTime = actionTime;
this.slowestDevice = deviceName; this.slowestDevice = deviceName;
} }
...@@ -34,13 +31,13 @@ public class FindSlowestDeviceListenerImpl extends ActionListenerDecorator imple ...@@ -34,13 +31,13 @@ public class FindSlowestDeviceListenerImpl extends ActionListenerDecorator imple
super.actionSucceeded(deviceName, readResult); super.actionSucceeded(deviceName, readResult);
} }
public synchronized String getSlowestDevice () @Override
{ public synchronized String getSlowestDevice() {
return this.slowestDevice; return slowestDevice;
} }
public synchronized long getSlowestTime () @Override
{ public synchronized long getSlowestTime() {
return this.slowestTime; 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; package fr.soleil.actiongroup.collectiveaction.components.singleactioncompletelistener.extraction.qualities;
import java.util.Hashtable; import java.util.Hashtable;
...@@ -33,11 +9,12 @@ import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.DeviceAtt ...@@ -33,11 +9,12 @@ import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.DeviceAtt
/** /**
* Manages the qualities of the read attributes. * Manages the qualities of the read attributes.
* Extracts the read attributes qualities and stores them into a Map. * 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 * @author CLAISSE
*/ */
public class AttributeQualityRegister implements IAttributeQualityRegister public class AttributeQualityRegister implements IAttributeQualityRegister {
{
/** /**
* An attribute complete name-->quality mapping * An attribute complete name-->quality mapping
*/ */
...@@ -46,23 +23,19 @@ public class AttributeQualityRegister implements IAttributeQualityRegister ...@@ -46,23 +23,19 @@ public class AttributeQualityRegister implements IAttributeQualityRegister
/** /**
* *
*/ */
public AttributeQualityRegister () public AttributeQualityRegister() {
{
this.qualities = new Hashtable<String, AttrQualityWrapper>(); this.qualities = new Hashtable<String, AttrQualityWrapper>();
} }
public void registerAttributeQuality(String deviceName, DeviceAttributeWrapper attribute) @Override
{ public void registerAttributeQuality(String deviceName, DeviceAttributeWrapper attribute) {
AttrQualityWrapper quality = null; AttrQualityWrapper quality = null;
String attributeName = null; String attributeName = null;
try try {
{
attributeName = attribute.getName(); attributeName = attribute.getName();
quality = new AttrQualityWrapper(attribute.getQuality()); quality = new AttrQualityWrapper(attribute.getQuality());
} } catch (Throwable e) {
catch (Throwable e)
{
quality = new AttrQualityWrapper(AttrQualityWrapper.ATTR_INVALID); quality = new AttrQualityWrapper(AttrQualityWrapper.ATTR_INVALID);
} }
...@@ -71,13 +44,12 @@ public class AttributeQualityRegister implements IAttributeQualityRegister ...@@ -71,13 +44,12 @@ public class AttributeQualityRegister implements IAttributeQualityRegister
/** /**
* Stores the quality of the specified attribute * Stores the quality of the specified attribute
*
* @param attributeName The attribute's complete name * @param attributeName The attribute's complete name
* @param quality The attribute's quality * @param quality The attribute's quality
*/ */
private void setQuality ( String attributeName , AttrQualityWrapper quality ) private void setQuality(String attributeName, AttrQualityWrapper quality) {
{ synchronized (this) {
synchronized ( this )
{
this.qualities.put(attributeName, quality); this.qualities.put(attributeName, quality);
} }
} }
...@@ -85,16 +57,16 @@ public class AttributeQualityRegister implements IAttributeQualityRegister ...@@ -85,16 +57,16 @@ public class AttributeQualityRegister implements IAttributeQualityRegister
/* (non-Javadoc) /* (non-Javadoc)
* @see fr.soleil.core.groupactions.apis.listener.attributes.read.quality.IAttributeQualityReader#getQualities() * @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; return qualities;
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see fr.soleil.core.groupactions.apis.listener.attributes.read.quality.IAttributeQualityReader#getQuality(java.lang.String) * @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); 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; package fr.soleil.actiongroup.collectiveaction.components.singleactioncompletelistener.extraction.qualities;
import java.util.Map; import java.util.Map;
...@@ -31,28 +7,28 @@ import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.DeviceAtt ...@@ -31,28 +7,28 @@ import fr.soleil.actiongroup.collectiveaction.components.tangowrapping.DeviceAtt
/** /**
* A do-nothing implementation * A do-nothing implementation
*
* @author CLAISSE * @author CLAISSE
*/ */
public class DoNothingAttributeQualityRegister implements IAttributeQualityRegister public class DoNothingAttributeQualityRegister implements IAttributeQualityRegister {
{
/* (non-Javadoc) /* (non-Javadoc)
* @see fr.soleil.core.groupactions.apis.listener.attributes.read.quality.IAttributeQualityReader#getQualities() * @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; return null;
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see fr.soleil.core.groupactions.apis.listener.attributes.read.quality.IAttributeQualityReader#getQuality(java.lang.String) * @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; return null;
} }
public void registerAttributeQuality(String deviceName, DeviceAttributeWrapper attribute) @Override
{ public void registerAttributeQuality(String deviceName, DeviceAttributeWrapper attribute) {
} }
} }
...@@ -122,7 +122,7 @@ public class DeviceAttributeWrapper { ...@@ -122,7 +122,7 @@ public class DeviceAttributeWrapper {
return this.attribute.getQuality(); return this.attribute.getQuality();
} }
public DevState[] extractDevStateArray() throws DevFailed { public DevState extractState() throws DevFailed {
return attribute.extractDevStateArray(); return attribute.extractState();
} }
} }