}
protected void SetHooks(IScanAddOns sao, DeviceProxy scanServerProxy) throws DevFailed {
Stage[] stages = Stage.values();
for (int i = 0; i < stages.length; i++) {
Stage stage = stages[i];
String attributeName = getStageAttributeName(stage);
String[] commandsTab = new String[0];
DeviceAttribute da = new DeviceAttribute(attributeName);
da.insert(commandsTab);
scanServerProxy.write_attribute(da);
}
if (sao != null && sao.getHooks() != null) {
List<IHook> hooks = sao.getHooks();
for (IHook h : hooks) {
Stage stage = h.getStage();
String attributeName = getStageAttributeName(stage);
if (attributeName != null) {
List<String> commands = new ArrayList<String>();
if (h.getCommandsList() == null) {
continue;