id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
140,200
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Command.java
Command.insert
public Any insert(boolean data) throws DevFailed { Any out_any = alloc_any(); out_any.insert_boolean(data); return out_any; }
java
public Any insert(boolean data) throws DevFailed { Any out_any = alloc_any(); out_any.insert_boolean(data); return out_any; }
[ "public", "Any", "insert", "(", "boolean", "data", ")", "throws", "DevFailed", "{", "Any", "out_any", "=", "alloc_any", "(", ")", ";", "out_any", ".", "insert_boolean", "(", "data", ")", ";", "return", "out_any", ";", "}" ]
Create a CORBA Any object and insert a boolean data in it. @param data The boolean data to be inserted into the Any object @exception DevFailed If the Any object creation failed. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed">here</a> to read <b>DevFailed</b> exception specification
[ "Create", "a", "CORBA", "Any", "object", "and", "insert", "a", "boolean", "data", "in", "it", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Command.java#L410-L415
140,201
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Command.java
Command.insert
public Any insert(short data) throws DevFailed { Any out_any = alloc_any(); out_any.insert_short(data); return out_any; }
java
public Any insert(short data) throws DevFailed { Any out_any = alloc_any(); out_any.insert_short(data); return out_any; }
[ "public", "Any", "insert", "(", "short", "data", ")", "throws", "DevFailed", "{", "Any", "out_any", "=", "alloc_any", "(", ")", ";", "out_any", ".", "insert_short", "(", "data", ")", ";", "return", "out_any", ";", "}" ]
Create a CORBA Any object and insert a short data in it. @param data The short data to be inserted into the Any object @exception DevFailed If the Any object creation failed. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed">here</a> to read <b>DevFailed</b> exception specification
[ "Create", "a", "CORBA", "Any", "object", "and", "insert", "a", "short", "data", "in", "it", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Command.java#L426-L431
140,202
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Command.java
Command.insert
public Any insert(int data) throws DevFailed { Any out_any = alloc_any(); out_any.insert_long(data); return out_any; }
java
public Any insert(int data) throws DevFailed { Any out_any = alloc_any(); out_any.insert_long(data); return out_any; }
[ "public", "Any", "insert", "(", "int", "data", ")", "throws", "DevFailed", "{", "Any", "out_any", "=", "alloc_any", "(", ")", ";", "out_any", ".", "insert_long", "(", "data", ")", ";", "return", "out_any", ";", "}" ]
Create a CORBA Any object and insert an int data in it. @param data The int data to be inserted into the Any object @exception DevFailed If the Any object creation failed. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed">here</a> to read <b>DevFailed</b> exception specification
[ "Create", "a", "CORBA", "Any", "object", "and", "insert", "an", "int", "data", "in", "it", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Command.java#L459-L464
140,203
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Command.java
Command.insert
public Any insert(float data) throws DevFailed { Any out_any = alloc_any(); out_any.insert_float(data); return out_any; }
java
public Any insert(float data) throws DevFailed { Any out_any = alloc_any(); out_any.insert_float(data); return out_any; }
[ "public", "Any", "insert", "(", "float", "data", ")", "throws", "DevFailed", "{", "Any", "out_any", "=", "alloc_any", "(", ")", ";", "out_any", ".", "insert_float", "(", "data", ")", ";", "return", "out_any", ";", "}" ]
Create a CORBA Any object and insert a float data in it. @param data The float data to be inserted into the Any object @exception DevFailed If the Any object creation failed. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed">here</a> to read <b>DevFailed</b> exception specification
[ "Create", "a", "CORBA", "Any", "object", "and", "insert", "a", "float", "data", "in", "it", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Command.java#L524-L529
140,204
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Command.java
Command.insert
public Any insert(double data) throws DevFailed { Any out_any = alloc_any(); out_any.insert_double(data); return out_any; }
java
public Any insert(double data) throws DevFailed { Any out_any = alloc_any(); out_any.insert_double(data); return out_any; }
[ "public", "Any", "insert", "(", "double", "data", ")", "throws", "DevFailed", "{", "Any", "out_any", "=", "alloc_any", "(", ")", ";", "out_any", ".", "insert_double", "(", "data", ")", ";", "return", "out_any", ";", "}" ]
Create a CORBA Any object and insert a double data in it. @param data The double data to be inserted into the Any object @exception DevFailed If the Any object creation failed. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed">here</a> to read <b>DevFailed</b> exception specification
[ "Create", "a", "CORBA", "Any", "object", "and", "insert", "a", "double", "data", "in", "it", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Command.java#L540-L545
140,205
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Command.java
Command.insert
public Any insert(String data) throws DevFailed { Any out_any = alloc_any(); out_any.insert_string(data); return out_any; }
java
public Any insert(String data) throws DevFailed { Any out_any = alloc_any(); out_any.insert_string(data); return out_any; }
[ "public", "Any", "insert", "(", "String", "data", ")", "throws", "DevFailed", "{", "Any", "out_any", "=", "alloc_any", "(", ")", ";", "out_any", ".", "insert_string", "(", "data", ")", ";", "return", "out_any", ";", "}" ]
Create a CORBA Any object and insert a String in it. @param data The String to be inserted into the Any object @exception DevFailed If the Any object creation failed. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed">here</a> to read <b>DevFailed</b> exception specification
[ "Create", "a", "CORBA", "Any", "object", "and", "insert", "a", "String", "in", "it", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Command.java#L556-L561
140,206
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Command.java
Command.insert
public Any insert(byte[] data) throws DevFailed { Any out_any = alloc_any(); DevVarCharArrayHelper.insert(out_any,data); return out_any; }
java
public Any insert(byte[] data) throws DevFailed { Any out_any = alloc_any(); DevVarCharArrayHelper.insert(out_any,data); return out_any; }
[ "public", "Any", "insert", "(", "byte", "[", "]", "data", ")", "throws", "DevFailed", "{", "Any", "out_any", "=", "alloc_any", "(", ")", ";", "DevVarCharArrayHelper", ".", "insert", "(", "out_any", ",", "data", ")", ";", "return", "out_any", ";", "}" ]
Create a CORBA Any object and insert a byte array in it. @param data The byte array to be inserted into the Any object @exception DevFailed If the Any object creation failed. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed">here</a> to read <b>DevFailed</b> exception specification
[ "Create", "a", "CORBA", "Any", "object", "and", "insert", "a", "byte", "array", "in", "it", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Command.java#L572-L577
140,207
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Command.java
Command.insert
public Any insert(short[] data) throws DevFailed { Any out_any = alloc_any(); DevVarShortArrayHelper.insert(out_any,data); return out_any; }
java
public Any insert(short[] data) throws DevFailed { Any out_any = alloc_any(); DevVarShortArrayHelper.insert(out_any,data); return out_any; }
[ "public", "Any", "insert", "(", "short", "[", "]", "data", ")", "throws", "DevFailed", "{", "Any", "out_any", "=", "alloc_any", "(", ")", ";", "DevVarShortArrayHelper", ".", "insert", "(", "out_any", ",", "data", ")", ";", "return", "out_any", ";", "}" ]
Create a CORBA Any object and insert a short array in it. @param data The short array to be inserted into the Any object @exception DevFailed If the Any object creation failed. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed">here</a> to read <b>DevFailed</b> exception specification
[ "Create", "a", "CORBA", "Any", "object", "and", "insert", "a", "short", "array", "in", "it", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Command.java#L588-L593
140,208
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Command.java
Command.insert
public Any insert(int[] data) throws DevFailed { Any out_any = alloc_any(); DevVarLongArrayHelper.insert(out_any,data); return out_any; }
java
public Any insert(int[] data) throws DevFailed { Any out_any = alloc_any(); DevVarLongArrayHelper.insert(out_any,data); return out_any; }
[ "public", "Any", "insert", "(", "int", "[", "]", "data", ")", "throws", "DevFailed", "{", "Any", "out_any", "=", "alloc_any", "(", ")", ";", "DevVarLongArrayHelper", ".", "insert", "(", "out_any", ",", "data", ")", ";", "return", "out_any", ";", "}" ]
Create a CORBA Any object and insert a int array in it. @param data The int array to be inserted into the Any object @exception DevFailed If the Any object creation failed. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed">here</a> to read <b>DevFailed</b> exception specification
[ "Create", "a", "CORBA", "Any", "object", "and", "insert", "a", "int", "array", "in", "it", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Command.java#L621-L626
140,209
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Command.java
Command.insert
public Any insert(float[] data) throws DevFailed { Any out_any = alloc_any(); DevVarFloatArrayHelper.insert(out_any,data); return out_any; }
java
public Any insert(float[] data) throws DevFailed { Any out_any = alloc_any(); DevVarFloatArrayHelper.insert(out_any,data); return out_any; }
[ "public", "Any", "insert", "(", "float", "[", "]", "data", ")", "throws", "DevFailed", "{", "Any", "out_any", "=", "alloc_any", "(", ")", ";", "DevVarFloatArrayHelper", ".", "insert", "(", "out_any", ",", "data", ")", ";", "return", "out_any", ";", "}" ]
Create a CORBA Any object and insert a float array in it. @param data The float array to be inserted into the Any object @exception DevFailed If the Any object creation failed. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed">here</a> to read <b>DevFailed</b> exception specification
[ "Create", "a", "CORBA", "Any", "object", "and", "insert", "a", "float", "array", "in", "it", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Command.java#L688-L693
140,210
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Command.java
Command.insert
public Any insert(double[] data) throws DevFailed { Any out_any = alloc_any(); DevVarDoubleArrayHelper.insert(out_any,data); return out_any; }
java
public Any insert(double[] data) throws DevFailed { Any out_any = alloc_any(); DevVarDoubleArrayHelper.insert(out_any,data); return out_any; }
[ "public", "Any", "insert", "(", "double", "[", "]", "data", ")", "throws", "DevFailed", "{", "Any", "out_any", "=", "alloc_any", "(", ")", ";", "DevVarDoubleArrayHelper", ".", "insert", "(", "out_any", ",", "data", ")", ";", "return", "out_any", ";", "}" ]
Create a CORBA Any object and insert a double array in it. @param data The double array to be inserted into the Any object @exception DevFailed If the Any object creation failed. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed">here</a> to read <b>DevFailed</b> exception specification
[ "Create", "a", "CORBA", "Any", "object", "and", "insert", "a", "double", "array", "in", "it", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Command.java#L704-L709
140,211
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Command.java
Command.insert
public Any insert(String[] data) throws DevFailed { Any out_any = alloc_any(); DevVarStringArrayHelper.insert(out_any,data); return out_any; }
java
public Any insert(String[] data) throws DevFailed { Any out_any = alloc_any(); DevVarStringArrayHelper.insert(out_any,data); return out_any; }
[ "public", "Any", "insert", "(", "String", "[", "]", "data", ")", "throws", "DevFailed", "{", "Any", "out_any", "=", "alloc_any", "(", ")", ";", "DevVarStringArrayHelper", ".", "insert", "(", "out_any", ",", "data", ")", ";", "return", "out_any", ";", "}" ]
Create a CORBA Any object and insert a String array in it. @param data The String array to be inserted into the Any object @exception DevFailed If the Any object creation failed. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed">here</a> to read <b>DevFailed</b> exception specification
[ "Create", "a", "CORBA", "Any", "object", "and", "insert", "a", "String", "array", "in", "it", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Command.java#L720-L725
140,212
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Command.java
Command.insert
public Any insert(DevVarLongStringArray data) throws DevFailed { Any out_any = alloc_any(); DevVarLongStringArrayHelper.insert(out_any,data); return out_any; }
java
public Any insert(DevVarLongStringArray data) throws DevFailed { Any out_any = alloc_any(); DevVarLongStringArrayHelper.insert(out_any,data); return out_any; }
[ "public", "Any", "insert", "(", "DevVarLongStringArray", "data", ")", "throws", "DevFailed", "{", "Any", "out_any", "=", "alloc_any", "(", ")", ";", "DevVarLongStringArrayHelper", ".", "insert", "(", "out_any", ",", "data", ")", ";", "return", "out_any", ";", "}" ]
Create a CORBA Any object and insert a DevVarLongStringArray type in it. @param data The data to be inserted into the Any object @exception DevFailed If the Any object creation failed. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed">here</a> to read <b>DevFailed</b> exception specification
[ "Create", "a", "CORBA", "Any", "object", "and", "insert", "a", "DevVarLongStringArray", "type", "in", "it", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Command.java#L736-L741
140,213
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Command.java
Command.insert
public Any insert(DevVarDoubleStringArray data) throws DevFailed { Any out_any = alloc_any(); DevVarDoubleStringArrayHelper.insert(out_any,data); return out_any; }
java
public Any insert(DevVarDoubleStringArray data) throws DevFailed { Any out_any = alloc_any(); DevVarDoubleStringArrayHelper.insert(out_any,data); return out_any; }
[ "public", "Any", "insert", "(", "DevVarDoubleStringArray", "data", ")", "throws", "DevFailed", "{", "Any", "out_any", "=", "alloc_any", "(", ")", ";", "DevVarDoubleStringArrayHelper", ".", "insert", "(", "out_any", ",", "data", ")", ";", "return", "out_any", ";", "}" ]
Create a CORBA Any object and insert a DevVarDoubleStringArray type in it. @param data The data to be inserted into the Any object @exception DevFailed If the Any object creation failed. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed">here</a> to read <b>DevFailed</b> exception specification
[ "Create", "a", "CORBA", "Any", "object", "and", "insert", "a", "DevVarDoubleStringArray", "type", "in", "it", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Command.java#L753-L758
140,214
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Command.java
Command.insert
public Any insert(DevState data) throws DevFailed { Any out_any = alloc_any(); DevStateHelper.insert(out_any,data); return out_any; }
java
public Any insert(DevState data) throws DevFailed { Any out_any = alloc_any(); DevStateHelper.insert(out_any,data); return out_any; }
[ "public", "Any", "insert", "(", "DevState", "data", ")", "throws", "DevFailed", "{", "Any", "out_any", "=", "alloc_any", "(", ")", ";", "DevStateHelper", ".", "insert", "(", "out_any", ",", "data", ")", ";", "return", "out_any", ";", "}" ]
Create a CORBA Any object and insert a device state in it. @param data The device state to be inserted into the Any object @exception DevFailed If the Any object creation failed. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed">here</a> to read <b>DevFailed</b> exception specification
[ "Create", "a", "CORBA", "Any", "object", "and", "insert", "a", "device", "state", "in", "it", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Command.java#L770-L775
140,215
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Command.java
Command.extract_DevBoolean
public boolean extract_DevBoolean(Any in) throws DevFailed { boolean data = false; try { data = in.extract_boolean(); } catch (BAD_OPERATION ex) { throw_bad_type("DevBoolean"); } return data; }
java
public boolean extract_DevBoolean(Any in) throws DevFailed { boolean data = false; try { data = in.extract_boolean(); } catch (BAD_OPERATION ex) { throw_bad_type("DevBoolean"); } return data; }
[ "public", "boolean", "extract_DevBoolean", "(", "Any", "in", ")", "throws", "DevFailed", "{", "boolean", "data", "=", "false", ";", "try", "{", "data", "=", "in", ".", "extract_boolean", "(", ")", ";", "}", "catch", "(", "BAD_OPERATION", "ex", ")", "{", "throw_bad_type", "(", "\"DevBoolean\"", ")", ";", "}", "return", "data", ";", "}" ]
Extract a boolean data from a CORBA Any object. @param in The CORBA Any object @return The extracted boolean data @exception DevFailed If the Any object does not contains a data of the waited type. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed">here</a> to read <b>DevFailed</b> exception specification
[ "Extract", "a", "boolean", "data", "from", "a", "CORBA", "Any", "object", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Command.java#L802-L814
140,216
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Command.java
Command.extract_DevShort
public short extract_DevShort(Any in) throws DevFailed { short data = 0; try { data = in.extract_short(); } catch (BAD_OPERATION ex) { throw_bad_type("DevShort"); } return data; }
java
public short extract_DevShort(Any in) throws DevFailed { short data = 0; try { data = in.extract_short(); } catch (BAD_OPERATION ex) { throw_bad_type("DevShort"); } return data; }
[ "public", "short", "extract_DevShort", "(", "Any", "in", ")", "throws", "DevFailed", "{", "short", "data", "=", "0", ";", "try", "{", "data", "=", "in", ".", "extract_short", "(", ")", ";", "}", "catch", "(", "BAD_OPERATION", "ex", ")", "{", "throw_bad_type", "(", "\"DevShort\"", ")", ";", "}", "return", "data", ";", "}" ]
Extract a short data from a CORBA Any object. @param in The CORBA Any object @return The extracted short data @exception DevFailed If the Any object does not contains a data of the waited type. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed">here</a> to read <b>DevFailed</b> exception specification
[ "Extract", "a", "short", "data", "from", "a", "CORBA", "Any", "object", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Command.java#L827-L839
140,217
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Command.java
Command.extract_DevFloat
public float extract_DevFloat(Any in) throws DevFailed { float data = 0; try { data = in.extract_float(); } catch (BAD_OPERATION ex) { throw_bad_type("DevFloat"); } return data; }
java
public float extract_DevFloat(Any in) throws DevFailed { float data = 0; try { data = in.extract_float(); } catch (BAD_OPERATION ex) { throw_bad_type("DevFloat"); } return data; }
[ "public", "float", "extract_DevFloat", "(", "Any", "in", ")", "throws", "DevFailed", "{", "float", "data", "=", "0", ";", "try", "{", "data", "=", "in", ".", "extract_float", "(", ")", ";", "}", "catch", "(", "BAD_OPERATION", "ex", ")", "{", "throw_bad_type", "(", "\"DevFloat\"", ")", ";", "}", "return", "data", ";", "}" ]
Extract a float data from a CORBA Any object. @param in The CORBA Any object @return The extracted float data @exception DevFailed If the Any object does not contains a data of the waited type. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed">here</a> to read <b>DevFailed</b> exception specification
[ "Extract", "a", "float", "data", "from", "a", "CORBA", "Any", "object", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Command.java#L904-L916
140,218
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Command.java
Command.extract_DevDouble
public double extract_DevDouble(Any in) throws DevFailed { double data = 0; try { data = in.extract_double(); } catch (BAD_OPERATION ex) { throw_bad_type("DevDouble"); } return data; }
java
public double extract_DevDouble(Any in) throws DevFailed { double data = 0; try { data = in.extract_double(); } catch (BAD_OPERATION ex) { throw_bad_type("DevDouble"); } return data; }
[ "public", "double", "extract_DevDouble", "(", "Any", "in", ")", "throws", "DevFailed", "{", "double", "data", "=", "0", ";", "try", "{", "data", "=", "in", ".", "extract_double", "(", ")", ";", "}", "catch", "(", "BAD_OPERATION", "ex", ")", "{", "throw_bad_type", "(", "\"DevDouble\"", ")", ";", "}", "return", "data", ";", "}" ]
Extract a double data from a CORBA Any object. @param in The CORBA Any object @return The extracted double data @exception DevFailed If the Any object does not contains a data of the waited type. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed">here</a> to read <b>DevFailed</b> exception specification
[ "Extract", "a", "double", "data", "from", "a", "CORBA", "Any", "object", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Command.java#L929-L941
140,219
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Command.java
Command.extract_DevString
public String extract_DevString(Any in) throws DevFailed { String data = null; try { //data = in.extract_string(); data = DevStringHelper.extract(in); } catch (BAD_OPERATION ex) { throw_bad_type("DevString"); } return data; }
java
public String extract_DevString(Any in) throws DevFailed { String data = null; try { //data = in.extract_string(); data = DevStringHelper.extract(in); } catch (BAD_OPERATION ex) { throw_bad_type("DevString"); } return data; }
[ "public", "String", "extract_DevString", "(", "Any", "in", ")", "throws", "DevFailed", "{", "String", "data", "=", "null", ";", "try", "{", "//data = in.extract_string();", "data", "=", "DevStringHelper", ".", "extract", "(", "in", ")", ";", "}", "catch", "(", "BAD_OPERATION", "ex", ")", "{", "throw_bad_type", "(", "\"DevString\"", ")", ";", "}", "return", "data", ";", "}" ]
Extract a String from a CORBA Any object. @param in The CORBA Any object @return The extracted String @exception DevFailed If the Any object does not contains a data of the waited type. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed">here</a> to read <b>DevFailed</b> exception specification
[ "Extract", "a", "String", "from", "a", "CORBA", "Any", "object", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Command.java#L954-L967
140,220
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Command.java
Command.extract_DevUShort
public short extract_DevUShort(Any in) throws DevFailed { short data = 0; try { data = in.extract_ushort(); } catch (BAD_OPERATION ex) { throw_bad_type("DevUShort"); } return data; }
java
public short extract_DevUShort(Any in) throws DevFailed { short data = 0; try { data = in.extract_ushort(); } catch (BAD_OPERATION ex) { throw_bad_type("DevUShort"); } return data; }
[ "public", "short", "extract_DevUShort", "(", "Any", "in", ")", "throws", "DevFailed", "{", "short", "data", "=", "0", ";", "try", "{", "data", "=", "in", ".", "extract_ushort", "(", ")", ";", "}", "catch", "(", "BAD_OPERATION", "ex", ")", "{", "throw_bad_type", "(", "\"DevUShort\"", ")", ";", "}", "return", "data", ";", "}" ]
Extract a DevUShort data from a CORBA Any object. Remenber that the TANGO DevUShort type is mapped to the java int type @param in The CORBA Any object @return The extracted boolean data @exception DevFailed If the Any object does not contains a data of the waited type. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed">here</a> to read <b>DevFailed</b> exception specification
[ "Extract", "a", "DevUShort", "data", "from", "a", "CORBA", "Any", "object", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Command.java#L981-L993
140,221
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Command.java
Command.extract_DevVarCharArray
public byte[] extract_DevVarCharArray(Any in) throws DevFailed { byte[] data = null; try { data = DevVarCharArrayHelper.extract(in); } catch (BAD_OPERATION ex) { throw_bad_type("DevVarCharArray"); } return data; }
java
public byte[] extract_DevVarCharArray(Any in) throws DevFailed { byte[] data = null; try { data = DevVarCharArrayHelper.extract(in); } catch (BAD_OPERATION ex) { throw_bad_type("DevVarCharArray"); } return data; }
[ "public", "byte", "[", "]", "extract_DevVarCharArray", "(", "Any", "in", ")", "throws", "DevFailed", "{", "byte", "[", "]", "data", "=", "null", ";", "try", "{", "data", "=", "DevVarCharArrayHelper", ".", "extract", "(", "in", ")", ";", "}", "catch", "(", "BAD_OPERATION", "ex", ")", "{", "throw_bad_type", "(", "\"DevVarCharArray\"", ")", ";", "}", "return", "data", ";", "}" ]
Extract a byte array from a CORBA Any object. @param in The CORBA Any object @return The extracted byte array @exception DevFailed If the Any object does not contains a data of the waited type. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed">here</a> to read <b>DevFailed</b> exception specification
[ "Extract", "a", "byte", "array", "from", "a", "CORBA", "Any", "object", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Command.java#L1058-L1070
140,222
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Command.java
Command.extract_DevVarShortArray
public short[] extract_DevVarShortArray(Any in) throws DevFailed { short[] data = null; try { data = DevVarShortArrayHelper.extract(in); } catch (BAD_OPERATION ex) { throw_bad_type("DevVarShortArray"); } return data; }
java
public short[] extract_DevVarShortArray(Any in) throws DevFailed { short[] data = null; try { data = DevVarShortArrayHelper.extract(in); } catch (BAD_OPERATION ex) { throw_bad_type("DevVarShortArray"); } return data; }
[ "public", "short", "[", "]", "extract_DevVarShortArray", "(", "Any", "in", ")", "throws", "DevFailed", "{", "short", "[", "]", "data", "=", "null", ";", "try", "{", "data", "=", "DevVarShortArrayHelper", ".", "extract", "(", "in", ")", ";", "}", "catch", "(", "BAD_OPERATION", "ex", ")", "{", "throw_bad_type", "(", "\"DevVarShortArray\"", ")", ";", "}", "return", "data", ";", "}" ]
Extract a short array from a CORBA Any object. @param in The CORBA Any object @return The extracted short array @exception DevFailed If the Any object does not contains a data of the waited type. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed">here</a> to read <b>DevFailed</b> exception specification
[ "Extract", "a", "short", "array", "from", "a", "CORBA", "Any", "object", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Command.java#L1083-L1095
140,223
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Command.java
Command.extract_DevVarFloatArray
public float[] extract_DevVarFloatArray(Any in) throws DevFailed { float[] data = null; try { data = DevVarFloatArrayHelper.extract(in); } catch (BAD_OPERATION ex) { throw_bad_type("DevVarFloatArray"); } return data; }
java
public float[] extract_DevVarFloatArray(Any in) throws DevFailed { float[] data = null; try { data = DevVarFloatArrayHelper.extract(in); } catch (BAD_OPERATION ex) { throw_bad_type("DevVarFloatArray"); } return data; }
[ "public", "float", "[", "]", "extract_DevVarFloatArray", "(", "Any", "in", ")", "throws", "DevFailed", "{", "float", "[", "]", "data", "=", "null", ";", "try", "{", "data", "=", "DevVarFloatArrayHelper", ".", "extract", "(", "in", ")", ";", "}", "catch", "(", "BAD_OPERATION", "ex", ")", "{", "throw_bad_type", "(", "\"DevVarFloatArray\"", ")", ";", "}", "return", "data", ";", "}" ]
Extract a float array from a CORBA Any object. @param in The CORBA Any object @return The extracted float array @exception DevFailed If the Any object does not contains a data of the waited type. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed">here</a> to read <b>DevFailed</b> exception specification
[ "Extract", "a", "float", "array", "from", "a", "CORBA", "Any", "object", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Command.java#L1216-L1228
140,224
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Command.java
Command.extract_DevVarDoubleArray
public double[] extract_DevVarDoubleArray(Any in) throws DevFailed { double[] data = null; try { data = DevVarDoubleArrayHelper.extract(in); } catch (BAD_OPERATION ex) { throw_bad_type("DevVarDoubleArray"); } return data; }
java
public double[] extract_DevVarDoubleArray(Any in) throws DevFailed { double[] data = null; try { data = DevVarDoubleArrayHelper.extract(in); } catch (BAD_OPERATION ex) { throw_bad_type("DevVarDoubleArray"); } return data; }
[ "public", "double", "[", "]", "extract_DevVarDoubleArray", "(", "Any", "in", ")", "throws", "DevFailed", "{", "double", "[", "]", "data", "=", "null", ";", "try", "{", "data", "=", "DevVarDoubleArrayHelper", ".", "extract", "(", "in", ")", ";", "}", "catch", "(", "BAD_OPERATION", "ex", ")", "{", "throw_bad_type", "(", "\"DevVarDoubleArray\"", ")", ";", "}", "return", "data", ";", "}" ]
Extract a double array from a CORBA Any object. @param in The CORBA Any object @return The extracted double array @exception DevFailed If the Any object does not contains a data of the waited type. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed">here</a> to read <b>DevFailed</b> exception specification
[ "Extract", "a", "double", "array", "from", "a", "CORBA", "Any", "object", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Command.java#L1241-L1253
140,225
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Command.java
Command.extract_DevVarUShortArray
public short[] extract_DevVarUShortArray(Any in) throws DevFailed { short[] data = null; try { data = DevVarUShortArrayHelper.extract(in); } catch (BAD_OPERATION ex) { throw_bad_type("DevVarUShortArray"); } return data; }
java
public short[] extract_DevVarUShortArray(Any in) throws DevFailed { short[] data = null; try { data = DevVarUShortArrayHelper.extract(in); } catch (BAD_OPERATION ex) { throw_bad_type("DevVarUShortArray"); } return data; }
[ "public", "short", "[", "]", "extract_DevVarUShortArray", "(", "Any", "in", ")", "throws", "DevFailed", "{", "short", "[", "]", "data", "=", "null", ";", "try", "{", "data", "=", "DevVarUShortArrayHelper", ".", "extract", "(", "in", ")", ";", "}", "catch", "(", "BAD_OPERATION", "ex", ")", "{", "throw_bad_type", "(", "\"DevVarUShortArray\"", ")", ";", "}", "return", "data", ";", "}" ]
Extract a DevVarUShortArray type from a CORBA Any object. Remenber that the TANGO DevVarUShortArray type is mapped to the java short array type @param in The CORBA Any object @return The extracted short array @exception DevFailed If the Any object does not contains a data of the waited type. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed">here</a> to read <b>DevFailed</b> exception specification
[ "Extract", "a", "DevVarUShortArray", "type", "from", "a", "CORBA", "Any", "object", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Command.java#L1268-L1280
140,226
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Command.java
Command.extract_DevVarStringArray
public String[] extract_DevVarStringArray(Any in) throws DevFailed { String[] data = null; try { data = DevVarStringArrayHelper.extract(in); } catch (BAD_OPERATION ex) { throw_bad_type("DevVarStringArray"); } return data; }
java
public String[] extract_DevVarStringArray(Any in) throws DevFailed { String[] data = null; try { data = DevVarStringArrayHelper.extract(in); } catch (BAD_OPERATION ex) { throw_bad_type("DevVarStringArray"); } return data; }
[ "public", "String", "[", "]", "extract_DevVarStringArray", "(", "Any", "in", ")", "throws", "DevFailed", "{", "String", "[", "]", "data", "=", "null", ";", "try", "{", "data", "=", "DevVarStringArrayHelper", ".", "extract", "(", "in", ")", ";", "}", "catch", "(", "BAD_OPERATION", "ex", ")", "{", "throw_bad_type", "(", "\"DevVarStringArray\"", ")", ";", "}", "return", "data", ";", "}" ]
Extract a DevVarStringArray type from a CORBA Any object. @param in The CORBA Any object @return The extracted String array @exception DevFailed If the Any object does not contains a data of the waited type. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed">here</a> to read <b>DevFailed</b> exception specification
[ "Extract", "a", "DevVarStringArray", "type", "from", "a", "CORBA", "Any", "object", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Command.java#L1293-L1305
140,227
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Command.java
Command.extract_DevVarLongStringArray
public DevVarLongStringArray extract_DevVarLongStringArray(Any in) throws DevFailed { DevVarLongStringArray data = null; try { data = DevVarLongStringArrayHelper.extract(in); } catch (BAD_OPERATION ex) { throw_bad_type("DevVarLongStringArray"); } return data; }
java
public DevVarLongStringArray extract_DevVarLongStringArray(Any in) throws DevFailed { DevVarLongStringArray data = null; try { data = DevVarLongStringArrayHelper.extract(in); } catch (BAD_OPERATION ex) { throw_bad_type("DevVarLongStringArray"); } return data; }
[ "public", "DevVarLongStringArray", "extract_DevVarLongStringArray", "(", "Any", "in", ")", "throws", "DevFailed", "{", "DevVarLongStringArray", "data", "=", "null", ";", "try", "{", "data", "=", "DevVarLongStringArrayHelper", ".", "extract", "(", "in", ")", ";", "}", "catch", "(", "BAD_OPERATION", "ex", ")", "{", "throw_bad_type", "(", "\"DevVarLongStringArray\"", ")", ";", "}", "return", "data", ";", "}" ]
Extract a DevVarLongStringArray type from a CORBA Any object. @param in The CORBA Any object @return The extracted DevVarLongStringArray object @exception DevFailed If the Any object does not contains a data of the waited type. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed">here</a> to read <b>DevFailed</b> exception specification
[ "Extract", "a", "DevVarLongStringArray", "type", "from", "a", "CORBA", "Any", "object", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Command.java#L1318-L1330
140,228
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Command.java
Command.extract_DevVarDoubleStringArray
public DevVarDoubleStringArray extract_DevVarDoubleStringArray(Any in) throws DevFailed { DevVarDoubleStringArray data = null; try { data = DevVarDoubleStringArrayHelper.extract(in); } catch (BAD_OPERATION ex) { throw_bad_type("DevVarDoubleStringArray"); } return data; }
java
public DevVarDoubleStringArray extract_DevVarDoubleStringArray(Any in) throws DevFailed { DevVarDoubleStringArray data = null; try { data = DevVarDoubleStringArrayHelper.extract(in); } catch (BAD_OPERATION ex) { throw_bad_type("DevVarDoubleStringArray"); } return data; }
[ "public", "DevVarDoubleStringArray", "extract_DevVarDoubleStringArray", "(", "Any", "in", ")", "throws", "DevFailed", "{", "DevVarDoubleStringArray", "data", "=", "null", ";", "try", "{", "data", "=", "DevVarDoubleStringArrayHelper", ".", "extract", "(", "in", ")", ";", "}", "catch", "(", "BAD_OPERATION", "ex", ")", "{", "throw_bad_type", "(", "\"DevVarDoubleStringArray\"", ")", ";", "}", "return", "data", ";", "}" ]
Extract a DevVarDoubleStringArray type from a CORBA Any object. @param in The CORBA Any object @return The extracted DevVarDoubleStringArray object @exception DevFailed If the Any object does not contains a data of the waited type. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed">here</a> to read <b>DevFailed</b> exception specification
[ "Extract", "a", "DevVarDoubleStringArray", "type", "from", "a", "CORBA", "Any", "object", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Command.java#L1343-L1355
140,229
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Command.java
Command.extract_DevState
public DevState extract_DevState(Any in) throws DevFailed { DevState data = null; try { data = DevStateHelper.extract(in); } catch (BAD_OPERATION ex) { throw_bad_type("DevState"); } return data; }
java
public DevState extract_DevState(Any in) throws DevFailed { DevState data = null; try { data = DevStateHelper.extract(in); } catch (BAD_OPERATION ex) { throw_bad_type("DevState"); } return data; }
[ "public", "DevState", "extract_DevState", "(", "Any", "in", ")", "throws", "DevFailed", "{", "DevState", "data", "=", "null", ";", "try", "{", "data", "=", "DevStateHelper", ".", "extract", "(", "in", ")", ";", "}", "catch", "(", "BAD_OPERATION", "ex", ")", "{", "throw_bad_type", "(", "\"DevState\"", ")", ";", "}", "return", "data", ";", "}" ]
Extract a DevState type from a CORBA Any object. @param in The CORBA Any object @return The extracted DevState object @exception DevFailed If the Any object does not contains a data of the waited type. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed">here</a> to read <b>DevFailed</b> exception specification
[ "Extract", "a", "DevState", "type", "from", "a", "CORBA", "Any", "object", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Command.java#L1368-L1380
140,230
tango-controls/JTango
server/src/main/java/org/tango/server/events/EventImpl.java
EventImpl.pushAttributeValueEvent
protected void pushAttributeValueEvent(ZMQ.Socket eventSocket) throws DevFailed { xlogger.entry(); eventTrigger.setError(null); eventTrigger.updateProperties(); if (isSendEvent()) { sendAttributeValueEvent(eventSocket); } xlogger.exit(); }
java
protected void pushAttributeValueEvent(ZMQ.Socket eventSocket) throws DevFailed { xlogger.entry(); eventTrigger.setError(null); eventTrigger.updateProperties(); if (isSendEvent()) { sendAttributeValueEvent(eventSocket); } xlogger.exit(); }
[ "protected", "void", "pushAttributeValueEvent", "(", "ZMQ", ".", "Socket", "eventSocket", ")", "throws", "DevFailed", "{", "xlogger", ".", "entry", "(", ")", ";", "eventTrigger", ".", "setError", "(", "null", ")", ";", "eventTrigger", ".", "updateProperties", "(", ")", ";", "if", "(", "isSendEvent", "(", ")", ")", "{", "sendAttributeValueEvent", "(", "eventSocket", ")", ";", "}", "xlogger", ".", "exit", "(", ")", ";", "}" ]
Fire an event containing a value is condition is valid. @throws DevFailed @param eventSocket
[ "Fire", "an", "event", "containing", "a", "value", "is", "condition", "is", "valid", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/events/EventImpl.java#L129-L137
140,231
tango-controls/JTango
server/src/main/java/org/tango/server/events/EventImpl.java
EventImpl.pushAttributeDataReadyEvent
protected void pushAttributeDataReadyEvent(final int counter, ZMQ.Socket eventSocket) throws DevFailed { xlogger.entry(); try { final AttDataReady dataReady = new AttDataReady(attribute.getName(), attribute.getTangoType(), counter); synchronized (eventSocket) { EventUtilities.sendToSocket(eventSocket, fullName, counter, EventUtilities.marshall(dataReady)); } } catch (final org.zeromq.ZMQException e) { throw DevFailedUtils.newDevFailed(e); } xlogger.exit(); }
java
protected void pushAttributeDataReadyEvent(final int counter, ZMQ.Socket eventSocket) throws DevFailed { xlogger.entry(); try { final AttDataReady dataReady = new AttDataReady(attribute.getName(), attribute.getTangoType(), counter); synchronized (eventSocket) { EventUtilities.sendToSocket(eventSocket, fullName, counter, EventUtilities.marshall(dataReady)); } } catch (final org.zeromq.ZMQException e) { throw DevFailedUtils.newDevFailed(e); } xlogger.exit(); }
[ "protected", "void", "pushAttributeDataReadyEvent", "(", "final", "int", "counter", ",", "ZMQ", ".", "Socket", "eventSocket", ")", "throws", "DevFailed", "{", "xlogger", ".", "entry", "(", ")", ";", "try", "{", "final", "AttDataReady", "dataReady", "=", "new", "AttDataReady", "(", "attribute", ".", "getName", "(", ")", ",", "attribute", ".", "getTangoType", "(", ")", ",", "counter", ")", ";", "synchronized", "(", "eventSocket", ")", "{", "EventUtilities", ".", "sendToSocket", "(", "eventSocket", ",", "fullName", ",", "counter", ",", "EventUtilities", ".", "marshall", "(", "dataReady", ")", ")", ";", "}", "}", "catch", "(", "final", "org", ".", "zeromq", ".", "ZMQException", "e", ")", "{", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "e", ")", ";", "}", "xlogger", ".", "exit", "(", ")", ";", "}" ]
Send a data ready event @param counter a counter value @param eventSocket @throws DevFailed
[ "Send", "a", "data", "ready", "event" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/events/EventImpl.java#L183-L196
140,232
tango-controls/JTango
server/src/main/java/org/tango/server/events/EventImpl.java
EventImpl.pushDevFailedEvent
protected void pushDevFailedEvent(final DevFailed devFailed, ZMQ.Socket eventSocket) throws DevFailed { xlogger.entry(); eventTrigger.updateProperties(); eventTrigger.setError(devFailed); if (isSendEvent()) { try { synchronized (eventSocket) { EventUtilities.sendToSocket(eventSocket, fullName, counter++, true, EventUtilities.marshall(devFailed)); } } catch (final org.zeromq.ZMQException e) { throw DevFailedUtils.newDevFailed(e); } } xlogger.exit(); }
java
protected void pushDevFailedEvent(final DevFailed devFailed, ZMQ.Socket eventSocket) throws DevFailed { xlogger.entry(); eventTrigger.updateProperties(); eventTrigger.setError(devFailed); if (isSendEvent()) { try { synchronized (eventSocket) { EventUtilities.sendToSocket(eventSocket, fullName, counter++, true, EventUtilities.marshall(devFailed)); } } catch (final org.zeromq.ZMQException e) { throw DevFailedUtils.newDevFailed(e); } } xlogger.exit(); }
[ "protected", "void", "pushDevFailedEvent", "(", "final", "DevFailed", "devFailed", ",", "ZMQ", ".", "Socket", "eventSocket", ")", "throws", "DevFailed", "{", "xlogger", ".", "entry", "(", ")", ";", "eventTrigger", ".", "updateProperties", "(", ")", ";", "eventTrigger", ".", "setError", "(", "devFailed", ")", ";", "if", "(", "isSendEvent", "(", ")", ")", "{", "try", "{", "synchronized", "(", "eventSocket", ")", "{", "EventUtilities", ".", "sendToSocket", "(", "eventSocket", ",", "fullName", ",", "counter", "++", ",", "true", ",", "EventUtilities", ".", "marshall", "(", "devFailed", ")", ")", ";", "}", "}", "catch", "(", "final", "org", ".", "zeromq", ".", "ZMQException", "e", ")", "{", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "e", ")", ";", "}", "}", "xlogger", ".", "exit", "(", ")", ";", "}" ]
Fire an event containing a DevFailed. @param devFailed the failed object to be sent. @param eventSocket @throws DevFailed
[ "Fire", "an", "event", "containing", "a", "DevFailed", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/events/EventImpl.java#L261-L275
140,233
tango-controls/JTango
server/src/main/java/org/tango/server/events/EventImpl.java
EventImpl.isSendEvent
private boolean isSendEvent() throws DevFailed { boolean send = false; if ((eventTrigger.doCheck() && eventTrigger.isSendEvent()) || !eventTrigger.doCheck()) { send = true; } return send; }
java
private boolean isSendEvent() throws DevFailed { boolean send = false; if ((eventTrigger.doCheck() && eventTrigger.isSendEvent()) || !eventTrigger.doCheck()) { send = true; } return send; }
[ "private", "boolean", "isSendEvent", "(", ")", "throws", "DevFailed", "{", "boolean", "send", "=", "false", ";", "if", "(", "(", "eventTrigger", ".", "doCheck", "(", ")", "&&", "eventTrigger", ".", "isSendEvent", "(", ")", ")", "||", "!", "eventTrigger", ".", "doCheck", "(", ")", ")", "{", "send", "=", "true", ";", "}", "return", "send", ";", "}" ]
check if send event @return
[ "check", "if", "send", "event" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/events/EventImpl.java#L282-L288
140,234
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/SetLoggingLevelCmd.java
SetLoggingLevelCmd.execute
public Any execute(DeviceImpl device, Any in_any) throws DevFailed { Util.out4.println("SetLoggingLevelCmd::execute(): arrived"); DevVarLongStringArray dvlsa = null; try { dvlsa = extract_DevVarLongStringArray(in_any); } catch (DevFailed df) { Util.out3.println("SetLoggingLevelCmd::execute() --> Wrong argument type"); Except.re_throw_exception(df, "API_IncompatibleCmdArgumentType", "Imcompatible command argument type, expected type is : DevVarLongStringArray", "SetLoggingLevelCmd.execute"); } Logging.instance().set_logging_level(dvlsa); return Util.return_empty_any("SetLoggingLevel"); }
java
public Any execute(DeviceImpl device, Any in_any) throws DevFailed { Util.out4.println("SetLoggingLevelCmd::execute(): arrived"); DevVarLongStringArray dvlsa = null; try { dvlsa = extract_DevVarLongStringArray(in_any); } catch (DevFailed df) { Util.out3.println("SetLoggingLevelCmd::execute() --> Wrong argument type"); Except.re_throw_exception(df, "API_IncompatibleCmdArgumentType", "Imcompatible command argument type, expected type is : DevVarLongStringArray", "SetLoggingLevelCmd.execute"); } Logging.instance().set_logging_level(dvlsa); return Util.return_empty_any("SetLoggingLevel"); }
[ "public", "Any", "execute", "(", "DeviceImpl", "device", ",", "Any", "in_any", ")", "throws", "DevFailed", "{", "Util", ".", "out4", ".", "println", "(", "\"SetLoggingLevelCmd::execute(): arrived\"", ")", ";", "DevVarLongStringArray", "dvlsa", "=", "null", ";", "try", "{", "dvlsa", "=", "extract_DevVarLongStringArray", "(", "in_any", ")", ";", "}", "catch", "(", "DevFailed", "df", ")", "{", "Util", ".", "out3", ".", "println", "(", "\"SetLoggingLevelCmd::execute() --> Wrong argument type\"", ")", ";", "Except", ".", "re_throw_exception", "(", "df", ",", "\"API_IncompatibleCmdArgumentType\"", ",", "\"Imcompatible command argument type, expected type is : DevVarLongStringArray\"", ",", "\"SetLoggingLevelCmd.execute\"", ")", ";", "}", "Logging", ".", "instance", "(", ")", ".", "set_logging_level", "(", "dvlsa", ")", ";", "return", "Util", ".", "return_empty_any", "(", "\"SetLoggingLevel\"", ")", ";", "}" ]
Executes the SetLoggingLevelCmd TANGO command
[ "Executes", "the", "SetLoggingLevelCmd", "TANGO", "command" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/SetLoggingLevelCmd.java#L55-L74
140,235
tango-controls/JTango
server/src/main/java/org/tango/server/device/StatusImpl.java
StatusImpl.updateStatus
public String updateStatus(final DeviceState state) throws DevFailed { xlogger.entry(); if (getStatusMethod != null) { try { status = (String) getStatusMethod.invoke(businessObject); } catch (final IllegalArgumentException e) { throw DevFailedUtils.newDevFailed(e); } catch (final IllegalAccessException e) { throw DevFailedUtils.newDevFailed(e); } catch (final InvocationTargetException e) { if (e.getCause() instanceof DevFailed) { throw (DevFailed) e.getCause(); } else { throw DevFailedUtils.newDevFailed("INVOCATION_ERROR", ExceptionUtils.getStackTrace(e.getCause()) + " InvocationTargetException"); } } } else { if (status.isEmpty()) { status = "The device is in " + state + " state."; } } StringBuilder statusAlarm = new StringBuilder(); for (final String string : attributeAlarm.values()) { statusAlarm = statusAlarm.append(string); } return status + statusAlarm; }
java
public String updateStatus(final DeviceState state) throws DevFailed { xlogger.entry(); if (getStatusMethod != null) { try { status = (String) getStatusMethod.invoke(businessObject); } catch (final IllegalArgumentException e) { throw DevFailedUtils.newDevFailed(e); } catch (final IllegalAccessException e) { throw DevFailedUtils.newDevFailed(e); } catch (final InvocationTargetException e) { if (e.getCause() instanceof DevFailed) { throw (DevFailed) e.getCause(); } else { throw DevFailedUtils.newDevFailed("INVOCATION_ERROR", ExceptionUtils.getStackTrace(e.getCause()) + " InvocationTargetException"); } } } else { if (status.isEmpty()) { status = "The device is in " + state + " state."; } } StringBuilder statusAlarm = new StringBuilder(); for (final String string : attributeAlarm.values()) { statusAlarm = statusAlarm.append(string); } return status + statusAlarm; }
[ "public", "String", "updateStatus", "(", "final", "DeviceState", "state", ")", "throws", "DevFailed", "{", "xlogger", ".", "entry", "(", ")", ";", "if", "(", "getStatusMethod", "!=", "null", ")", "{", "try", "{", "status", "=", "(", "String", ")", "getStatusMethod", ".", "invoke", "(", "businessObject", ")", ";", "}", "catch", "(", "final", "IllegalArgumentException", "e", ")", "{", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "e", ")", ";", "}", "catch", "(", "final", "IllegalAccessException", "e", ")", "{", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "e", ")", ";", "}", "catch", "(", "final", "InvocationTargetException", "e", ")", "{", "if", "(", "e", ".", "getCause", "(", ")", "instanceof", "DevFailed", ")", "{", "throw", "(", "DevFailed", ")", "e", ".", "getCause", "(", ")", ";", "}", "else", "{", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "\"INVOCATION_ERROR\"", ",", "ExceptionUtils", ".", "getStackTrace", "(", "e", ".", "getCause", "(", ")", ")", "+", "\" InvocationTargetException\"", ")", ";", "}", "}", "}", "else", "{", "if", "(", "status", ".", "isEmpty", "(", ")", ")", "{", "status", "=", "\"The device is in \"", "+", "state", "+", "\" state.\"", ";", "}", "}", "StringBuilder", "statusAlarm", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "final", "String", "string", ":", "attributeAlarm", ".", "values", "(", ")", ")", "{", "statusAlarm", "=", "statusAlarm", ".", "append", "(", "string", ")", ";", "}", "return", "status", "+", "statusAlarm", ";", "}" ]
Get the status of the device @return the status @throws DevFailed
[ "Get", "the", "status", "of", "the", "device" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/device/StatusImpl.java#L81-L109
140,236
tango-controls/JTango
server/src/main/java/org/tango/server/device/StatusImpl.java
StatusImpl.statusMachine
public synchronized void statusMachine(final String status, final DeviceState state) throws DevFailed { if (status != null) { logger.debug("Changing status to: {}", status); this.status = status; if (setStatusMethod != null) { try { setStatusMethod.invoke(businessObject, status); } catch (final IllegalArgumentException e) { throw DevFailedUtils.newDevFailed(e); } catch (final IllegalAccessException e) { throw DevFailedUtils.newDevFailed(e); } catch (final InvocationTargetException e) { if (e.getCause() instanceof DevFailed) { throw (DevFailed) e.getCause(); } else { throw DevFailedUtils.newDevFailed(e.getCause()); } } } } }
java
public synchronized void statusMachine(final String status, final DeviceState state) throws DevFailed { if (status != null) { logger.debug("Changing status to: {}", status); this.status = status; if (setStatusMethod != null) { try { setStatusMethod.invoke(businessObject, status); } catch (final IllegalArgumentException e) { throw DevFailedUtils.newDevFailed(e); } catch (final IllegalAccessException e) { throw DevFailedUtils.newDevFailed(e); } catch (final InvocationTargetException e) { if (e.getCause() instanceof DevFailed) { throw (DevFailed) e.getCause(); } else { throw DevFailedUtils.newDevFailed(e.getCause()); } } } } }
[ "public", "synchronized", "void", "statusMachine", "(", "final", "String", "status", ",", "final", "DeviceState", "state", ")", "throws", "DevFailed", "{", "if", "(", "status", "!=", "null", ")", "{", "logger", ".", "debug", "(", "\"Changing status to: {}\"", ",", "status", ")", ";", "this", ".", "status", "=", "status", ";", "if", "(", "setStatusMethod", "!=", "null", ")", "{", "try", "{", "setStatusMethod", ".", "invoke", "(", "businessObject", ",", "status", ")", ";", "}", "catch", "(", "final", "IllegalArgumentException", "e", ")", "{", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "e", ")", ";", "}", "catch", "(", "final", "IllegalAccessException", "e", ")", "{", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "e", ")", ";", "}", "catch", "(", "final", "InvocationTargetException", "e", ")", "{", "if", "(", "e", ".", "getCause", "(", ")", "instanceof", "DevFailed", ")", "{", "throw", "(", "DevFailed", ")", "e", ".", "getCause", "(", ")", ";", "}", "else", "{", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "e", ".", "getCause", "(", ")", ")", ";", "}", "}", "}", "}", "}" ]
Change status of the device @param status @throws DevFailed
[ "Change", "status", "of", "the", "device" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/device/StatusImpl.java#L117-L137
140,237
tango-controls/JTango
server/src/main/java/org/tango/server/ServerManager.java
ServerManager.addClass
public void addClass(final String tangoClass, final Class<?> deviceClass) { lastClass = tangoClass; tangoClasses.put(tangoClass, deviceClass); }
java
public void addClass(final String tangoClass, final Class<?> deviceClass) { lastClass = tangoClass; tangoClasses.put(tangoClass, deviceClass); }
[ "public", "void", "addClass", "(", "final", "String", "tangoClass", ",", "final", "Class", "<", "?", ">", "deviceClass", ")", "{", "lastClass", "=", "tangoClass", ";", "tangoClasses", ".", "put", "(", "tangoClass", ",", "deviceClass", ")", ";", "}" ]
Add a class to the server. @param tangoClass The class name as defined in the tango database @param deviceClass The class that define a device with {@link Device}
[ "Add", "a", "class", "to", "the", "server", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/ServerManager.java#L135-L138
140,238
tango-controls/JTango
server/src/main/java/org/tango/server/ServerManager.java
ServerManager.stop
public void stop() throws DevFailed { try { if (isStarted.get()) { tangoClasses.clear(); if (tangoExporter != null) { tangoExporter.clearClass(); tangoExporter.unexportAll(); } TangoCacheManager.shutdown(); EventManager.getInstance().close(); if (monitoring != null) { monitoring.stop(); } } } finally { ORBManager.shutdown(); logger.info("everything has been shutdown normally"); isStarted.set(false); } }
java
public void stop() throws DevFailed { try { if (isStarted.get()) { tangoClasses.clear(); if (tangoExporter != null) { tangoExporter.clearClass(); tangoExporter.unexportAll(); } TangoCacheManager.shutdown(); EventManager.getInstance().close(); if (monitoring != null) { monitoring.stop(); } } } finally { ORBManager.shutdown(); logger.info("everything has been shutdown normally"); isStarted.set(false); } }
[ "public", "void", "stop", "(", ")", "throws", "DevFailed", "{", "try", "{", "if", "(", "isStarted", ".", "get", "(", ")", ")", "{", "tangoClasses", ".", "clear", "(", ")", ";", "if", "(", "tangoExporter", "!=", "null", ")", "{", "tangoExporter", ".", "clearClass", "(", ")", ";", "tangoExporter", ".", "unexportAll", "(", ")", ";", "}", "TangoCacheManager", ".", "shutdown", "(", ")", ";", "EventManager", ".", "getInstance", "(", ")", ".", "close", "(", ")", ";", "if", "(", "monitoring", "!=", "null", ")", "{", "monitoring", ".", "stop", "(", ")", ";", "}", "}", "}", "finally", "{", "ORBManager", ".", "shutdown", "(", ")", ";", "logger", ".", "info", "(", "\"everything has been shutdown normally\"", ")", ";", "isStarted", ".", "set", "(", "false", ")", ";", "}", "}" ]
Stop the server and clear all @throws DevFailed
[ "Stop", "the", "server", "and", "clear", "all" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/ServerManager.java#L278-L297
140,239
tango-controls/JTango
server/src/main/java/org/tango/server/ServerManager.java
ServerManager.checkArgs
private void checkArgs(final String[] argv) throws DevFailed { if (argv.length < 1) { throw DevFailedUtils.newDevFailed(INIT_ERROR, getUsage()); } instanceName = argv[0]; useDb = true; DatabaseFactory.setUseDb(true); List<String> noDbDevices = new ArrayList<String>(); for (int i = 1; i < argv.length; i++) { final String arg = argv[i]; if (arg.startsWith("-h")) { // trace instance name System.out.println("instance list for server " + execName + ": " + Arrays.toString(DatabaseFactory.getDatabase().getInstanceNameList(execName))); } else if (arg.startsWith("-v")) { // logging level try { final int level = Integer.parseInt(arg.substring(arg.lastIndexOf('v') + 1)); LoggingManager.getInstance().setLoggingLevel(level, tangoClasses.values().toArray(new Class<?>[0])); } catch (final NumberFormatException e) { throw DevFailedUtils.newDevFailed("Logging level error. Must be a number"); } } else if (arg.startsWith("-dlist")) { noDbDevices = configureNoDB(argv, i); useDb = false; } else if (arg.startsWith("-file")) { configureNoDBFile(argv, arg, noDbDevices); useDb = false; } } }
java
private void checkArgs(final String[] argv) throws DevFailed { if (argv.length < 1) { throw DevFailedUtils.newDevFailed(INIT_ERROR, getUsage()); } instanceName = argv[0]; useDb = true; DatabaseFactory.setUseDb(true); List<String> noDbDevices = new ArrayList<String>(); for (int i = 1; i < argv.length; i++) { final String arg = argv[i]; if (arg.startsWith("-h")) { // trace instance name System.out.println("instance list for server " + execName + ": " + Arrays.toString(DatabaseFactory.getDatabase().getInstanceNameList(execName))); } else if (arg.startsWith("-v")) { // logging level try { final int level = Integer.parseInt(arg.substring(arg.lastIndexOf('v') + 1)); LoggingManager.getInstance().setLoggingLevel(level, tangoClasses.values().toArray(new Class<?>[0])); } catch (final NumberFormatException e) { throw DevFailedUtils.newDevFailed("Logging level error. Must be a number"); } } else if (arg.startsWith("-dlist")) { noDbDevices = configureNoDB(argv, i); useDb = false; } else if (arg.startsWith("-file")) { configureNoDBFile(argv, arg, noDbDevices); useDb = false; } } }
[ "private", "void", "checkArgs", "(", "final", "String", "[", "]", "argv", ")", "throws", "DevFailed", "{", "if", "(", "argv", ".", "length", "<", "1", ")", "{", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "INIT_ERROR", ",", "getUsage", "(", ")", ")", ";", "}", "instanceName", "=", "argv", "[", "0", "]", ";", "useDb", "=", "true", ";", "DatabaseFactory", ".", "setUseDb", "(", "true", ")", ";", "List", "<", "String", ">", "noDbDevices", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<", "argv", ".", "length", ";", "i", "++", ")", "{", "final", "String", "arg", "=", "argv", "[", "i", "]", ";", "if", "(", "arg", ".", "startsWith", "(", "\"-h\"", ")", ")", "{", "// trace instance name", "System", ".", "out", ".", "println", "(", "\"instance list for server \"", "+", "execName", "+", "\": \"", "+", "Arrays", ".", "toString", "(", "DatabaseFactory", ".", "getDatabase", "(", ")", ".", "getInstanceNameList", "(", "execName", ")", ")", ")", ";", "}", "else", "if", "(", "arg", ".", "startsWith", "(", "\"-v\"", ")", ")", "{", "// logging level", "try", "{", "final", "int", "level", "=", "Integer", ".", "parseInt", "(", "arg", ".", "substring", "(", "arg", ".", "lastIndexOf", "(", "'", "'", ")", "+", "1", ")", ")", ";", "LoggingManager", ".", "getInstance", "(", ")", ".", "setLoggingLevel", "(", "level", ",", "tangoClasses", ".", "values", "(", ")", ".", "toArray", "(", "new", "Class", "<", "?", ">", "[", "0", "]", ")", ")", ";", "}", "catch", "(", "final", "NumberFormatException", "e", ")", "{", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "\"Logging level error. Must be a number\"", ")", ";", "}", "}", "else", "if", "(", "arg", ".", "startsWith", "(", "\"-dlist\"", ")", ")", "{", "noDbDevices", "=", "configureNoDB", "(", "argv", ",", "i", ")", ";", "useDb", "=", "false", ";", "}", "else", "if", "(", "arg", ".", "startsWith", "(", "\"-file\"", ")", ")", "{", "configureNoDBFile", "(", "argv", ",", "arg", ",", "noDbDevices", ")", ";", "useDb", "=", "false", ";", "}", "}", "}" ]
Check the command line arguments. The first one is mandatory and is the server name. A -v option is authorized with an optional argument. @param argv @throws DevFailed
[ "Check", "the", "command", "line", "arguments", ".", "The", "first", "one", "is", "mandatory", "and", "is", "the", "server", "name", ".", "A", "-", "v", "option", "is", "authorized", "with", "an", "optional", "argument", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/ServerManager.java#L316-L345
140,240
tango-controls/JTango
client/src/main/java/fr/soleil/tango/clientapi/TangoCommand.java
TangoCommand.executeExtractList
public <T> List<T> executeExtractList(final Class<T> clazz, final Object value) throws DevFailed { final Object r = command.executeExtract(value); return extractList(TypeConversionUtil.castToType(clazz, r)); }
java
public <T> List<T> executeExtractList(final Class<T> clazz, final Object value) throws DevFailed { final Object r = command.executeExtract(value); return extractList(TypeConversionUtil.castToType(clazz, r)); }
[ "public", "<", "T", ">", "List", "<", "T", ">", "executeExtractList", "(", "final", "Class", "<", "T", ">", "clazz", ",", "final", "Object", "value", ")", "throws", "DevFailed", "{", "final", "Object", "r", "=", "command", ".", "executeExtract", "(", "value", ")", ";", "return", "extractList", "(", "TypeConversionUtil", ".", "castToType", "(", "clazz", ",", "r", ")", ")", ";", "}" ]
Execute a command with argin which is a single value @param <T> @param clazz @param value @return @throws DevFailed
[ "Execute", "a", "command", "with", "argin", "which", "is", "a", "single", "value" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/client/src/main/java/fr/soleil/tango/clientapi/TangoCommand.java#L190-L193
140,241
tango-controls/JTango
client/src/main/java/fr/soleil/tango/clientapi/TangoCommand.java
TangoCommand.executeExtractList
public <T> List<T> executeExtractList(final Class<T> clazz, final Object... value) throws DevFailed { final Object result = command.executeExtract(value); return extractList(TypeConversionUtil.castToArray(clazz, result)); }
java
public <T> List<T> executeExtractList(final Class<T> clazz, final Object... value) throws DevFailed { final Object result = command.executeExtract(value); return extractList(TypeConversionUtil.castToArray(clazz, result)); }
[ "public", "<", "T", ">", "List", "<", "T", ">", "executeExtractList", "(", "final", "Class", "<", "T", ">", "clazz", ",", "final", "Object", "...", "value", ")", "throws", "DevFailed", "{", "final", "Object", "result", "=", "command", ".", "executeExtract", "(", "value", ")", ";", "return", "extractList", "(", "TypeConversionUtil", ".", "castToArray", "(", "clazz", ",", "result", ")", ")", ";", "}" ]
Execute a command with argin which is an array @param <T> @param clazz @param value @return @throws DevFailed
[ "Execute", "a", "command", "with", "argin", "which", "is", "an", "array" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/client/src/main/java/fr/soleil/tango/clientapi/TangoCommand.java#L204-L207
140,242
tango-controls/JTango
server/src/main/java/org/tango/server/attribute/AttributeConfiguration.java
AttributeConfiguration.setType
public void setType(final Class<?> type) throws DevFailed { if (Enum.class.isAssignableFrom(type)) { this.type = AttributeTangoType.getTypeFromClass(type).getType(); } else { this.type = type; } enumType = AttributeTangoType.getTypeFromClass(type); tangoType = enumType.getTangoIDLType(); if (type.isArray()) { if (type.getComponentType().isArray()) { format = AttrDataFormat.IMAGE; } else { format = AttrDataFormat.SPECTRUM; maxY = 0; } } else { format = AttrDataFormat.SCALAR; maxX = 1; maxY = 0; } }
java
public void setType(final Class<?> type) throws DevFailed { if (Enum.class.isAssignableFrom(type)) { this.type = AttributeTangoType.getTypeFromClass(type).getType(); } else { this.type = type; } enumType = AttributeTangoType.getTypeFromClass(type); tangoType = enumType.getTangoIDLType(); if (type.isArray()) { if (type.getComponentType().isArray()) { format = AttrDataFormat.IMAGE; } else { format = AttrDataFormat.SPECTRUM; maxY = 0; } } else { format = AttrDataFormat.SCALAR; maxX = 1; maxY = 0; } }
[ "public", "void", "setType", "(", "final", "Class", "<", "?", ">", "type", ")", "throws", "DevFailed", "{", "if", "(", "Enum", ".", "class", ".", "isAssignableFrom", "(", "type", ")", ")", "{", "this", ".", "type", "=", "AttributeTangoType", ".", "getTypeFromClass", "(", "type", ")", ".", "getType", "(", ")", ";", "}", "else", "{", "this", ".", "type", "=", "type", ";", "}", "enumType", "=", "AttributeTangoType", ".", "getTypeFromClass", "(", "type", ")", ";", "tangoType", "=", "enumType", ".", "getTangoIDLType", "(", ")", ";", "if", "(", "type", ".", "isArray", "(", ")", ")", "{", "if", "(", "type", ".", "getComponentType", "(", ")", ".", "isArray", "(", ")", ")", "{", "format", "=", "AttrDataFormat", ".", "IMAGE", ";", "}", "else", "{", "format", "=", "AttrDataFormat", ".", "SPECTRUM", ";", "maxY", "=", "0", ";", "}", "}", "else", "{", "format", "=", "AttrDataFormat", ".", "SCALAR", ";", "maxX", "=", "1", ";", "maxY", "=", "0", ";", "}", "}" ]
Set the attribute type with Java class. Can be scalar, array or matrix @param type @throws DevFailed
[ "Set", "the", "attribute", "type", "with", "Java", "class", ".", "Can", "be", "scalar", "array", "or", "matrix" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/attribute/AttributeConfiguration.java#L137-L157
140,243
tango-controls/JTango
server/src/main/java/org/tango/server/attribute/AttributeConfiguration.java
AttributeConfiguration.setTangoType
public void setTangoType(final int tangoType, final AttrDataFormat format) throws DevFailed { setFormat(format); this.tangoType = tangoType; enumType = AttributeTangoType.getTypeFromTango(tangoType); if (format.equals(AttrDataFormat.SCALAR)) { type = enumType.getType(); } else if (format.equals(AttrDataFormat.SPECTRUM)) { type = Array.newInstance(enumType.getType(), 0).getClass(); } else { type = Array.newInstance(enumType.getType(), 0, 0).getClass(); } }
java
public void setTangoType(final int tangoType, final AttrDataFormat format) throws DevFailed { setFormat(format); this.tangoType = tangoType; enumType = AttributeTangoType.getTypeFromTango(tangoType); if (format.equals(AttrDataFormat.SCALAR)) { type = enumType.getType(); } else if (format.equals(AttrDataFormat.SPECTRUM)) { type = Array.newInstance(enumType.getType(), 0).getClass(); } else { type = Array.newInstance(enumType.getType(), 0, 0).getClass(); } }
[ "public", "void", "setTangoType", "(", "final", "int", "tangoType", ",", "final", "AttrDataFormat", "format", ")", "throws", "DevFailed", "{", "setFormat", "(", "format", ")", ";", "this", ".", "tangoType", "=", "tangoType", ";", "enumType", "=", "AttributeTangoType", ".", "getTypeFromTango", "(", "tangoType", ")", ";", "if", "(", "format", ".", "equals", "(", "AttrDataFormat", ".", "SCALAR", ")", ")", "{", "type", "=", "enumType", ".", "getType", "(", ")", ";", "}", "else", "if", "(", "format", ".", "equals", "(", "AttrDataFormat", ".", "SPECTRUM", ")", ")", "{", "type", "=", "Array", ".", "newInstance", "(", "enumType", ".", "getType", "(", ")", ",", "0", ")", ".", "getClass", "(", ")", ";", "}", "else", "{", "type", "=", "Array", ".", "newInstance", "(", "enumType", ".", "getType", "(", ")", ",", "0", ",", "0", ")", ".", "getClass", "(", ")", ";", "}", "}" ]
Set the attribute type with Tango type. @param tangoType @throws DevFailed @see TangoConst for possible values
[ "Set", "the", "attribute", "type", "with", "Tango", "type", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/attribute/AttributeConfiguration.java#L245-L256
140,244
tango-controls/JTango
server/src/main/java/org/tango/server/servant/DeviceImpl.java
DeviceImpl.addAttribute
public synchronized void addAttribute(final AttributeImpl attribute) throws DevFailed { // add attribute only if it doesn't exists AttributeImpl result = null; for (final AttributeImpl attr : attributeList) { if (attr.getName().equalsIgnoreCase(attribute.getName())) { result = attribute; break; } } if (result == null) { attributeList.add(attribute); // set default polling configuration if (attrPollRingDepth.containsKey(attribute.getName().toLowerCase(Locale.ENGLISH))) { attribute.setPollRingDepth(attrPollRingDepth.get(attribute.getName().toLowerCase(Locale.ENGLISH))); } else { attribute.setPollRingDepth(pollRingDepth); } } }
java
public synchronized void addAttribute(final AttributeImpl attribute) throws DevFailed { // add attribute only if it doesn't exists AttributeImpl result = null; for (final AttributeImpl attr : attributeList) { if (attr.getName().equalsIgnoreCase(attribute.getName())) { result = attribute; break; } } if (result == null) { attributeList.add(attribute); // set default polling configuration if (attrPollRingDepth.containsKey(attribute.getName().toLowerCase(Locale.ENGLISH))) { attribute.setPollRingDepth(attrPollRingDepth.get(attribute.getName().toLowerCase(Locale.ENGLISH))); } else { attribute.setPollRingDepth(pollRingDepth); } } }
[ "public", "synchronized", "void", "addAttribute", "(", "final", "AttributeImpl", "attribute", ")", "throws", "DevFailed", "{", "// add attribute only if it doesn't exists", "AttributeImpl", "result", "=", "null", ";", "for", "(", "final", "AttributeImpl", "attr", ":", "attributeList", ")", "{", "if", "(", "attr", ".", "getName", "(", ")", ".", "equalsIgnoreCase", "(", "attribute", ".", "getName", "(", ")", ")", ")", "{", "result", "=", "attribute", ";", "break", ";", "}", "}", "if", "(", "result", "==", "null", ")", "{", "attributeList", ".", "add", "(", "attribute", ")", ";", "// set default polling configuration", "if", "(", "attrPollRingDepth", ".", "containsKey", "(", "attribute", ".", "getName", "(", ")", ".", "toLowerCase", "(", "Locale", ".", "ENGLISH", ")", ")", ")", "{", "attribute", ".", "setPollRingDepth", "(", "attrPollRingDepth", ".", "get", "(", "attribute", ".", "getName", "(", ")", ".", "toLowerCase", "(", "Locale", ".", "ENGLISH", ")", ")", ")", ";", "}", "else", "{", "attribute", ".", "setPollRingDepth", "(", "pollRingDepth", ")", ";", "}", "}", "}" ]
Add an attribute to the device @param attribute @throws DevFailed
[ "Add", "an", "attribute", "to", "the", "device" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L521-L539
140,245
tango-controls/JTango
server/src/main/java/org/tango/server/servant/DeviceImpl.java
DeviceImpl.removeAttribute
public synchronized void removeAttribute(final AttributeImpl attribute) throws DevFailed { if (attribute.getName().equalsIgnoreCase(STATUS_NAME) || attribute.getName().equalsIgnoreCase(STATE_NAME)) { return; } pollingManager.removeAttributePolling(attribute.getName()); statusImpl.removeAttributeAlarm(attribute.getName()); stateImpl.removeAttributeAlarm(attribute.getName()); attributeList.remove(attribute); }
java
public synchronized void removeAttribute(final AttributeImpl attribute) throws DevFailed { if (attribute.getName().equalsIgnoreCase(STATUS_NAME) || attribute.getName().equalsIgnoreCase(STATE_NAME)) { return; } pollingManager.removeAttributePolling(attribute.getName()); statusImpl.removeAttributeAlarm(attribute.getName()); stateImpl.removeAttributeAlarm(attribute.getName()); attributeList.remove(attribute); }
[ "public", "synchronized", "void", "removeAttribute", "(", "final", "AttributeImpl", "attribute", ")", "throws", "DevFailed", "{", "if", "(", "attribute", ".", "getName", "(", ")", ".", "equalsIgnoreCase", "(", "STATUS_NAME", ")", "||", "attribute", ".", "getName", "(", ")", ".", "equalsIgnoreCase", "(", "STATE_NAME", ")", ")", "{", "return", ";", "}", "pollingManager", ".", "removeAttributePolling", "(", "attribute", ".", "getName", "(", ")", ")", ";", "statusImpl", ".", "removeAttributeAlarm", "(", "attribute", ".", "getName", "(", ")", ")", ";", "stateImpl", ".", "removeAttributeAlarm", "(", "attribute", ".", "getName", "(", ")", ")", ";", "attributeList", ".", "remove", "(", "attribute", ")", ";", "}" ]
remove an attribute of the device. Not possible to remove State or Status @param attribute @throws DevFailed
[ "remove", "an", "attribute", "of", "the", "device", ".", "Not", "possible", "to", "remove", "State", "or", "Status" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L547-L555
140,246
tango-controls/JTango
server/src/main/java/org/tango/server/servant/DeviceImpl.java
DeviceImpl.checkInitialization
private synchronized void checkInitialization() throws DevFailed { if (initImpl != null) { isInitializing = initImpl.isInitInProgress(); } else { isInitializing = false; } if (isInitializing) { throw DevFailedUtils.newDevFailed("CONCURRENT_ERROR", name + " in Init command "); } }
java
private synchronized void checkInitialization() throws DevFailed { if (initImpl != null) { isInitializing = initImpl.isInitInProgress(); } else { isInitializing = false; } if (isInitializing) { throw DevFailedUtils.newDevFailed("CONCURRENT_ERROR", name + " in Init command "); } }
[ "private", "synchronized", "void", "checkInitialization", "(", ")", "throws", "DevFailed", "{", "if", "(", "initImpl", "!=", "null", ")", "{", "isInitializing", "=", "initImpl", ".", "isInitInProgress", "(", ")", ";", "}", "else", "{", "isInitializing", "=", "false", ";", "}", "if", "(", "isInitializing", ")", "{", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "\"CONCURRENT_ERROR\"", ",", "name", "+", "\" in Init command \"", ")", ";", "}", "}" ]
Check if an init is in progress @throws DevFailed if init is init progress
[ "Check", "if", "an", "init", "is", "in", "progress" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L785-L794
140,247
tango-controls/JTango
server/src/main/java/org/tango/server/servant/DeviceImpl.java
DeviceImpl.info
@Override public DevInfo info() throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); deviceMonitoring.startRequest("Operation info"); final DevInfo info = new DevInfo(); info.dev_class = className; info.doc_url = "Doc URL = http://www.tango-controls.org"; info.server_host = ServerManager.getInstance().getHostName(); info.server_id = ServerManager.getInstance().getServerName(); info.server_version = SERVER_VERSION; xlogger.exit(); return info; }
java
@Override public DevInfo info() throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); deviceMonitoring.startRequest("Operation info"); final DevInfo info = new DevInfo(); info.dev_class = className; info.doc_url = "Doc URL = http://www.tango-controls.org"; info.server_host = ServerManager.getInstance().getHostName(); info.server_id = ServerManager.getInstance().getServerName(); info.server_version = SERVER_VERSION; xlogger.exit(); return info; }
[ "@", "Override", "public", "DevInfo", "info", "(", ")", "throws", "DevFailed", "{", "MDC", ".", "setContextMap", "(", "contextMap", ")", ";", "xlogger", ".", "entry", "(", ")", ";", "deviceMonitoring", ".", "startRequest", "(", "\"Operation info\"", ")", ";", "final", "DevInfo", "info", "=", "new", "DevInfo", "(", ")", ";", "info", ".", "dev_class", "=", "className", ";", "info", ".", "doc_url", "=", "\"Doc URL = http://www.tango-controls.org\"", ";", "info", ".", "server_host", "=", "ServerManager", ".", "getInstance", "(", ")", ".", "getHostName", "(", ")", ";", "info", ".", "server_id", "=", "ServerManager", ".", "getInstance", "(", ")", ".", "getServerName", "(", ")", ";", "info", ".", "server_version", "=", "SERVER_VERSION", ";", "xlogger", ".", "exit", "(", ")", ";", "return", "info", ";", "}" ]
Get info of this device in IDL1 @return info @throws DevFailed
[ "Get", "info", "of", "this", "device", "in", "IDL1" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L802-L815
140,248
tango-controls/JTango
server/src/main/java/org/tango/server/servant/DeviceImpl.java
DeviceImpl.info_3
@Override public DevInfo_3 info_3() throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); deviceMonitoring.startRequest("Operation info_3"); final DevInfo_3 info3 = new DevInfo_3(); final DevInfo info = info(); info3.dev_class = info.dev_class; info3.doc_url = info.doc_url; info3.server_host = info.server_host; info3.server_id = info.server_id; info3.server_version = info.server_version; info3.dev_type = deviceType; xlogger.exit(); return info3; }
java
@Override public DevInfo_3 info_3() throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); deviceMonitoring.startRequest("Operation info_3"); final DevInfo_3 info3 = new DevInfo_3(); final DevInfo info = info(); info3.dev_class = info.dev_class; info3.doc_url = info.doc_url; info3.server_host = info.server_host; info3.server_id = info.server_id; info3.server_version = info.server_version; info3.dev_type = deviceType; xlogger.exit(); return info3; }
[ "@", "Override", "public", "DevInfo_3", "info_3", "(", ")", "throws", "DevFailed", "{", "MDC", ".", "setContextMap", "(", "contextMap", ")", ";", "xlogger", ".", "entry", "(", ")", ";", "deviceMonitoring", ".", "startRequest", "(", "\"Operation info_3\"", ")", ";", "final", "DevInfo_3", "info3", "=", "new", "DevInfo_3", "(", ")", ";", "final", "DevInfo", "info", "=", "info", "(", ")", ";", "info3", ".", "dev_class", "=", "info", ".", "dev_class", ";", "info3", ".", "doc_url", "=", "info", ".", "doc_url", ";", "info3", ".", "server_host", "=", "info", ".", "server_host", ";", "info3", ".", "server_id", "=", "info", ".", "server_id", ";", "info3", ".", "server_version", "=", "info", ".", "server_version", ";", "info3", ".", "dev_type", "=", "deviceType", ";", "xlogger", ".", "exit", "(", ")", ";", "return", "info3", ";", "}" ]
Get info of this device in IDL3 @return info @throws DevFailed
[ "Get", "info", "of", "this", "device", "in", "IDL3" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L823-L838
140,249
tango-controls/JTango
server/src/main/java/org/tango/server/servant/DeviceImpl.java
DeviceImpl.ping
@Override public void ping() throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); deviceMonitoring.startRequest("Operation ping"); xlogger.exit(); }
java
@Override public void ping() throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); deviceMonitoring.startRequest("Operation ping"); xlogger.exit(); }
[ "@", "Override", "public", "void", "ping", "(", ")", "throws", "DevFailed", "{", "MDC", ".", "setContextMap", "(", "contextMap", ")", ";", "xlogger", ".", "entry", "(", ")", ";", "deviceMonitoring", ".", "startRequest", "(", "\"Operation ping\"", ")", ";", "xlogger", ".", "exit", "(", ")", ";", "}" ]
Dummy method to check if this device is responding @throws DevFailed
[ "Dummy", "method", "to", "check", "if", "this", "device", "is", "responding" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L845-L851
140,250
tango-controls/JTango
server/src/main/java/org/tango/server/servant/DeviceImpl.java
DeviceImpl.black_box
@Override public String[] black_box(final int maxSize) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); // deviceMonitoring.addRequest("black_box"); if (maxSize <= 0) { throw DevFailedUtils.newDevFailed(ExceptionMessages.BLACK_BOX_ARG, maxSize + " is not a good size"); } xlogger.exit(); return deviceMonitoring.getBlackBox(maxSize); }
java
@Override public String[] black_box(final int maxSize) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); // deviceMonitoring.addRequest("black_box"); if (maxSize <= 0) { throw DevFailedUtils.newDevFailed(ExceptionMessages.BLACK_BOX_ARG, maxSize + " is not a good size"); } xlogger.exit(); return deviceMonitoring.getBlackBox(maxSize); }
[ "@", "Override", "public", "String", "[", "]", "black_box", "(", "final", "int", "maxSize", ")", "throws", "DevFailed", "{", "MDC", ".", "setContextMap", "(", "contextMap", ")", ";", "xlogger", ".", "entry", "(", ")", ";", "// deviceMonitoring.addRequest(\"black_box\");", "if", "(", "maxSize", "<=", "0", ")", "{", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "ExceptionMessages", ".", "BLACK_BOX_ARG", ",", "maxSize", "+", "\" is not a good size\"", ")", ";", "}", "xlogger", ".", "exit", "(", ")", ";", "return", "deviceMonitoring", ".", "getBlackBox", "(", "maxSize", ")", ";", "}" ]
Get the clients' requests history @param maxSize The maximum depth of history @return the request history
[ "Get", "the", "clients", "requests", "history" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L875-L885
140,251
tango-controls/JTango
server/src/main/java/org/tango/server/servant/DeviceImpl.java
DeviceImpl.description
@Override public String description() { MDC.setContextMap(contextMap); xlogger.entry(); deviceMonitoring.startRequest("Attribute description requested "); String desc = "A TANGO device"; if (name.equalsIgnoreCase(ServerManager.getInstance().getAdminDeviceName())) { desc = "A device server device !!"; } return desc; }
java
@Override public String description() { MDC.setContextMap(contextMap); xlogger.entry(); deviceMonitoring.startRequest("Attribute description requested "); String desc = "A TANGO device"; if (name.equalsIgnoreCase(ServerManager.getInstance().getAdminDeviceName())) { desc = "A device server device !!"; } return desc; }
[ "@", "Override", "public", "String", "description", "(", ")", "{", "MDC", ".", "setContextMap", "(", "contextMap", ")", ";", "xlogger", ".", "entry", "(", ")", ";", "deviceMonitoring", ".", "startRequest", "(", "\"Attribute description requested \"", ")", ";", "String", "desc", "=", "\"A TANGO device\"", ";", "if", "(", "name", ".", "equalsIgnoreCase", "(", "ServerManager", ".", "getInstance", "(", ")", ".", "getAdminDeviceName", "(", ")", ")", ")", "{", "desc", "=", "\"A device server device !!\"", ";", "}", "return", "desc", ";", "}" ]
Get a description of this device @return description
[ "Get", "a", "description", "of", "this", "device" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L892-L902
140,252
tango-controls/JTango
server/src/main/java/org/tango/server/servant/DeviceImpl.java
DeviceImpl.name
@Override public String name() { MDC.setContextMap(contextMap); deviceMonitoring.startRequest("Device name"); xlogger.entry(); return name; }
java
@Override public String name() { MDC.setContextMap(contextMap); deviceMonitoring.startRequest("Device name"); xlogger.entry(); return name; }
[ "@", "Override", "public", "String", "name", "(", ")", "{", "MDC", ".", "setContextMap", "(", "contextMap", ")", ";", "deviceMonitoring", ".", "startRequest", "(", "\"Device name\"", ")", ";", "xlogger", ".", "entry", "(", ")", ";", "return", "name", ";", "}" ]
Get the name of the device @return name
[ "Get", "the", "name", "of", "the", "device" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L909-L915
140,253
tango-controls/JTango
server/src/main/java/org/tango/server/servant/DeviceImpl.java
DeviceImpl.read_attribute_history_2
@Override public DevAttrHistory[] read_attribute_history_2(final String attributeName, final int maxSize) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); checkInitialization(); deviceMonitoring.startRequest("read_attribute_history_2"); // TODO read_attribute_history_2 return new DevAttrHistory[0]; }
java
@Override public DevAttrHistory[] read_attribute_history_2(final String attributeName, final int maxSize) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); checkInitialization(); deviceMonitoring.startRequest("read_attribute_history_2"); // TODO read_attribute_history_2 return new DevAttrHistory[0]; }
[ "@", "Override", "public", "DevAttrHistory", "[", "]", "read_attribute_history_2", "(", "final", "String", "attributeName", ",", "final", "int", "maxSize", ")", "throws", "DevFailed", "{", "MDC", ".", "setContextMap", "(", "contextMap", ")", ";", "xlogger", ".", "entry", "(", ")", ";", "checkInitialization", "(", ")", ";", "deviceMonitoring", ".", "startRequest", "(", "\"read_attribute_history_2\"", ")", ";", "// TODO read_attribute_history_2", "return", "new", "DevAttrHistory", "[", "0", "]", ";", "}" ]
read an attribute history. IDL 2 version. The history is filled only be attribute polling @param attributeName The attribute to retrieve @param maxSize The history maximum size returned @throws DevFailed
[ "read", "an", "attribute", "history", ".", "IDL", "2", "version", ".", "The", "history", "is", "filled", "only", "be", "attribute", "polling" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L925-L933
140,254
tango-controls/JTango
server/src/main/java/org/tango/server/servant/DeviceImpl.java
DeviceImpl.read_attribute_history_3
@Override public DevAttrHistory_3[] read_attribute_history_3(final String attributeName, final int maxSize) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); // TODO read_attribute_history_3 checkInitialization(); deviceMonitoring.startRequest("read_attribute_history_3"); return new DevAttrHistory_3[0]; }
java
@Override public DevAttrHistory_3[] read_attribute_history_3(final String attributeName, final int maxSize) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); // TODO read_attribute_history_3 checkInitialization(); deviceMonitoring.startRequest("read_attribute_history_3"); return new DevAttrHistory_3[0]; }
[ "@", "Override", "public", "DevAttrHistory_3", "[", "]", "read_attribute_history_3", "(", "final", "String", "attributeName", ",", "final", "int", "maxSize", ")", "throws", "DevFailed", "{", "MDC", ".", "setContextMap", "(", "contextMap", ")", ";", "xlogger", ".", "entry", "(", ")", ";", "// TODO read_attribute_history_3", "checkInitialization", "(", ")", ";", "deviceMonitoring", ".", "startRequest", "(", "\"read_attribute_history_3\"", ")", ";", "return", "new", "DevAttrHistory_3", "[", "0", "]", ";", "}" ]
read an attribute history. IDL 3 version. The history is filled only be attribute polling @param attributeName The attribute to retrieve @param maxSize The history maximum size returned @throws DevFailed
[ "read", "an", "attribute", "history", ".", "IDL", "3", "version", ".", "The", "history", "is", "filled", "only", "be", "attribute", "polling" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L943-L951
140,255
tango-controls/JTango
server/src/main/java/org/tango/server/servant/DeviceImpl.java
DeviceImpl.read_attribute_history_4
@Override public DevAttrHistory_4 read_attribute_history_4(final String attributeName, final int maxSize) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); checkInitialization(); deviceMonitoring.startRequest("read_attribute_history_4"); DevAttrHistory_4 result = null; try { final AttributeImpl attr = AttributeGetterSetter.getAttribute(attributeName, attributeList); if (!attr.isPolled()) { throw DevFailedUtils.newDevFailed(ExceptionMessages.ATTR_NOT_POLLED, attr.getName() + " is not polled"); } result = attr.getHistory().getAttrHistory4(maxSize); } catch (final Exception e) { deviceMonitoring.addError(); if (e instanceof DevFailed) { throw (DevFailed) e; } else { // with CORBA, the stack trace is not visible by the client if // not inserted in DevFailed. throw DevFailedUtils.newDevFailed(e); } } return result; }
java
@Override public DevAttrHistory_4 read_attribute_history_4(final String attributeName, final int maxSize) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); checkInitialization(); deviceMonitoring.startRequest("read_attribute_history_4"); DevAttrHistory_4 result = null; try { final AttributeImpl attr = AttributeGetterSetter.getAttribute(attributeName, attributeList); if (!attr.isPolled()) { throw DevFailedUtils.newDevFailed(ExceptionMessages.ATTR_NOT_POLLED, attr.getName() + " is not polled"); } result = attr.getHistory().getAttrHistory4(maxSize); } catch (final Exception e) { deviceMonitoring.addError(); if (e instanceof DevFailed) { throw (DevFailed) e; } else { // with CORBA, the stack trace is not visible by the client if // not inserted in DevFailed. throw DevFailedUtils.newDevFailed(e); } } return result; }
[ "@", "Override", "public", "DevAttrHistory_4", "read_attribute_history_4", "(", "final", "String", "attributeName", ",", "final", "int", "maxSize", ")", "throws", "DevFailed", "{", "MDC", ".", "setContextMap", "(", "contextMap", ")", ";", "xlogger", ".", "entry", "(", ")", ";", "checkInitialization", "(", ")", ";", "deviceMonitoring", ".", "startRequest", "(", "\"read_attribute_history_4\"", ")", ";", "DevAttrHistory_4", "result", "=", "null", ";", "try", "{", "final", "AttributeImpl", "attr", "=", "AttributeGetterSetter", ".", "getAttribute", "(", "attributeName", ",", "attributeList", ")", ";", "if", "(", "!", "attr", ".", "isPolled", "(", ")", ")", "{", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "ExceptionMessages", ".", "ATTR_NOT_POLLED", ",", "attr", ".", "getName", "(", ")", "+", "\" is not polled\"", ")", ";", "}", "result", "=", "attr", ".", "getHistory", "(", ")", ".", "getAttrHistory4", "(", "maxSize", ")", ";", "}", "catch", "(", "final", "Exception", "e", ")", "{", "deviceMonitoring", ".", "addError", "(", ")", ";", "if", "(", "e", "instanceof", "DevFailed", ")", "{", "throw", "(", "DevFailed", ")", "e", ";", "}", "else", "{", "// with CORBA, the stack trace is not visible by the client if", "// not inserted in DevFailed.", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "e", ")", ";", "}", "}", "return", "result", ";", "}" ]
read an attribute history. IDL 4 version. The history is filled only be attribute polling @param attributeName The attribute to retrieve @param maxSize The history maximum size returned @throws DevFailed
[ "read", "an", "attribute", "history", ".", "IDL", "4", "version", ".", "The", "history", "is", "filled", "only", "be", "attribute", "polling" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L961-L985
140,256
tango-controls/JTango
server/src/main/java/org/tango/server/servant/DeviceImpl.java
DeviceImpl.read_attributes
@Override public AttributeValue[] read_attributes(final String[] attributeNames) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); if (attributeNames.length != 1 || !attributeNames[0].equalsIgnoreCase(DeviceImpl.STATE_NAME) && !attributeNames[0].equalsIgnoreCase(DeviceImpl.STATUS_NAME)) { checkInitialization(); } deviceMonitoring.startRequest("read_attributes"); clientIdentity.set(null); if (attributeNames.length == 0) { throw DevFailedUtils.newDevFailed(READ_ERROR, READ_ASKED_FOR_0_ATTRIBUTES); } AttributeValue[] result = null; try { result = AttributeGetterSetter.getAttributesValues(name, attributeNames, pollingManager, attributeList, aroundInvokeImpl, DevSource.CACHE_DEV, deviceLock, null); } catch (final Exception e) { deviceMonitoring.addError(); if (e instanceof DevFailed) { throw (DevFailed) e; } else { // with CORBA, the stack trace is not visible by the client if // not inserted in DevFailed. throw DevFailedUtils.newDevFailed(e); } } return result; }
java
@Override public AttributeValue[] read_attributes(final String[] attributeNames) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); if (attributeNames.length != 1 || !attributeNames[0].equalsIgnoreCase(DeviceImpl.STATE_NAME) && !attributeNames[0].equalsIgnoreCase(DeviceImpl.STATUS_NAME)) { checkInitialization(); } deviceMonitoring.startRequest("read_attributes"); clientIdentity.set(null); if (attributeNames.length == 0) { throw DevFailedUtils.newDevFailed(READ_ERROR, READ_ASKED_FOR_0_ATTRIBUTES); } AttributeValue[] result = null; try { result = AttributeGetterSetter.getAttributesValues(name, attributeNames, pollingManager, attributeList, aroundInvokeImpl, DevSource.CACHE_DEV, deviceLock, null); } catch (final Exception e) { deviceMonitoring.addError(); if (e instanceof DevFailed) { throw (DevFailed) e; } else { // with CORBA, the stack trace is not visible by the client if // not inserted in DevFailed. throw DevFailedUtils.newDevFailed(e); } } return result; }
[ "@", "Override", "public", "AttributeValue", "[", "]", "read_attributes", "(", "final", "String", "[", "]", "attributeNames", ")", "throws", "DevFailed", "{", "MDC", ".", "setContextMap", "(", "contextMap", ")", ";", "xlogger", ".", "entry", "(", ")", ";", "if", "(", "attributeNames", ".", "length", "!=", "1", "||", "!", "attributeNames", "[", "0", "]", ".", "equalsIgnoreCase", "(", "DeviceImpl", ".", "STATE_NAME", ")", "&&", "!", "attributeNames", "[", "0", "]", ".", "equalsIgnoreCase", "(", "DeviceImpl", ".", "STATUS_NAME", ")", ")", "{", "checkInitialization", "(", ")", ";", "}", "deviceMonitoring", ".", "startRequest", "(", "\"read_attributes\"", ")", ";", "clientIdentity", ".", "set", "(", "null", ")", ";", "if", "(", "attributeNames", ".", "length", "==", "0", ")", "{", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "READ_ERROR", ",", "READ_ASKED_FOR_0_ATTRIBUTES", ")", ";", "}", "AttributeValue", "[", "]", "result", "=", "null", ";", "try", "{", "result", "=", "AttributeGetterSetter", ".", "getAttributesValues", "(", "name", ",", "attributeNames", ",", "pollingManager", ",", "attributeList", ",", "aroundInvokeImpl", ",", "DevSource", ".", "CACHE_DEV", ",", "deviceLock", ",", "null", ")", ";", "}", "catch", "(", "final", "Exception", "e", ")", "{", "deviceMonitoring", ".", "addError", "(", ")", ";", "if", "(", "e", "instanceof", "DevFailed", ")", "{", "throw", "(", "DevFailed", ")", "e", ";", "}", "else", "{", "// with CORBA, the stack trace is not visible by the client if", "// not inserted in DevFailed.", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "e", ")", ";", "}", "}", "return", "result", ";", "}" ]
Read some attributes. IDL 1 version. @param attributeNames The attributes names @return The read results. @throws DevFailed
[ "Read", "some", "attributes", ".", "IDL", "1", "version", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L994-L1022
140,257
tango-controls/JTango
server/src/main/java/org/tango/server/servant/DeviceImpl.java
DeviceImpl.read_attributes_4
@Override public AttributeValue_4[] read_attributes_4(final String[] names, final DevSource source, final ClntIdent clIdent) throws DevFailed { // final Profiler profilerPeriod = new Profiler("period"); // profilerPeriod.start(Arrays.toString(names)); MDC.setContextMap(contextMap); xlogger.entry(Arrays.toString(names)); if (names.length != 1 || !names[0].equalsIgnoreCase(DeviceImpl.STATE_NAME) && !names[0].equalsIgnoreCase(DeviceImpl.STATUS_NAME)) { checkInitialization(); } deviceMonitoring.startRequest("read_attributes_4 " + Arrays.toString(names), source, clIdent); clientIdentity.set(clIdent); if (names.length == 0) { throw DevFailedUtils.newDevFailed(READ_ERROR, READ_ASKED_FOR_0_ATTRIBUTES); } if (!name.equalsIgnoreCase(getAdminDeviceName())) { clientLocking.checkClientLocking(clIdent, names); } AttributeValue_4[] result = null; try { result = AttributeGetterSetter.getAttributesValues4(name, names, pollingManager, attributeList, aroundInvokeImpl, source, deviceLock, clIdent); } catch (final Exception e) { deviceMonitoring.addError(); if (e instanceof DevFailed) { throw (DevFailed) e; } else { // with CORBA, the stack trace is not visible by the client if // not inserted in DevFailed. throw DevFailedUtils.newDevFailed(e); } } xlogger.exit(); // profilerPeriod.stop().print(); return result; }
java
@Override public AttributeValue_4[] read_attributes_4(final String[] names, final DevSource source, final ClntIdent clIdent) throws DevFailed { // final Profiler profilerPeriod = new Profiler("period"); // profilerPeriod.start(Arrays.toString(names)); MDC.setContextMap(contextMap); xlogger.entry(Arrays.toString(names)); if (names.length != 1 || !names[0].equalsIgnoreCase(DeviceImpl.STATE_NAME) && !names[0].equalsIgnoreCase(DeviceImpl.STATUS_NAME)) { checkInitialization(); } deviceMonitoring.startRequest("read_attributes_4 " + Arrays.toString(names), source, clIdent); clientIdentity.set(clIdent); if (names.length == 0) { throw DevFailedUtils.newDevFailed(READ_ERROR, READ_ASKED_FOR_0_ATTRIBUTES); } if (!name.equalsIgnoreCase(getAdminDeviceName())) { clientLocking.checkClientLocking(clIdent, names); } AttributeValue_4[] result = null; try { result = AttributeGetterSetter.getAttributesValues4(name, names, pollingManager, attributeList, aroundInvokeImpl, source, deviceLock, clIdent); } catch (final Exception e) { deviceMonitoring.addError(); if (e instanceof DevFailed) { throw (DevFailed) e; } else { // with CORBA, the stack trace is not visible by the client if // not inserted in DevFailed. throw DevFailedUtils.newDevFailed(e); } } xlogger.exit(); // profilerPeriod.stop().print(); return result; }
[ "@", "Override", "public", "AttributeValue_4", "[", "]", "read_attributes_4", "(", "final", "String", "[", "]", "names", ",", "final", "DevSource", "source", ",", "final", "ClntIdent", "clIdent", ")", "throws", "DevFailed", "{", "// final Profiler profilerPeriod = new Profiler(\"period\");", "// profilerPeriod.start(Arrays.toString(names));", "MDC", ".", "setContextMap", "(", "contextMap", ")", ";", "xlogger", ".", "entry", "(", "Arrays", ".", "toString", "(", "names", ")", ")", ";", "if", "(", "names", ".", "length", "!=", "1", "||", "!", "names", "[", "0", "]", ".", "equalsIgnoreCase", "(", "DeviceImpl", ".", "STATE_NAME", ")", "&&", "!", "names", "[", "0", "]", ".", "equalsIgnoreCase", "(", "DeviceImpl", ".", "STATUS_NAME", ")", ")", "{", "checkInitialization", "(", ")", ";", "}", "deviceMonitoring", ".", "startRequest", "(", "\"read_attributes_4 \"", "+", "Arrays", ".", "toString", "(", "names", ")", ",", "source", ",", "clIdent", ")", ";", "clientIdentity", ".", "set", "(", "clIdent", ")", ";", "if", "(", "names", ".", "length", "==", "0", ")", "{", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "READ_ERROR", ",", "READ_ASKED_FOR_0_ATTRIBUTES", ")", ";", "}", "if", "(", "!", "name", ".", "equalsIgnoreCase", "(", "getAdminDeviceName", "(", ")", ")", ")", "{", "clientLocking", ".", "checkClientLocking", "(", "clIdent", ",", "names", ")", ";", "}", "AttributeValue_4", "[", "]", "result", "=", "null", ";", "try", "{", "result", "=", "AttributeGetterSetter", ".", "getAttributesValues4", "(", "name", ",", "names", ",", "pollingManager", ",", "attributeList", ",", "aroundInvokeImpl", ",", "source", ",", "deviceLock", ",", "clIdent", ")", ";", "}", "catch", "(", "final", "Exception", "e", ")", "{", "deviceMonitoring", ".", "addError", "(", ")", ";", "if", "(", "e", "instanceof", "DevFailed", ")", "{", "throw", "(", "DevFailed", ")", "e", ";", "}", "else", "{", "// with CORBA, the stack trace is not visible by the client if", "// not inserted in DevFailed.", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "e", ")", ";", "}", "}", "xlogger", ".", "exit", "(", ")", ";", "// profilerPeriod.stop().print();", "return", "result", ";", "}" ]
Read some attributes. IDL 4 version. @param names The attributes names @param source the device source (CACHE, DEV or CACHE_DEV) @param clIdent the client ID @return The read results. @throws DevFailed
[ "Read", "some", "attributes", ".", "IDL", "4", "version", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L1114-L1152
140,258
tango-controls/JTango
server/src/main/java/org/tango/server/servant/DeviceImpl.java
DeviceImpl.write_attributes
@Override public void write_attributes(final AttributeValue[] values) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); checkInitialization(); deviceMonitoring.startRequest("write_attributes"); clientIdentity.set(null); final String[] names = new String[values.length]; for (int i = 0; i < names.length; i++) { names[i] = values[i].name; logger.debug("writing {}", names[i]); } final Object lock = deviceLock.getAttributeLock(); try { synchronized (lock != null ? lock : new Object()) { AttributeGetterSetter.setAttributeValue(values, attributeList, stateImpl, aroundInvokeImpl, null); } } catch (final Exception e) { deviceMonitoring.addError(); if (e instanceof DevFailed) { throw (DevFailed) e; } else { // with CORBA, the stack trace is not visible by the client if // not inserted in DevFailed. throw DevFailedUtils.newDevFailed(e); } } xlogger.exit(); }
java
@Override public void write_attributes(final AttributeValue[] values) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); checkInitialization(); deviceMonitoring.startRequest("write_attributes"); clientIdentity.set(null); final String[] names = new String[values.length]; for (int i = 0; i < names.length; i++) { names[i] = values[i].name; logger.debug("writing {}", names[i]); } final Object lock = deviceLock.getAttributeLock(); try { synchronized (lock != null ? lock : new Object()) { AttributeGetterSetter.setAttributeValue(values, attributeList, stateImpl, aroundInvokeImpl, null); } } catch (final Exception e) { deviceMonitoring.addError(); if (e instanceof DevFailed) { throw (DevFailed) e; } else { // with CORBA, the stack trace is not visible by the client if // not inserted in DevFailed. throw DevFailedUtils.newDevFailed(e); } } xlogger.exit(); }
[ "@", "Override", "public", "void", "write_attributes", "(", "final", "AttributeValue", "[", "]", "values", ")", "throws", "DevFailed", "{", "MDC", ".", "setContextMap", "(", "contextMap", ")", ";", "xlogger", ".", "entry", "(", ")", ";", "checkInitialization", "(", ")", ";", "deviceMonitoring", ".", "startRequest", "(", "\"write_attributes\"", ")", ";", "clientIdentity", ".", "set", "(", "null", ")", ";", "final", "String", "[", "]", "names", "=", "new", "String", "[", "values", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "names", ".", "length", ";", "i", "++", ")", "{", "names", "[", "i", "]", "=", "values", "[", "i", "]", ".", "name", ";", "logger", ".", "debug", "(", "\"writing {}\"", ",", "names", "[", "i", "]", ")", ";", "}", "final", "Object", "lock", "=", "deviceLock", ".", "getAttributeLock", "(", ")", ";", "try", "{", "synchronized", "(", "lock", "!=", "null", "?", "lock", ":", "new", "Object", "(", ")", ")", "{", "AttributeGetterSetter", ".", "setAttributeValue", "(", "values", ",", "attributeList", ",", "stateImpl", ",", "aroundInvokeImpl", ",", "null", ")", ";", "}", "}", "catch", "(", "final", "Exception", "e", ")", "{", "deviceMonitoring", ".", "addError", "(", ")", ";", "if", "(", "e", "instanceof", "DevFailed", ")", "{", "throw", "(", "DevFailed", ")", "e", ";", "}", "else", "{", "// with CORBA, the stack trace is not visible by the client if", "// not inserted in DevFailed.", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "e", ")", ";", "}", "}", "xlogger", ".", "exit", "(", ")", ";", "}" ]
Write some attributes. IDL 1 version @param values a container for attribute values. @throws DevFailed
[ "Write", "some", "attributes", ".", "IDL", "1", "version" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L1217-L1245
140,259
tango-controls/JTango
server/src/main/java/org/tango/server/servant/DeviceImpl.java
DeviceImpl.write_attributes_4
@Override public void write_attributes_4(final AttributeValue_4[] values, final ClntIdent clIdent) throws MultiDevFailed, DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); checkInitialization(); final String[] names = new String[values.length]; for (int i = 0; i < names.length; i++) { names[i] = values[i].name; } logger.debug("writing {}", Arrays.toString(names)); deviceMonitoring.startRequest("write_attributes_4 " + Arrays.toString(names), clIdent); clientIdentity.set(clIdent); if (!name.equalsIgnoreCase(getAdminDeviceName())) { clientLocking.checkClientLocking(clIdent, names); } final Object lock = deviceLock.getAttributeLock(); try { synchronized (lock != null ? lock : new Object()) { AttributeGetterSetter.setAttributeValue4(values, attributeList, stateImpl, aroundInvokeImpl, clIdent); } } catch (final Exception e) { deviceMonitoring.addError(); if (e instanceof MultiDevFailed) { throw (MultiDevFailed) e; } else { // with CORBA, the stack trace is not visible by the client if // not inserted in DevFailed. throw DevFailedUtils.newDevFailed(e); } } xlogger.exit(); }
java
@Override public void write_attributes_4(final AttributeValue_4[] values, final ClntIdent clIdent) throws MultiDevFailed, DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); checkInitialization(); final String[] names = new String[values.length]; for (int i = 0; i < names.length; i++) { names[i] = values[i].name; } logger.debug("writing {}", Arrays.toString(names)); deviceMonitoring.startRequest("write_attributes_4 " + Arrays.toString(names), clIdent); clientIdentity.set(clIdent); if (!name.equalsIgnoreCase(getAdminDeviceName())) { clientLocking.checkClientLocking(clIdent, names); } final Object lock = deviceLock.getAttributeLock(); try { synchronized (lock != null ? lock : new Object()) { AttributeGetterSetter.setAttributeValue4(values, attributeList, stateImpl, aroundInvokeImpl, clIdent); } } catch (final Exception e) { deviceMonitoring.addError(); if (e instanceof MultiDevFailed) { throw (MultiDevFailed) e; } else { // with CORBA, the stack trace is not visible by the client if // not inserted in DevFailed. throw DevFailedUtils.newDevFailed(e); } } xlogger.exit(); }
[ "@", "Override", "public", "void", "write_attributes_4", "(", "final", "AttributeValue_4", "[", "]", "values", ",", "final", "ClntIdent", "clIdent", ")", "throws", "MultiDevFailed", ",", "DevFailed", "{", "MDC", ".", "setContextMap", "(", "contextMap", ")", ";", "xlogger", ".", "entry", "(", ")", ";", "checkInitialization", "(", ")", ";", "final", "String", "[", "]", "names", "=", "new", "String", "[", "values", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "names", ".", "length", ";", "i", "++", ")", "{", "names", "[", "i", "]", "=", "values", "[", "i", "]", ".", "name", ";", "}", "logger", ".", "debug", "(", "\"writing {}\"", ",", "Arrays", ".", "toString", "(", "names", ")", ")", ";", "deviceMonitoring", ".", "startRequest", "(", "\"write_attributes_4 \"", "+", "Arrays", ".", "toString", "(", "names", ")", ",", "clIdent", ")", ";", "clientIdentity", ".", "set", "(", "clIdent", ")", ";", "if", "(", "!", "name", ".", "equalsIgnoreCase", "(", "getAdminDeviceName", "(", ")", ")", ")", "{", "clientLocking", ".", "checkClientLocking", "(", "clIdent", ",", "names", ")", ";", "}", "final", "Object", "lock", "=", "deviceLock", ".", "getAttributeLock", "(", ")", ";", "try", "{", "synchronized", "(", "lock", "!=", "null", "?", "lock", ":", "new", "Object", "(", ")", ")", "{", "AttributeGetterSetter", ".", "setAttributeValue4", "(", "values", ",", "attributeList", ",", "stateImpl", ",", "aroundInvokeImpl", ",", "clIdent", ")", ";", "}", "}", "catch", "(", "final", "Exception", "e", ")", "{", "deviceMonitoring", ".", "addError", "(", ")", ";", "if", "(", "e", "instanceof", "MultiDevFailed", ")", "{", "throw", "(", "MultiDevFailed", ")", "e", ";", "}", "else", "{", "// with CORBA, the stack trace is not visible by the client if", "// not inserted in DevFailed.", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "e", ")", ";", "}", "}", "xlogger", ".", "exit", "(", ")", ";", "}" ]
Write some attributes. IDL 4 version @param values a container for attribute values. @param clIdent the client ID @throws DevFailed
[ "Write", "some", "attributes", ".", "IDL", "4", "version" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L1290-L1322
140,260
tango-controls/JTango
server/src/main/java/org/tango/server/servant/DeviceImpl.java
DeviceImpl.command_list_query
@Override public DevCmdInfo[] command_list_query() throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); // checkInitialization(); deviceMonitoring.startRequest("command_list_query"); // Retrieve number of command and allocate memory to send back info final List<CommandImpl> cmdList = getCommandList(); Collections.sort(cmdList); final DevCmdInfo[] back = new DevCmdInfo[commandList.size()]; int i = 0; for (final CommandImpl cmd : cmdList) { final DevCmdInfo tmp = new DevCmdInfo(); tmp.cmd_name = cmd.getName(); tmp.cmd_tag = cmd.getTag(); tmp.in_type = cmd.getInType().getTangoIDLType(); tmp.out_type = cmd.getOutType().getTangoIDLType(); tmp.in_type_desc = cmd.getInTypeDesc(); tmp.out_type_desc = cmd.getOutTypeDesc(); back[i++] = tmp; } xlogger.exit(); return back; }
java
@Override public DevCmdInfo[] command_list_query() throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); // checkInitialization(); deviceMonitoring.startRequest("command_list_query"); // Retrieve number of command and allocate memory to send back info final List<CommandImpl> cmdList = getCommandList(); Collections.sort(cmdList); final DevCmdInfo[] back = new DevCmdInfo[commandList.size()]; int i = 0; for (final CommandImpl cmd : cmdList) { final DevCmdInfo tmp = new DevCmdInfo(); tmp.cmd_name = cmd.getName(); tmp.cmd_tag = cmd.getTag(); tmp.in_type = cmd.getInType().getTangoIDLType(); tmp.out_type = cmd.getOutType().getTangoIDLType(); tmp.in_type_desc = cmd.getInTypeDesc(); tmp.out_type_desc = cmd.getOutTypeDesc(); back[i++] = tmp; } xlogger.exit(); return back; }
[ "@", "Override", "public", "DevCmdInfo", "[", "]", "command_list_query", "(", ")", "throws", "DevFailed", "{", "MDC", ".", "setContextMap", "(", "contextMap", ")", ";", "xlogger", ".", "entry", "(", ")", ";", "// checkInitialization();", "deviceMonitoring", ".", "startRequest", "(", "\"command_list_query\"", ")", ";", "// Retrieve number of command and allocate memory to send back info", "final", "List", "<", "CommandImpl", ">", "cmdList", "=", "getCommandList", "(", ")", ";", "Collections", ".", "sort", "(", "cmdList", ")", ";", "final", "DevCmdInfo", "[", "]", "back", "=", "new", "DevCmdInfo", "[", "commandList", ".", "size", "(", ")", "]", ";", "int", "i", "=", "0", ";", "for", "(", "final", "CommandImpl", "cmd", ":", "cmdList", ")", "{", "final", "DevCmdInfo", "tmp", "=", "new", "DevCmdInfo", "(", ")", ";", "tmp", ".", "cmd_name", "=", "cmd", ".", "getName", "(", ")", ";", "tmp", ".", "cmd_tag", "=", "cmd", ".", "getTag", "(", ")", ";", "tmp", ".", "in_type", "=", "cmd", ".", "getInType", "(", ")", ".", "getTangoIDLType", "(", ")", ";", "tmp", ".", "out_type", "=", "cmd", ".", "getOutType", "(", ")", ".", "getTangoIDLType", "(", ")", ";", "tmp", ".", "in_type_desc", "=", "cmd", ".", "getInTypeDesc", "(", ")", ";", "tmp", ".", "out_type_desc", "=", "cmd", ".", "getOutTypeDesc", "(", ")", ";", "back", "[", "i", "++", "]", "=", "tmp", ";", "}", "xlogger", ".", "exit", "(", ")", ";", "return", "back", ";", "}" ]
Query all commands details. IDL 1 version @return the commands details of this device @throws DevFailed
[ "Query", "all", "commands", "details", ".", "IDL", "1", "version" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L1451-L1474
140,261
tango-controls/JTango
server/src/main/java/org/tango/server/servant/DeviceImpl.java
DeviceImpl.command_query
@Override public DevCmdInfo command_query(final String commandName) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); // checkInitialization(); deviceMonitoring.startRequest("command_query " + commandName); final CommandImpl foundCmd = getCommand(commandName); final DevCmdInfo tmp = new DevCmdInfo(); tmp.cmd_name = foundCmd.getName(); tmp.cmd_tag = foundCmd.getTag(); tmp.in_type = foundCmd.getInType().getTangoIDLType(); tmp.out_type = foundCmd.getOutType().getTangoIDLType(); tmp.in_type_desc = foundCmd.getInTypeDesc(); tmp.out_type_desc = foundCmd.getOutTypeDesc(); return tmp; }
java
@Override public DevCmdInfo command_query(final String commandName) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); // checkInitialization(); deviceMonitoring.startRequest("command_query " + commandName); final CommandImpl foundCmd = getCommand(commandName); final DevCmdInfo tmp = new DevCmdInfo(); tmp.cmd_name = foundCmd.getName(); tmp.cmd_tag = foundCmd.getTag(); tmp.in_type = foundCmd.getInType().getTangoIDLType(); tmp.out_type = foundCmd.getOutType().getTangoIDLType(); tmp.in_type_desc = foundCmd.getInTypeDesc(); tmp.out_type_desc = foundCmd.getOutTypeDesc(); return tmp; }
[ "@", "Override", "public", "DevCmdInfo", "command_query", "(", "final", "String", "commandName", ")", "throws", "DevFailed", "{", "MDC", ".", "setContextMap", "(", "contextMap", ")", ";", "xlogger", ".", "entry", "(", ")", ";", "// checkInitialization();", "deviceMonitoring", ".", "startRequest", "(", "\"command_query \"", "+", "commandName", ")", ";", "final", "CommandImpl", "foundCmd", "=", "getCommand", "(", "commandName", ")", ";", "final", "DevCmdInfo", "tmp", "=", "new", "DevCmdInfo", "(", ")", ";", "tmp", ".", "cmd_name", "=", "foundCmd", ".", "getName", "(", ")", ";", "tmp", ".", "cmd_tag", "=", "foundCmd", ".", "getTag", "(", ")", ";", "tmp", ".", "in_type", "=", "foundCmd", ".", "getInType", "(", ")", ".", "getTangoIDLType", "(", ")", ";", "tmp", ".", "out_type", "=", "foundCmd", ".", "getOutType", "(", ")", ".", "getTangoIDLType", "(", ")", ";", "tmp", ".", "in_type_desc", "=", "foundCmd", ".", "getInTypeDesc", "(", ")", ";", "tmp", ".", "out_type_desc", "=", "foundCmd", ".", "getOutTypeDesc", "(", ")", ";", "return", "tmp", ";", "}" ]
Query a command details. IDL 1 version. @param commandName the command name @return the command details of this device @throws DevFailed
[ "Query", "a", "command", "details", ".", "IDL", "1", "version", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L1515-L1530
140,262
tango-controls/JTango
server/src/main/java/org/tango/server/servant/DeviceImpl.java
DeviceImpl.command_inout
@Override public Any command_inout(final String command, final Any argin) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); if (!command.equalsIgnoreCase(DeviceImpl.STATE_NAME) && !command.equalsIgnoreCase(DeviceImpl.STATUS_NAME)) { checkInitialization(); } final long request = deviceMonitoring.startRequest("command_inout " + command); clientIdentity.set(null); Any argout = null; try { argout = commandHandler(command, argin, DevSource.CACHE_DEV, null); } catch (final Exception e) { deviceMonitoring.addError(); if (e instanceof DevFailed) { throw (DevFailed) e; } else { // with CORBA, the stack trace is not visible by the client if // not inserted in DevFailed. throw DevFailedUtils.newDevFailed(e); } } finally { deviceMonitoring.endRequest(request); } xlogger.exit(); return argout; }
java
@Override public Any command_inout(final String command, final Any argin) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); if (!command.equalsIgnoreCase(DeviceImpl.STATE_NAME) && !command.equalsIgnoreCase(DeviceImpl.STATUS_NAME)) { checkInitialization(); } final long request = deviceMonitoring.startRequest("command_inout " + command); clientIdentity.set(null); Any argout = null; try { argout = commandHandler(command, argin, DevSource.CACHE_DEV, null); } catch (final Exception e) { deviceMonitoring.addError(); if (e instanceof DevFailed) { throw (DevFailed) e; } else { // with CORBA, the stack trace is not visible by the client if // not inserted in DevFailed. throw DevFailedUtils.newDevFailed(e); } } finally { deviceMonitoring.endRequest(request); } xlogger.exit(); return argout; }
[ "@", "Override", "public", "Any", "command_inout", "(", "final", "String", "command", ",", "final", "Any", "argin", ")", "throws", "DevFailed", "{", "MDC", ".", "setContextMap", "(", "contextMap", ")", ";", "xlogger", ".", "entry", "(", ")", ";", "if", "(", "!", "command", ".", "equalsIgnoreCase", "(", "DeviceImpl", ".", "STATE_NAME", ")", "&&", "!", "command", ".", "equalsIgnoreCase", "(", "DeviceImpl", ".", "STATUS_NAME", ")", ")", "{", "checkInitialization", "(", ")", ";", "}", "final", "long", "request", "=", "deviceMonitoring", ".", "startRequest", "(", "\"command_inout \"", "+", "command", ")", ";", "clientIdentity", ".", "set", "(", "null", ")", ";", "Any", "argout", "=", "null", ";", "try", "{", "argout", "=", "commandHandler", "(", "command", ",", "argin", ",", "DevSource", ".", "CACHE_DEV", ",", "null", ")", ";", "}", "catch", "(", "final", "Exception", "e", ")", "{", "deviceMonitoring", ".", "addError", "(", ")", ";", "if", "(", "e", "instanceof", "DevFailed", ")", "{", "throw", "(", "DevFailed", ")", "e", ";", "}", "else", "{", "// with CORBA, the stack trace is not visible by the client if", "// not inserted in DevFailed.", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "e", ")", ";", "}", "}", "finally", "{", "deviceMonitoring", ".", "endRequest", "(", "request", ")", ";", "}", "xlogger", ".", "exit", "(", ")", ";", "return", "argout", ";", "}" ]
Execute a command. IDL 1 version @param command command name @param argin command parameters @return command result @throws DevFailed
[ "Execute", "a", "command", ".", "IDL", "1", "version" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L1565-L1591
140,263
tango-controls/JTango
server/src/main/java/org/tango/server/servant/DeviceImpl.java
DeviceImpl.command_inout_4
@Override public Any command_inout_4(final String commandName, final Any argin, final DevSource source, final ClntIdent clIdent) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(commandName); if (!commandName.equalsIgnoreCase(DeviceImpl.STATE_NAME) && !commandName.equalsIgnoreCase(DeviceImpl.STATUS_NAME)) { checkInitialization(); } final long request = deviceMonitoring.startRequest("Operation command_inout_4 (cmd = " + commandName + ")", source, clIdent); clientIdentity.set(clIdent); Any argout = null; if (!name.equalsIgnoreCase(getAdminDeviceName())) { clientLocking.checkClientLocking(clIdent, commandName); } try { argout = commandHandler(commandName, argin, source, clIdent); } catch (final Exception e) { deviceMonitoring.addError(); if (e instanceof DevFailed) { throw (DevFailed) e; } else { // with CORBA, the stack trace is not visible by the client if // not inserted in DevFailed. throw DevFailedUtils.newDevFailed(e); } } finally { deviceMonitoring.endRequest(request); } xlogger.exit(); return argout; }
java
@Override public Any command_inout_4(final String commandName, final Any argin, final DevSource source, final ClntIdent clIdent) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(commandName); if (!commandName.equalsIgnoreCase(DeviceImpl.STATE_NAME) && !commandName.equalsIgnoreCase(DeviceImpl.STATUS_NAME)) { checkInitialization(); } final long request = deviceMonitoring.startRequest("Operation command_inout_4 (cmd = " + commandName + ")", source, clIdent); clientIdentity.set(clIdent); Any argout = null; if (!name.equalsIgnoreCase(getAdminDeviceName())) { clientLocking.checkClientLocking(clIdent, commandName); } try { argout = commandHandler(commandName, argin, source, clIdent); } catch (final Exception e) { deviceMonitoring.addError(); if (e instanceof DevFailed) { throw (DevFailed) e; } else { // with CORBA, the stack trace is not visible by the client if // not inserted in DevFailed. throw DevFailedUtils.newDevFailed(e); } } finally { deviceMonitoring.endRequest(request); } xlogger.exit(); return argout; }
[ "@", "Override", "public", "Any", "command_inout_4", "(", "final", "String", "commandName", ",", "final", "Any", "argin", ",", "final", "DevSource", "source", ",", "final", "ClntIdent", "clIdent", ")", "throws", "DevFailed", "{", "MDC", ".", "setContextMap", "(", "contextMap", ")", ";", "xlogger", ".", "entry", "(", "commandName", ")", ";", "if", "(", "!", "commandName", ".", "equalsIgnoreCase", "(", "DeviceImpl", ".", "STATE_NAME", ")", "&&", "!", "commandName", ".", "equalsIgnoreCase", "(", "DeviceImpl", ".", "STATUS_NAME", ")", ")", "{", "checkInitialization", "(", ")", ";", "}", "final", "long", "request", "=", "deviceMonitoring", ".", "startRequest", "(", "\"Operation command_inout_4 (cmd = \"", "+", "commandName", "+", "\")\"", ",", "source", ",", "clIdent", ")", ";", "clientIdentity", ".", "set", "(", "clIdent", ")", ";", "Any", "argout", "=", "null", ";", "if", "(", "!", "name", ".", "equalsIgnoreCase", "(", "getAdminDeviceName", "(", ")", ")", ")", "{", "clientLocking", ".", "checkClientLocking", "(", "clIdent", ",", "commandName", ")", ";", "}", "try", "{", "argout", "=", "commandHandler", "(", "commandName", ",", "argin", ",", "source", ",", "clIdent", ")", ";", "}", "catch", "(", "final", "Exception", "e", ")", "{", "deviceMonitoring", ".", "addError", "(", ")", ";", "if", "(", "e", "instanceof", "DevFailed", ")", "{", "throw", "(", "DevFailed", ")", "e", ";", "}", "else", "{", "// with CORBA, the stack trace is not visible by the client if", "// not inserted in DevFailed.", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "e", ")", ";", "}", "}", "finally", "{", "deviceMonitoring", ".", "endRequest", "(", "request", ")", ";", "}", "xlogger", ".", "exit", "(", ")", ";", "return", "argout", ";", "}" ]
Execute a command. IDL 4 version @param commandName command name @param argin command parameters @param source the device source (CACHE, DEV or CACHE_DEV) @param clIdent client id @return command result @throws DevFailed
[ "Execute", "a", "command", ".", "IDL", "4", "version" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L1638-L1670
140,264
tango-controls/JTango
server/src/main/java/org/tango/server/servant/DeviceImpl.java
DeviceImpl.command_inout_history_2
@Override public DevCmdHistory[] command_inout_history_2(final String commandName, final int maxSize) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); checkInitialization(); deviceMonitoring.startRequest("command_inout_history_2 " + commandName); // TODO command_inout_history_2 // returncommandHistory.get(command).toArray(n) return new DevCmdHistory[]{}; }
java
@Override public DevCmdHistory[] command_inout_history_2(final String commandName, final int maxSize) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); checkInitialization(); deviceMonitoring.startRequest("command_inout_history_2 " + commandName); // TODO command_inout_history_2 // returncommandHistory.get(command).toArray(n) return new DevCmdHistory[]{}; }
[ "@", "Override", "public", "DevCmdHistory", "[", "]", "command_inout_history_2", "(", "final", "String", "commandName", ",", "final", "int", "maxSize", ")", "throws", "DevFailed", "{", "MDC", ".", "setContextMap", "(", "contextMap", ")", ";", "xlogger", ".", "entry", "(", ")", ";", "checkInitialization", "(", ")", ";", "deviceMonitoring", ".", "startRequest", "(", "\"command_inout_history_2 \"", "+", "commandName", ")", ";", "// TODO command_inout_history_2", "// returncommandHistory.get(command).toArray(n)", "return", "new", "DevCmdHistory", "[", "]", "{", "}", ";", "}" ]
Command history. IDL 2 version. @param commandName the command name @param maxSize the maximum depth of history @return the history @throws DevFailed
[ "Command", "history", ".", "IDL", "2", "version", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L1680-L1689
140,265
tango-controls/JTango
server/src/main/java/org/tango/server/servant/DeviceImpl.java
DeviceImpl.command_inout_history_4
@Override public DevCmdHistory_4 command_inout_history_4(final String commandName, final int maxSize) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); checkInitialization(); final long request = deviceMonitoring.startRequest("command_inout_history_4 " + commandName); final CommandImpl command = getCommand(commandName); DevCmdHistory_4 history = null; try { history = command.getHistory().toDevCmdHistory4(maxSize); } catch (final Exception e) { deviceMonitoring.addError(); if (e instanceof DevFailed) { throw (DevFailed) e; } else { // with CORBA, the stack trace is not visible by the client if // not inserted in DevFailed. throw DevFailedUtils.newDevFailed(e); } } finally { deviceMonitoring.endRequest(request); } return history; }
java
@Override public DevCmdHistory_4 command_inout_history_4(final String commandName, final int maxSize) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); checkInitialization(); final long request = deviceMonitoring.startRequest("command_inout_history_4 " + commandName); final CommandImpl command = getCommand(commandName); DevCmdHistory_4 history = null; try { history = command.getHistory().toDevCmdHistory4(maxSize); } catch (final Exception e) { deviceMonitoring.addError(); if (e instanceof DevFailed) { throw (DevFailed) e; } else { // with CORBA, the stack trace is not visible by the client if // not inserted in DevFailed. throw DevFailedUtils.newDevFailed(e); } } finally { deviceMonitoring.endRequest(request); } return history; }
[ "@", "Override", "public", "DevCmdHistory_4", "command_inout_history_4", "(", "final", "String", "commandName", ",", "final", "int", "maxSize", ")", "throws", "DevFailed", "{", "MDC", ".", "setContextMap", "(", "contextMap", ")", ";", "xlogger", ".", "entry", "(", ")", ";", "checkInitialization", "(", ")", ";", "final", "long", "request", "=", "deviceMonitoring", ".", "startRequest", "(", "\"command_inout_history_4 \"", "+", "commandName", ")", ";", "final", "CommandImpl", "command", "=", "getCommand", "(", "commandName", ")", ";", "DevCmdHistory_4", "history", "=", "null", ";", "try", "{", "history", "=", "command", ".", "getHistory", "(", ")", ".", "toDevCmdHistory4", "(", "maxSize", ")", ";", "}", "catch", "(", "final", "Exception", "e", ")", "{", "deviceMonitoring", ".", "addError", "(", ")", ";", "if", "(", "e", "instanceof", "DevFailed", ")", "{", "throw", "(", "DevFailed", ")", "e", ";", "}", "else", "{", "// with CORBA, the stack trace is not visible by the client if", "// not inserted in DevFailed.", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "e", ")", ";", "}", "}", "finally", "{", "deviceMonitoring", ".", "endRequest", "(", "request", ")", ";", "}", "return", "history", ";", "}" ]
Command history. IDL 4 version. @param commandName the command name @param maxSize the maximum depth of history @return the history @throws DevFailed
[ "Command", "history", ".", "IDL", "4", "version", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L1699-L1723
140,266
tango-controls/JTango
server/src/main/java/org/tango/server/servant/DeviceImpl.java
DeviceImpl.get_attribute_config_5
@Override public AttributeConfig_5[] get_attribute_config_5(final String[] attributeNames) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(Arrays.toString(attributeNames)); // checkInitialization(); deviceMonitoring.startRequest("get_attribute_config_5 " + Arrays.toString(attributeNames)); // check if we must retrieve all attributes config final int length = attributeNames.length; boolean getAllConfig = false; if (length == 1 && attributeNames[0].contains(ALL_ATTR)) { getAllConfig = true; } AttributeConfig_5[] result; if (getAllConfig) { logger.debug("get All"); final List<AttributeImpl> attrList = getAttributeList(); // Collections.sort(attrList); result = new AttributeConfig_5[attributeList.size()]; int i = 0; for (final AttributeImpl attribute : attrList) { if (!attribute.getName().equals(STATE_NAME) && !attribute.getName().equals(STATUS_NAME)) { result[i++] = TangoIDLAttributeUtil.toAttributeConfig5(attribute); } } result[i++] = TangoIDLAttributeUtil.toAttributeConfig5(AttributeGetterSetter.getAttribute(STATE_NAME, attrList)); result[i++] = TangoIDLAttributeUtil.toAttributeConfig5(AttributeGetterSetter.getAttribute(STATUS_NAME, attrList)); } else { result = new AttributeConfig_5[attributeNames.length]; int i = 0; for (final String attributeName : attributeNames) { final AttributeImpl attribute = AttributeGetterSetter.getAttribute(attributeName, attributeList); logger.debug("{}:{}", attributeName, attribute.getProperties()); result[i++] = TangoIDLAttributeUtil.toAttributeConfig5(attribute); } } xlogger.exit(); return result; }
java
@Override public AttributeConfig_5[] get_attribute_config_5(final String[] attributeNames) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(Arrays.toString(attributeNames)); // checkInitialization(); deviceMonitoring.startRequest("get_attribute_config_5 " + Arrays.toString(attributeNames)); // check if we must retrieve all attributes config final int length = attributeNames.length; boolean getAllConfig = false; if (length == 1 && attributeNames[0].contains(ALL_ATTR)) { getAllConfig = true; } AttributeConfig_5[] result; if (getAllConfig) { logger.debug("get All"); final List<AttributeImpl> attrList = getAttributeList(); // Collections.sort(attrList); result = new AttributeConfig_5[attributeList.size()]; int i = 0; for (final AttributeImpl attribute : attrList) { if (!attribute.getName().equals(STATE_NAME) && !attribute.getName().equals(STATUS_NAME)) { result[i++] = TangoIDLAttributeUtil.toAttributeConfig5(attribute); } } result[i++] = TangoIDLAttributeUtil.toAttributeConfig5(AttributeGetterSetter.getAttribute(STATE_NAME, attrList)); result[i++] = TangoIDLAttributeUtil.toAttributeConfig5(AttributeGetterSetter.getAttribute(STATUS_NAME, attrList)); } else { result = new AttributeConfig_5[attributeNames.length]; int i = 0; for (final String attributeName : attributeNames) { final AttributeImpl attribute = AttributeGetterSetter.getAttribute(attributeName, attributeList); logger.debug("{}:{}", attributeName, attribute.getProperties()); result[i++] = TangoIDLAttributeUtil.toAttributeConfig5(attribute); } } xlogger.exit(); return result; }
[ "@", "Override", "public", "AttributeConfig_5", "[", "]", "get_attribute_config_5", "(", "final", "String", "[", "]", "attributeNames", ")", "throws", "DevFailed", "{", "MDC", ".", "setContextMap", "(", "contextMap", ")", ";", "xlogger", ".", "entry", "(", "Arrays", ".", "toString", "(", "attributeNames", ")", ")", ";", "// checkInitialization();", "deviceMonitoring", ".", "startRequest", "(", "\"get_attribute_config_5 \"", "+", "Arrays", ".", "toString", "(", "attributeNames", ")", ")", ";", "// check if we must retrieve all attributes config", "final", "int", "length", "=", "attributeNames", ".", "length", ";", "boolean", "getAllConfig", "=", "false", ";", "if", "(", "length", "==", "1", "&&", "attributeNames", "[", "0", "]", ".", "contains", "(", "ALL_ATTR", ")", ")", "{", "getAllConfig", "=", "true", ";", "}", "AttributeConfig_5", "[", "]", "result", ";", "if", "(", "getAllConfig", ")", "{", "logger", ".", "debug", "(", "\"get All\"", ")", ";", "final", "List", "<", "AttributeImpl", ">", "attrList", "=", "getAttributeList", "(", ")", ";", "// Collections.sort(attrList);", "result", "=", "new", "AttributeConfig_5", "[", "attributeList", ".", "size", "(", ")", "]", ";", "int", "i", "=", "0", ";", "for", "(", "final", "AttributeImpl", "attribute", ":", "attrList", ")", "{", "if", "(", "!", "attribute", ".", "getName", "(", ")", ".", "equals", "(", "STATE_NAME", ")", "&&", "!", "attribute", ".", "getName", "(", ")", ".", "equals", "(", "STATUS_NAME", ")", ")", "{", "result", "[", "i", "++", "]", "=", "TangoIDLAttributeUtil", ".", "toAttributeConfig5", "(", "attribute", ")", ";", "}", "}", "result", "[", "i", "++", "]", "=", "TangoIDLAttributeUtil", ".", "toAttributeConfig5", "(", "AttributeGetterSetter", ".", "getAttribute", "(", "STATE_NAME", ",", "attrList", ")", ")", ";", "result", "[", "i", "++", "]", "=", "TangoIDLAttributeUtil", ".", "toAttributeConfig5", "(", "AttributeGetterSetter", ".", "getAttribute", "(", "STATUS_NAME", ",", "attrList", ")", ")", ";", "}", "else", "{", "result", "=", "new", "AttributeConfig_5", "[", "attributeNames", ".", "length", "]", ";", "int", "i", "=", "0", ";", "for", "(", "final", "String", "attributeName", ":", "attributeNames", ")", "{", "final", "AttributeImpl", "attribute", "=", "AttributeGetterSetter", ".", "getAttribute", "(", "attributeName", ",", "attributeList", ")", ";", "logger", ".", "debug", "(", "\"{}:{}\"", ",", "attributeName", ",", "attribute", ".", "getProperties", "(", ")", ")", ";", "result", "[", "i", "++", "]", "=", "TangoIDLAttributeUtil", ".", "toAttributeConfig5", "(", "attribute", ")", ";", "}", "}", "xlogger", ".", "exit", "(", ")", ";", "return", "result", ";", "}" ]
Get attributes config. IDL5 version @param attributeNames the attribute names or "All attributes" @return the attribute configs @throws DevFailed
[ "Get", "attributes", "config", ".", "IDL5", "version" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L1796-L1839
140,267
tango-controls/JTango
server/src/main/java/org/tango/server/servant/DeviceImpl.java
DeviceImpl.get_attribute_config
@Override public AttributeConfig[] get_attribute_config(final String[] attributeNames) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); // checkInitialization(); deviceMonitoring.startRequest("get_attribute_config " + Arrays.toString(attributeNames)); // check if we must retrieve all attributes config final int length = attributeNames.length; boolean getAllConfig = false; if (length == 1 && attributeNames[0].contains(ALL_ATTR)) { getAllConfig = true; } AttributeConfig[] result; if (getAllConfig) { final List<AttributeImpl> attrList = getAttributeList(); Collections.sort(attrList); result = new AttributeConfig[attributeList.size()]; int i = 0; for (final AttributeImpl attribute : attrList) { result[i++] = TangoIDLAttributeUtil.toAttributeConfig(attribute); } } else { result = new AttributeConfig[attributeNames.length]; int i = 0; for (final String attributeName : attributeNames) { final AttributeImpl attribute = AttributeGetterSetter.getAttribute(attributeName, attributeList); result[i++] = TangoIDLAttributeUtil.toAttributeConfig(attribute); } } xlogger.exit(); return result; }
java
@Override public AttributeConfig[] get_attribute_config(final String[] attributeNames) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); // checkInitialization(); deviceMonitoring.startRequest("get_attribute_config " + Arrays.toString(attributeNames)); // check if we must retrieve all attributes config final int length = attributeNames.length; boolean getAllConfig = false; if (length == 1 && attributeNames[0].contains(ALL_ATTR)) { getAllConfig = true; } AttributeConfig[] result; if (getAllConfig) { final List<AttributeImpl> attrList = getAttributeList(); Collections.sort(attrList); result = new AttributeConfig[attributeList.size()]; int i = 0; for (final AttributeImpl attribute : attrList) { result[i++] = TangoIDLAttributeUtil.toAttributeConfig(attribute); } } else { result = new AttributeConfig[attributeNames.length]; int i = 0; for (final String attributeName : attributeNames) { final AttributeImpl attribute = AttributeGetterSetter.getAttribute(attributeName, attributeList); result[i++] = TangoIDLAttributeUtil.toAttributeConfig(attribute); } } xlogger.exit(); return result; }
[ "@", "Override", "public", "AttributeConfig", "[", "]", "get_attribute_config", "(", "final", "String", "[", "]", "attributeNames", ")", "throws", "DevFailed", "{", "MDC", ".", "setContextMap", "(", "contextMap", ")", ";", "xlogger", ".", "entry", "(", ")", ";", "// checkInitialization();", "deviceMonitoring", ".", "startRequest", "(", "\"get_attribute_config \"", "+", "Arrays", ".", "toString", "(", "attributeNames", ")", ")", ";", "// check if we must retrieve all attributes config", "final", "int", "length", "=", "attributeNames", ".", "length", ";", "boolean", "getAllConfig", "=", "false", ";", "if", "(", "length", "==", "1", "&&", "attributeNames", "[", "0", "]", ".", "contains", "(", "ALL_ATTR", ")", ")", "{", "getAllConfig", "=", "true", ";", "}", "AttributeConfig", "[", "]", "result", ";", "if", "(", "getAllConfig", ")", "{", "final", "List", "<", "AttributeImpl", ">", "attrList", "=", "getAttributeList", "(", ")", ";", "Collections", ".", "sort", "(", "attrList", ")", ";", "result", "=", "new", "AttributeConfig", "[", "attributeList", ".", "size", "(", ")", "]", ";", "int", "i", "=", "0", ";", "for", "(", "final", "AttributeImpl", "attribute", ":", "attrList", ")", "{", "result", "[", "i", "++", "]", "=", "TangoIDLAttributeUtil", ".", "toAttributeConfig", "(", "attribute", ")", ";", "}", "}", "else", "{", "result", "=", "new", "AttributeConfig", "[", "attributeNames", ".", "length", "]", ";", "int", "i", "=", "0", ";", "for", "(", "final", "String", "attributeName", ":", "attributeNames", ")", "{", "final", "AttributeImpl", "attribute", "=", "AttributeGetterSetter", ".", "getAttribute", "(", "attributeName", ",", "attributeList", ")", ";", "result", "[", "i", "++", "]", "=", "TangoIDLAttributeUtil", ".", "toAttributeConfig", "(", "attribute", ")", ";", "}", "}", "xlogger", ".", "exit", "(", ")", ";", "return", "result", ";", "}" ]
Get attributes config. IDL1 version @param attributeNames the attribute names or "All attributes" @return the attribute configs @throws DevFailed
[ "Get", "attributes", "config", ".", "IDL1", "version" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L1948-L1981
140,268
tango-controls/JTango
server/src/main/java/org/tango/server/servant/DeviceImpl.java
DeviceImpl.set_attribute_config_5
@Override public void set_attribute_config_5(final AttributeConfig_5[] newConf, final ClntIdent clIdent) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); checkInitialization(); clientIdentity.set(clIdent); if (!name.equalsIgnoreCase(getAdminDeviceName())) { clientLocking.checkClientLocking(clIdent); } deviceMonitoring.startRequest("set_attribute_config_5", clIdent); for (final AttributeConfig_5 attributeConfig : newConf) { final String attributeName = attributeConfig.name; final AttributeImpl attribute = AttributeGetterSetter.getAttribute(attributeName, attributeList); if (attribute.getName().equals(STATE_NAME) || attribute.getName().equals(STATUS_NAME)) { throw DevFailedUtils.newDevFailed("set attribute is not possible for " + attribute.getName()); } if (!attribute.getFormat().equals(attributeConfig.data_format) || !attribute.getWritable().equals(attributeConfig.writable) || !attribute.getDispLevel().equals(attributeConfig.level) || attribute.getTangoType() != attributeConfig.data_type) { throw DevFailedUtils.newDevFailed(ExceptionMessages.ATTR_NOT_ALLOWED, "not a good config"); } final AttributePropertiesImpl props = TangoIDLAttributeUtil.toAttributeProperties(attributeConfig); logger.debug("set_attribute_config_5: {}", props); if (!attribute.getProperties().isEnumMutable() && !Arrays.equals(attribute.getProperties().getEnumLabels(), props.getEnumLabels())) { throw DevFailedUtils .newDevFailed(ExceptionMessages.NOT_SUPPORTED_FEATURE, "It's not supported to change enumeration labels number from outside the Tango device class code"); } attribute.setProperties(props); } xlogger.exit(); }
java
@Override public void set_attribute_config_5(final AttributeConfig_5[] newConf, final ClntIdent clIdent) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); checkInitialization(); clientIdentity.set(clIdent); if (!name.equalsIgnoreCase(getAdminDeviceName())) { clientLocking.checkClientLocking(clIdent); } deviceMonitoring.startRequest("set_attribute_config_5", clIdent); for (final AttributeConfig_5 attributeConfig : newConf) { final String attributeName = attributeConfig.name; final AttributeImpl attribute = AttributeGetterSetter.getAttribute(attributeName, attributeList); if (attribute.getName().equals(STATE_NAME) || attribute.getName().equals(STATUS_NAME)) { throw DevFailedUtils.newDevFailed("set attribute is not possible for " + attribute.getName()); } if (!attribute.getFormat().equals(attributeConfig.data_format) || !attribute.getWritable().equals(attributeConfig.writable) || !attribute.getDispLevel().equals(attributeConfig.level) || attribute.getTangoType() != attributeConfig.data_type) { throw DevFailedUtils.newDevFailed(ExceptionMessages.ATTR_NOT_ALLOWED, "not a good config"); } final AttributePropertiesImpl props = TangoIDLAttributeUtil.toAttributeProperties(attributeConfig); logger.debug("set_attribute_config_5: {}", props); if (!attribute.getProperties().isEnumMutable() && !Arrays.equals(attribute.getProperties().getEnumLabels(), props.getEnumLabels())) { throw DevFailedUtils .newDevFailed(ExceptionMessages.NOT_SUPPORTED_FEATURE, "It's not supported to change enumeration labels number from outside the Tango device class code"); } attribute.setProperties(props); } xlogger.exit(); }
[ "@", "Override", "public", "void", "set_attribute_config_5", "(", "final", "AttributeConfig_5", "[", "]", "newConf", ",", "final", "ClntIdent", "clIdent", ")", "throws", "DevFailed", "{", "MDC", ".", "setContextMap", "(", "contextMap", ")", ";", "xlogger", ".", "entry", "(", ")", ";", "checkInitialization", "(", ")", ";", "clientIdentity", ".", "set", "(", "clIdent", ")", ";", "if", "(", "!", "name", ".", "equalsIgnoreCase", "(", "getAdminDeviceName", "(", ")", ")", ")", "{", "clientLocking", ".", "checkClientLocking", "(", "clIdent", ")", ";", "}", "deviceMonitoring", ".", "startRequest", "(", "\"set_attribute_config_5\"", ",", "clIdent", ")", ";", "for", "(", "final", "AttributeConfig_5", "attributeConfig", ":", "newConf", ")", "{", "final", "String", "attributeName", "=", "attributeConfig", ".", "name", ";", "final", "AttributeImpl", "attribute", "=", "AttributeGetterSetter", ".", "getAttribute", "(", "attributeName", ",", "attributeList", ")", ";", "if", "(", "attribute", ".", "getName", "(", ")", ".", "equals", "(", "STATE_NAME", ")", "||", "attribute", ".", "getName", "(", ")", ".", "equals", "(", "STATUS_NAME", ")", ")", "{", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "\"set attribute is not possible for \"", "+", "attribute", ".", "getName", "(", ")", ")", ";", "}", "if", "(", "!", "attribute", ".", "getFormat", "(", ")", ".", "equals", "(", "attributeConfig", ".", "data_format", ")", "||", "!", "attribute", ".", "getWritable", "(", ")", ".", "equals", "(", "attributeConfig", ".", "writable", ")", "||", "!", "attribute", ".", "getDispLevel", "(", ")", ".", "equals", "(", "attributeConfig", ".", "level", ")", "||", "attribute", ".", "getTangoType", "(", ")", "!=", "attributeConfig", ".", "data_type", ")", "{", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "ExceptionMessages", ".", "ATTR_NOT_ALLOWED", ",", "\"not a good config\"", ")", ";", "}", "final", "AttributePropertiesImpl", "props", "=", "TangoIDLAttributeUtil", ".", "toAttributeProperties", "(", "attributeConfig", ")", ";", "logger", ".", "debug", "(", "\"set_attribute_config_5: {}\"", ",", "props", ")", ";", "if", "(", "!", "attribute", ".", "getProperties", "(", ")", ".", "isEnumMutable", "(", ")", "&&", "!", "Arrays", ".", "equals", "(", "attribute", ".", "getProperties", "(", ")", ".", "getEnumLabels", "(", ")", ",", "props", ".", "getEnumLabels", "(", ")", ")", ")", "{", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "ExceptionMessages", ".", "NOT_SUPPORTED_FEATURE", ",", "\"It's not supported to change enumeration labels number from outside the Tango device class code\"", ")", ";", "}", "attribute", ".", "setProperties", "(", "props", ")", ";", "}", "xlogger", ".", "exit", "(", ")", ";", "}" ]
Set some attribute configs. IDL5 version @param newConf the new configurations @param clIdent client id @throws DevFailed
[ "Set", "some", "attribute", "configs", ".", "IDL5", "version" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L1991-L2027
140,269
tango-controls/JTango
server/src/main/java/org/tango/server/servant/DeviceImpl.java
DeviceImpl.set_attribute_config_4
@Override public void set_attribute_config_4(final AttributeConfig_3[] newConf, final ClntIdent clIdent) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); checkInitialization(); clientIdentity.set(clIdent); if (!name.equalsIgnoreCase(getAdminDeviceName())) { clientLocking.checkClientLocking(clIdent); } deviceMonitoring.startRequest("set_attribute_config_4", clIdent); set_attribute_config_3(newConf); xlogger.exit(); }
java
@Override public void set_attribute_config_4(final AttributeConfig_3[] newConf, final ClntIdent clIdent) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); checkInitialization(); clientIdentity.set(clIdent); if (!name.equalsIgnoreCase(getAdminDeviceName())) { clientLocking.checkClientLocking(clIdent); } deviceMonitoring.startRequest("set_attribute_config_4", clIdent); set_attribute_config_3(newConf); xlogger.exit(); }
[ "@", "Override", "public", "void", "set_attribute_config_4", "(", "final", "AttributeConfig_3", "[", "]", "newConf", ",", "final", "ClntIdent", "clIdent", ")", "throws", "DevFailed", "{", "MDC", ".", "setContextMap", "(", "contextMap", ")", ";", "xlogger", ".", "entry", "(", ")", ";", "checkInitialization", "(", ")", ";", "clientIdentity", ".", "set", "(", "clIdent", ")", ";", "if", "(", "!", "name", ".", "equalsIgnoreCase", "(", "getAdminDeviceName", "(", ")", ")", ")", "{", "clientLocking", ".", "checkClientLocking", "(", "clIdent", ")", ";", "}", "deviceMonitoring", ".", "startRequest", "(", "\"set_attribute_config_4\"", ",", "clIdent", ")", ";", "set_attribute_config_3", "(", "newConf", ")", ";", "xlogger", ".", "exit", "(", ")", ";", "}" ]
Set some attribute configs. IDL4 version @param newConf the new configurations @param clIdent client id @throws DevFailed
[ "Set", "some", "attribute", "configs", ".", "IDL4", "version" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L2036-L2049
140,270
tango-controls/JTango
server/src/main/java/org/tango/server/servant/DeviceImpl.java
DeviceImpl.set_attribute_config_3
@Override public void set_attribute_config_3(final AttributeConfig_3[] newConf) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); checkInitialization(); deviceMonitoring.startRequest("set_attribute_config_3"); for (final AttributeConfig_3 attributeConfig : newConf) { final String attributeName = attributeConfig.name; final AttributeImpl attribute = AttributeGetterSetter.getAttribute(attributeName, attributeList); if (attribute.getName().equals(STATE_NAME) || attribute.getName().equals(STATUS_NAME)) { throw DevFailedUtils.newDevFailed("set attribute is not possible for " + attribute.getName()); } if (!attribute.getFormat().equals(attributeConfig.data_format) || !attribute.getWritable().equals(attributeConfig.writable) || !attribute.getDispLevel().equals(attributeConfig.level) || attribute.getTangoType() != attributeConfig.data_type) { throw DevFailedUtils.newDevFailed(ExceptionMessages.ATTR_NOT_ALLOWED, "not a good config"); } final AttributePropertiesImpl props = TangoIDLAttributeUtil.toAttributeProperties(attributeConfig); logger.debug("set_attribute_config_3: {}", props); attribute.setProperties(props); } xlogger.exit(); }
java
@Override public void set_attribute_config_3(final AttributeConfig_3[] newConf) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); checkInitialization(); deviceMonitoring.startRequest("set_attribute_config_3"); for (final AttributeConfig_3 attributeConfig : newConf) { final String attributeName = attributeConfig.name; final AttributeImpl attribute = AttributeGetterSetter.getAttribute(attributeName, attributeList); if (attribute.getName().equals(STATE_NAME) || attribute.getName().equals(STATUS_NAME)) { throw DevFailedUtils.newDevFailed("set attribute is not possible for " + attribute.getName()); } if (!attribute.getFormat().equals(attributeConfig.data_format) || !attribute.getWritable().equals(attributeConfig.writable) || !attribute.getDispLevel().equals(attributeConfig.level) || attribute.getTangoType() != attributeConfig.data_type) { throw DevFailedUtils.newDevFailed(ExceptionMessages.ATTR_NOT_ALLOWED, "not a good config"); } final AttributePropertiesImpl props = TangoIDLAttributeUtil.toAttributeProperties(attributeConfig); logger.debug("set_attribute_config_3: {}", props); attribute.setProperties(props); } xlogger.exit(); }
[ "@", "Override", "public", "void", "set_attribute_config_3", "(", "final", "AttributeConfig_3", "[", "]", "newConf", ")", "throws", "DevFailed", "{", "MDC", ".", "setContextMap", "(", "contextMap", ")", ";", "xlogger", ".", "entry", "(", ")", ";", "checkInitialization", "(", ")", ";", "deviceMonitoring", ".", "startRequest", "(", "\"set_attribute_config_3\"", ")", ";", "for", "(", "final", "AttributeConfig_3", "attributeConfig", ":", "newConf", ")", "{", "final", "String", "attributeName", "=", "attributeConfig", ".", "name", ";", "final", "AttributeImpl", "attribute", "=", "AttributeGetterSetter", ".", "getAttribute", "(", "attributeName", ",", "attributeList", ")", ";", "if", "(", "attribute", ".", "getName", "(", ")", ".", "equals", "(", "STATE_NAME", ")", "||", "attribute", ".", "getName", "(", ")", ".", "equals", "(", "STATUS_NAME", ")", ")", "{", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "\"set attribute is not possible for \"", "+", "attribute", ".", "getName", "(", ")", ")", ";", "}", "if", "(", "!", "attribute", ".", "getFormat", "(", ")", ".", "equals", "(", "attributeConfig", ".", "data_format", ")", "||", "!", "attribute", ".", "getWritable", "(", ")", ".", "equals", "(", "attributeConfig", ".", "writable", ")", "||", "!", "attribute", ".", "getDispLevel", "(", ")", ".", "equals", "(", "attributeConfig", ".", "level", ")", "||", "attribute", ".", "getTangoType", "(", ")", "!=", "attributeConfig", ".", "data_type", ")", "{", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "ExceptionMessages", ".", "ATTR_NOT_ALLOWED", ",", "\"not a good config\"", ")", ";", "}", "final", "AttributePropertiesImpl", "props", "=", "TangoIDLAttributeUtil", ".", "toAttributeProperties", "(", "attributeConfig", ")", ";", "logger", ".", "debug", "(", "\"set_attribute_config_3: {}\"", ",", "props", ")", ";", "attribute", ".", "setProperties", "(", "props", ")", ";", "}", "xlogger", ".", "exit", "(", ")", ";", "}" ]
Set some attribute configs. IDL3 version @param newConf the new configurations @throws DevFailed
[ "Set", "some", "attribute", "configs", ".", "IDL3", "version" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L2057-L2081
140,271
tango-controls/JTango
server/src/main/java/org/tango/server/servant/DeviceImpl.java
DeviceImpl.addCommand
public synchronized void addCommand(final CommandImpl command) throws DevFailed { CommandImpl result = null; for (final CommandImpl cmd : commandList) { if (command.getName().equalsIgnoreCase(cmd.getName())) { result = command; break; } } if (result == null) { commandList.add(command); // set default polling configuration if (cmdPollRingDepth.containsKey(command.getName().toLowerCase(Locale.ENGLISH))) { command.setPollRingDepth(cmdPollRingDepth.get(command.getName().toLowerCase(Locale.ENGLISH))); } else { command.setPollRingDepth(pollRingDepth); } } }
java
public synchronized void addCommand(final CommandImpl command) throws DevFailed { CommandImpl result = null; for (final CommandImpl cmd : commandList) { if (command.getName().equalsIgnoreCase(cmd.getName())) { result = command; break; } } if (result == null) { commandList.add(command); // set default polling configuration if (cmdPollRingDepth.containsKey(command.getName().toLowerCase(Locale.ENGLISH))) { command.setPollRingDepth(cmdPollRingDepth.get(command.getName().toLowerCase(Locale.ENGLISH))); } else { command.setPollRingDepth(pollRingDepth); } } }
[ "public", "synchronized", "void", "addCommand", "(", "final", "CommandImpl", "command", ")", "throws", "DevFailed", "{", "CommandImpl", "result", "=", "null", ";", "for", "(", "final", "CommandImpl", "cmd", ":", "commandList", ")", "{", "if", "(", "command", ".", "getName", "(", ")", ".", "equalsIgnoreCase", "(", "cmd", ".", "getName", "(", ")", ")", ")", "{", "result", "=", "command", ";", "break", ";", "}", "}", "if", "(", "result", "==", "null", ")", "{", "commandList", ".", "add", "(", "command", ")", ";", "// set default polling configuration", "if", "(", "cmdPollRingDepth", ".", "containsKey", "(", "command", ".", "getName", "(", ")", ".", "toLowerCase", "(", "Locale", ".", "ENGLISH", ")", ")", ")", "{", "command", ".", "setPollRingDepth", "(", "cmdPollRingDepth", ".", "get", "(", "command", ".", "getName", "(", ")", ".", "toLowerCase", "(", "Locale", ".", "ENGLISH", ")", ")", ")", ";", "}", "else", "{", "command", ".", "setPollRingDepth", "(", "pollRingDepth", ")", ";", "}", "}", "}" ]
add a command @param command the new command @throws DevFailed
[ "add", "a", "command" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L2128-L2145
140,272
tango-controls/JTango
server/src/main/java/org/tango/server/servant/DeviceImpl.java
DeviceImpl.read_attribute_history_5
@Override public DevAttrHistory_5 read_attribute_history_5(final String attributeName, final int maxSize) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); checkInitialization(); deviceMonitoring.startRequest("read_attribute_history_5"); DevAttrHistory_5 result = null; try { final AttributeImpl attr = AttributeGetterSetter.getAttribute(attributeName, attributeList); if (attr.getBehavior() instanceof ForwardedAttribute) { final ForwardedAttribute fwdAttr = (ForwardedAttribute) attr.getBehavior(); result = fwdAttr.getAttributeHistory(maxSize); } else { if (!attr.isPolled()) { throw DevFailedUtils.newDevFailed(ExceptionMessages.ATTR_NOT_POLLED, attr.getName() + " is not polled"); } result = attr.getHistory().getAttrHistory5(maxSize); } } catch (final Exception e) { deviceMonitoring.addError(); if (e instanceof DevFailed) { throw (DevFailed) e; } else { // with CORBA, the stack trace is not visible by the client if // not inserted in DevFailed. throw DevFailedUtils.newDevFailed(e); } } return result; }
java
@Override public DevAttrHistory_5 read_attribute_history_5(final String attributeName, final int maxSize) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); checkInitialization(); deviceMonitoring.startRequest("read_attribute_history_5"); DevAttrHistory_5 result = null; try { final AttributeImpl attr = AttributeGetterSetter.getAttribute(attributeName, attributeList); if (attr.getBehavior() instanceof ForwardedAttribute) { final ForwardedAttribute fwdAttr = (ForwardedAttribute) attr.getBehavior(); result = fwdAttr.getAttributeHistory(maxSize); } else { if (!attr.isPolled()) { throw DevFailedUtils.newDevFailed(ExceptionMessages.ATTR_NOT_POLLED, attr.getName() + " is not polled"); } result = attr.getHistory().getAttrHistory5(maxSize); } } catch (final Exception e) { deviceMonitoring.addError(); if (e instanceof DevFailed) { throw (DevFailed) e; } else { // with CORBA, the stack trace is not visible by the client if // not inserted in DevFailed. throw DevFailedUtils.newDevFailed(e); } } return result; }
[ "@", "Override", "public", "DevAttrHistory_5", "read_attribute_history_5", "(", "final", "String", "attributeName", ",", "final", "int", "maxSize", ")", "throws", "DevFailed", "{", "MDC", ".", "setContextMap", "(", "contextMap", ")", ";", "xlogger", ".", "entry", "(", ")", ";", "checkInitialization", "(", ")", ";", "deviceMonitoring", ".", "startRequest", "(", "\"read_attribute_history_5\"", ")", ";", "DevAttrHistory_5", "result", "=", "null", ";", "try", "{", "final", "AttributeImpl", "attr", "=", "AttributeGetterSetter", ".", "getAttribute", "(", "attributeName", ",", "attributeList", ")", ";", "if", "(", "attr", ".", "getBehavior", "(", ")", "instanceof", "ForwardedAttribute", ")", "{", "final", "ForwardedAttribute", "fwdAttr", "=", "(", "ForwardedAttribute", ")", "attr", ".", "getBehavior", "(", ")", ";", "result", "=", "fwdAttr", ".", "getAttributeHistory", "(", "maxSize", ")", ";", "}", "else", "{", "if", "(", "!", "attr", ".", "isPolled", "(", ")", ")", "{", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "ExceptionMessages", ".", "ATTR_NOT_POLLED", ",", "attr", ".", "getName", "(", ")", "+", "\" is not polled\"", ")", ";", "}", "result", "=", "attr", ".", "getHistory", "(", ")", ".", "getAttrHistory5", "(", "maxSize", ")", ";", "}", "}", "catch", "(", "final", "Exception", "e", ")", "{", "deviceMonitoring", ".", "addError", "(", ")", ";", "if", "(", "e", "instanceof", "DevFailed", ")", "{", "throw", "(", "DevFailed", ")", "e", ";", "}", "else", "{", "// with CORBA, the stack trace is not visible by the client if", "// not inserted in DevFailed.", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "e", ")", ";", "}", "}", "return", "result", ";", "}" ]
read an attribute history. IDL 5 version. The history is filled only be attribute polling @param attributeName The attribute to retrieve @param maxSize The history maximum size returned @throws DevFailed
[ "read", "an", "attribute", "history", ".", "IDL", "5", "version", ".", "The", "history", "is", "filled", "only", "be", "attribute", "polling" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L2540-L2571
140,273
tango-controls/JTango
server/src/main/java/org/tango/server/events/EventManager.java
EventManager.checkEventCriteria
public static void checkEventCriteria(final AttributeImpl attribute, final EventType eventType) throws DevFailed { switch (eventType) { case CHANGE_EVENT: ChangeEventTrigger.checkEventCriteria(attribute); break; case ARCHIVE_EVENT: ArchiveEventTrigger.checkEventCriteria(attribute); break; default: break; } }
java
public static void checkEventCriteria(final AttributeImpl attribute, final EventType eventType) throws DevFailed { switch (eventType) { case CHANGE_EVENT: ChangeEventTrigger.checkEventCriteria(attribute); break; case ARCHIVE_EVENT: ArchiveEventTrigger.checkEventCriteria(attribute); break; default: break; } }
[ "public", "static", "void", "checkEventCriteria", "(", "final", "AttributeImpl", "attribute", ",", "final", "EventType", "eventType", ")", "throws", "DevFailed", "{", "switch", "(", "eventType", ")", "{", "case", "CHANGE_EVENT", ":", "ChangeEventTrigger", ".", "checkEventCriteria", "(", "attribute", ")", ";", "break", ";", "case", "ARCHIVE_EVENT", ":", "ArchiveEventTrigger", ".", "checkEventCriteria", "(", "attribute", ")", ";", "break", ";", "default", ":", "break", ";", "}", "}" ]
Check if event criteria are set for change and archive events @param attribute the specified attribute @param eventType the specified event type @throws DevFailed if event type is change or archive and no event criteria is set.
[ "Check", "if", "event", "criteria", "are", "set", "for", "change", "and", "archive", "events" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/events/EventManager.java#L137-L148
140,274
tango-controls/JTango
server/src/main/java/org/tango/server/events/EventManager.java
EventManager.bindEndpoints
private void bindEndpoints(ZMQ.Socket socket, Iterable<String> ipAddresses, Map<String, ZMQ.Socket> endpoints, SocketType socketType) { xlogger.entry(ipAddresses, endpoints, socketType); for (String ipAddress : ipAddresses) { final StringBuilder endpoint = new StringBuilder("tcp://").append(ipAddress).append(":*"); int port = socket.bind(endpoint.toString()); //replace * with actual port endpoint.deleteCharAt(endpoint.length() - 1).append(port); endpoints.put(endpoint.toString(), socket); logger.debug("bind ZMQ socket {} for {}", endpoint.toString(), socketType); } xlogger.exit(); }
java
private void bindEndpoints(ZMQ.Socket socket, Iterable<String> ipAddresses, Map<String, ZMQ.Socket> endpoints, SocketType socketType) { xlogger.entry(ipAddresses, endpoints, socketType); for (String ipAddress : ipAddresses) { final StringBuilder endpoint = new StringBuilder("tcp://").append(ipAddress).append(":*"); int port = socket.bind(endpoint.toString()); //replace * with actual port endpoint.deleteCharAt(endpoint.length() - 1).append(port); endpoints.put(endpoint.toString(), socket); logger.debug("bind ZMQ socket {} for {}", endpoint.toString(), socketType); } xlogger.exit(); }
[ "private", "void", "bindEndpoints", "(", "ZMQ", ".", "Socket", "socket", ",", "Iterable", "<", "String", ">", "ipAddresses", ",", "Map", "<", "String", ",", "ZMQ", ".", "Socket", ">", "endpoints", ",", "SocketType", "socketType", ")", "{", "xlogger", ".", "entry", "(", "ipAddresses", ",", "endpoints", ",", "socketType", ")", ";", "for", "(", "String", "ipAddress", ":", "ipAddresses", ")", "{", "final", "StringBuilder", "endpoint", "=", "new", "StringBuilder", "(", "\"tcp://\"", ")", ".", "append", "(", "ipAddress", ")", ".", "append", "(", "\":*\"", ")", ";", "int", "port", "=", "socket", ".", "bind", "(", "endpoint", ".", "toString", "(", ")", ")", ";", "//replace * with actual port", "endpoint", ".", "deleteCharAt", "(", "endpoint", ".", "length", "(", ")", "-", "1", ")", ".", "append", "(", "port", ")", ";", "endpoints", ".", "put", "(", "endpoint", ".", "toString", "(", ")", ",", "socket", ")", ";", "logger", ".", "debug", "(", "\"bind ZMQ socket {} for {}\"", ",", "endpoint", ".", "toString", "(", ")", ",", "socketType", ")", ";", "}", "xlogger", ".", "exit", "(", ")", ";", "}" ]
Binds given socket types to the list of addresses @param socket @param ipAddresses @param endpoints @param socketType
[ "Binds", "given", "socket", "types", "to", "the", "list", "of", "addresses" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/events/EventManager.java#L229-L246
140,275
tango-controls/JTango
server/src/main/java/org/tango/server/events/EventManager.java
EventManager.getEventImpl
private EventImpl getEventImpl(final String fullName) { if (!isInitialized) { return null; } // Check if subscribed EventImpl eventImpl = eventImplMap.get(fullName); // Check if subscription is out of time if (eventImpl != null && !eventImpl.isStillSubscribed()) { logger.debug("{} not subscribed any more", fullName); // System.out.println(fullName + "Not Subscribed any more"); eventImplMap.remove(fullName); // if no subscribers, close sockets if (eventImplMap.isEmpty()) { logger.debug("no subscribers on server, closing resources"); close(); } eventImpl = null; } return eventImpl; }
java
private EventImpl getEventImpl(final String fullName) { if (!isInitialized) { return null; } // Check if subscribed EventImpl eventImpl = eventImplMap.get(fullName); // Check if subscription is out of time if (eventImpl != null && !eventImpl.isStillSubscribed()) { logger.debug("{} not subscribed any more", fullName); // System.out.println(fullName + "Not Subscribed any more"); eventImplMap.remove(fullName); // if no subscribers, close sockets if (eventImplMap.isEmpty()) { logger.debug("no subscribers on server, closing resources"); close(); } eventImpl = null; } return eventImpl; }
[ "private", "EventImpl", "getEventImpl", "(", "final", "String", "fullName", ")", "{", "if", "(", "!", "isInitialized", ")", "{", "return", "null", ";", "}", "// Check if subscribed", "EventImpl", "eventImpl", "=", "eventImplMap", ".", "get", "(", "fullName", ")", ";", "// Check if subscription is out of time", "if", "(", "eventImpl", "!=", "null", "&&", "!", "eventImpl", ".", "isStillSubscribed", "(", ")", ")", "{", "logger", ".", "debug", "(", "\"{} not subscribed any more\"", ",", "fullName", ")", ";", "// System.out.println(fullName + \"Not Subscribed any more\");", "eventImplMap", ".", "remove", "(", "fullName", ")", ";", "// if no subscribers, close sockets", "if", "(", "eventImplMap", ".", "isEmpty", "(", ")", ")", "{", "logger", ".", "debug", "(", "\"no subscribers on server, closing resources\"", ")", ";", "close", "(", ")", ";", "}", "eventImpl", "=", "null", ";", "}", "return", "eventImpl", ";", "}" ]
Search the specified EventImpl object @param fullName specified EventImpl name. @return the specified EventImpl object if found, otherwise returns null.
[ "Search", "the", "specified", "EventImpl", "object" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/events/EventManager.java#L271-L294
140,276
tango-controls/JTango
server/src/main/java/org/tango/server/events/EventManager.java
EventManager.close
public void close() { xlogger.entry(); logger.debug("closing all event resources"); if (heartBeatExecutor != null) { heartBeatExecutor.shutdown(); try { heartBeatExecutor.awaitTermination(1, TimeUnit.SECONDS); } catch (final InterruptedException e) { logger.error("could not stop event hearbeat"); Thread.currentThread().interrupt(); } } if (context != null) { // close all open sockets context.destroy(); } eventImplMap.clear(); isInitialized = false; logger.debug("all event resources closed"); xlogger.exit(); }
java
public void close() { xlogger.entry(); logger.debug("closing all event resources"); if (heartBeatExecutor != null) { heartBeatExecutor.shutdown(); try { heartBeatExecutor.awaitTermination(1, TimeUnit.SECONDS); } catch (final InterruptedException e) { logger.error("could not stop event hearbeat"); Thread.currentThread().interrupt(); } } if (context != null) { // close all open sockets context.destroy(); } eventImplMap.clear(); isInitialized = false; logger.debug("all event resources closed"); xlogger.exit(); }
[ "public", "void", "close", "(", ")", "{", "xlogger", ".", "entry", "(", ")", ";", "logger", ".", "debug", "(", "\"closing all event resources\"", ")", ";", "if", "(", "heartBeatExecutor", "!=", "null", ")", "{", "heartBeatExecutor", ".", "shutdown", "(", ")", ";", "try", "{", "heartBeatExecutor", ".", "awaitTermination", "(", "1", ",", "TimeUnit", ".", "SECONDS", ")", ";", "}", "catch", "(", "final", "InterruptedException", "e", ")", "{", "logger", ".", "error", "(", "\"could not stop event hearbeat\"", ")", ";", "Thread", ".", "currentThread", "(", ")", ".", "interrupt", "(", ")", ";", "}", "}", "if", "(", "context", "!=", "null", ")", "{", "// close all open sockets", "context", ".", "destroy", "(", ")", ";", "}", "eventImplMap", ".", "clear", "(", ")", ";", "isInitialized", "=", "false", ";", "logger", ".", "debug", "(", "\"all event resources closed\"", ")", ";", "xlogger", ".", "exit", "(", ")", ";", "}" ]
Close all zmq resources
[ "Close", "all", "zmq", "resources" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/events/EventManager.java#L310-L333
140,277
tango-controls/JTango
server/src/main/java/org/tango/server/events/EventManager.java
EventManager.getInfo
public DevVarLongStringArray getInfo() { // Build the connection parameters object final DevVarLongStringArray longStringArray = new DevVarLongStringArray(); // longStringArray.lvalue = new int[0]; longStringArray.lvalue = new int[]{EventConstants.TANGO_RELEASE, DeviceImpl.SERVER_VERSION, clientHWN, 0, 0, EventConstants.ZMQ_RELEASE}; if (heartbeatEndpoints.isEmpty() || eventEndpoints.isEmpty()) { longStringArray.svalue = new String[]{"No ZMQ event yet !"}; } else { longStringArray.svalue = endpointsAsStringArray(); } return longStringArray; }
java
public DevVarLongStringArray getInfo() { // Build the connection parameters object final DevVarLongStringArray longStringArray = new DevVarLongStringArray(); // longStringArray.lvalue = new int[0]; longStringArray.lvalue = new int[]{EventConstants.TANGO_RELEASE, DeviceImpl.SERVER_VERSION, clientHWN, 0, 0, EventConstants.ZMQ_RELEASE}; if (heartbeatEndpoints.isEmpty() || eventEndpoints.isEmpty()) { longStringArray.svalue = new String[]{"No ZMQ event yet !"}; } else { longStringArray.svalue = endpointsAsStringArray(); } return longStringArray; }
[ "public", "DevVarLongStringArray", "getInfo", "(", ")", "{", "// Build the connection parameters object", "final", "DevVarLongStringArray", "longStringArray", "=", "new", "DevVarLongStringArray", "(", ")", ";", "// longStringArray.lvalue = new int[0];", "longStringArray", ".", "lvalue", "=", "new", "int", "[", "]", "{", "EventConstants", ".", "TANGO_RELEASE", ",", "DeviceImpl", ".", "SERVER_VERSION", ",", "clientHWN", ",", "0", ",", "0", ",", "EventConstants", ".", "ZMQ_RELEASE", "}", ";", "if", "(", "heartbeatEndpoints", ".", "isEmpty", "(", ")", "||", "eventEndpoints", ".", "isEmpty", "(", ")", ")", "{", "longStringArray", ".", "svalue", "=", "new", "String", "[", "]", "{", "\"No ZMQ event yet !\"", "}", ";", "}", "else", "{", "longStringArray", ".", "svalue", "=", "endpointsAsStringArray", "(", ")", ";", "}", "return", "longStringArray", ";", "}" ]
returns the connection parameters for specified event.
[ "returns", "the", "connection", "parameters", "for", "specified", "event", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/events/EventManager.java#L338-L351
140,278
tango-controls/JTango
server/src/main/java/org/tango/server/events/EventManager.java
EventManager.subscribe
public DevVarLongStringArray subscribe(final String deviceName) throws DevFailed { xlogger.entry(); // If first time start the ZMQ management if (!isInitialized) { initialize(); } // check if event is already subscribed final String fullName = EventUtilities.buildDeviceEventName(deviceName, EventType.INTERFACE_CHANGE_EVENT); EventImpl eventImpl = eventImplMap.get(fullName); if (eventImpl == null) { // If not already manage, create EventImpl object and add it to the map eventImpl = new EventImpl(DeviceImpl.SERVER_VERSION, fullName); eventImplMap.put(fullName, eventImpl); } else { eventImpl.updateSubscribeTime(); } return buildConnectionParameters(fullName); }
java
public DevVarLongStringArray subscribe(final String deviceName) throws DevFailed { xlogger.entry(); // If first time start the ZMQ management if (!isInitialized) { initialize(); } // check if event is already subscribed final String fullName = EventUtilities.buildDeviceEventName(deviceName, EventType.INTERFACE_CHANGE_EVENT); EventImpl eventImpl = eventImplMap.get(fullName); if (eventImpl == null) { // If not already manage, create EventImpl object and add it to the map eventImpl = new EventImpl(DeviceImpl.SERVER_VERSION, fullName); eventImplMap.put(fullName, eventImpl); } else { eventImpl.updateSubscribeTime(); } return buildConnectionParameters(fullName); }
[ "public", "DevVarLongStringArray", "subscribe", "(", "final", "String", "deviceName", ")", "throws", "DevFailed", "{", "xlogger", ".", "entry", "(", ")", ";", "// If first time start the ZMQ management", "if", "(", "!", "isInitialized", ")", "{", "initialize", "(", ")", ";", "}", "// check if event is already subscribed", "final", "String", "fullName", "=", "EventUtilities", ".", "buildDeviceEventName", "(", "deviceName", ",", "EventType", ".", "INTERFACE_CHANGE_EVENT", ")", ";", "EventImpl", "eventImpl", "=", "eventImplMap", ".", "get", "(", "fullName", ")", ";", "if", "(", "eventImpl", "==", "null", ")", "{", "// If not already manage, create EventImpl object and add it to the map", "eventImpl", "=", "new", "EventImpl", "(", "DeviceImpl", ".", "SERVER_VERSION", ",", "fullName", ")", ";", "eventImplMap", ".", "put", "(", "fullName", ",", "eventImpl", ")", ";", "}", "else", "{", "eventImpl", ".", "updateSubscribeTime", "(", ")", ";", "}", "return", "buildConnectionParameters", "(", "fullName", ")", ";", "}" ]
Initialize ZMQ event system if not already done, subscribe to the interface change event end returns the connection parameters. @param deviceName The specified event device name @return the connection parameters.
[ "Initialize", "ZMQ", "event", "system", "if", "not", "already", "done", "subscribe", "to", "the", "interface", "change", "event", "end", "returns", "the", "connection", "parameters", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/events/EventManager.java#L439-L458
140,279
tango-controls/JTango
server/src/main/java/org/tango/server/events/EventManager.java
EventManager.pushAttributeDataReadyEvent
public void pushAttributeDataReadyEvent(final String deviceName, final String attributeName, final int counter) throws DevFailed { xlogger.entry(); final String fullName = EventUtilities.buildEventName(deviceName, attributeName, EventType.DATA_READY_EVENT); final EventImpl eventImpl = getEventImpl(fullName); if (eventImpl != null) { for (ZMQ.Socket eventSocket : eventEndpoints.values()) { eventImpl.pushAttributeDataReadyEvent(counter, eventSocket); } } xlogger.exit(); }
java
public void pushAttributeDataReadyEvent(final String deviceName, final String attributeName, final int counter) throws DevFailed { xlogger.entry(); final String fullName = EventUtilities.buildEventName(deviceName, attributeName, EventType.DATA_READY_EVENT); final EventImpl eventImpl = getEventImpl(fullName); if (eventImpl != null) { for (ZMQ.Socket eventSocket : eventEndpoints.values()) { eventImpl.pushAttributeDataReadyEvent(counter, eventSocket); } } xlogger.exit(); }
[ "public", "void", "pushAttributeDataReadyEvent", "(", "final", "String", "deviceName", ",", "final", "String", "attributeName", ",", "final", "int", "counter", ")", "throws", "DevFailed", "{", "xlogger", ".", "entry", "(", ")", ";", "final", "String", "fullName", "=", "EventUtilities", ".", "buildEventName", "(", "deviceName", ",", "attributeName", ",", "EventType", ".", "DATA_READY_EVENT", ")", ";", "final", "EventImpl", "eventImpl", "=", "getEventImpl", "(", "fullName", ")", ";", "if", "(", "eventImpl", "!=", "null", ")", "{", "for", "(", "ZMQ", ".", "Socket", "eventSocket", ":", "eventEndpoints", ".", "values", "(", ")", ")", "{", "eventImpl", ".", "pushAttributeDataReadyEvent", "(", "counter", ",", "eventSocket", ")", ";", "}", "}", "xlogger", ".", "exit", "(", ")", ";", "}" ]
fire event with AttDataReady @param deviceName Specified event device @param attributeName specified event attribute name @param counter a counter value @throws DevFailed
[ "fire", "event", "with", "AttDataReady" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/events/EventManager.java#L543-L554
140,280
tango-controls/JTango
client/src/main/java/fr/soleil/tango/statecomposer/StateResolver.java
StateResolver.configurePriorities
public void configurePriorities(final String[] priorities) { // Set the non defined state in the property at 0 priority // Enumeration of existing state int priority; // Get the custom priority for (final String state : priorities) { // count the token separated by "," final StringTokenizer tmpPriorityTokens = new StringTokenizer(state.trim(), ","); if (tmpPriorityTokens.countTokens() == 2) { // To avoid the the pb of case final String tmpState = tmpPriorityTokens.nextToken().trim().toUpperCase(); // If the custom state exist if (StateUtilities.isStateExist(tmpState)) { try { priority = Integer.valueOf(tmpPriorityTokens.nextToken().trim()); } catch (final NumberFormatException e) { priority = 0; } putStatePriority(StateUtilities.getStateForName(tmpState), priority); } } } }
java
public void configurePriorities(final String[] priorities) { // Set the non defined state in the property at 0 priority // Enumeration of existing state int priority; // Get the custom priority for (final String state : priorities) { // count the token separated by "," final StringTokenizer tmpPriorityTokens = new StringTokenizer(state.trim(), ","); if (tmpPriorityTokens.countTokens() == 2) { // To avoid the the pb of case final String tmpState = tmpPriorityTokens.nextToken().trim().toUpperCase(); // If the custom state exist if (StateUtilities.isStateExist(tmpState)) { try { priority = Integer.valueOf(tmpPriorityTokens.nextToken().trim()); } catch (final NumberFormatException e) { priority = 0; } putStatePriority(StateUtilities.getStateForName(tmpState), priority); } } } }
[ "public", "void", "configurePriorities", "(", "final", "String", "[", "]", "priorities", ")", "{", "// Set the non defined state in the property at 0 priority", "// Enumeration of existing state", "int", "priority", ";", "// Get the custom priority", "for", "(", "final", "String", "state", ":", "priorities", ")", "{", "// count the token separated by \",\"", "final", "StringTokenizer", "tmpPriorityTokens", "=", "new", "StringTokenizer", "(", "state", ".", "trim", "(", ")", ",", "\",\"", ")", ";", "if", "(", "tmpPriorityTokens", ".", "countTokens", "(", ")", "==", "2", ")", "{", "// To avoid the the pb of case", "final", "String", "tmpState", "=", "tmpPriorityTokens", ".", "nextToken", "(", ")", ".", "trim", "(", ")", ".", "toUpperCase", "(", ")", ";", "// If the custom state exist", "if", "(", "StateUtilities", ".", "isStateExist", "(", "tmpState", ")", ")", "{", "try", "{", "priority", "=", "Integer", ".", "valueOf", "(", "tmpPriorityTokens", ".", "nextToken", "(", ")", ".", "trim", "(", ")", ")", ";", "}", "catch", "(", "final", "NumberFormatException", "e", ")", "{", "priority", "=", "0", ";", "}", "putStatePriority", "(", "StateUtilities", ".", "getStateForName", "(", "tmpState", ")", ",", "priority", ")", ";", "}", "}", "}", "}" ]
Configure the state priorities @param priorities array of String. eg, STATE,priorityValue
[ "Configure", "the", "state", "priorities" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/client/src/main/java/fr/soleil/tango/statecomposer/StateResolver.java#L82-L104
140,281
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/DeviceImpl.java
DeviceImpl.command_inout
public Any command_inout(final String in_cmd, final Any in_any) throws DevFailed { Util.out4.println("DeviceImpl.command_inout(): command received : " + in_cmd); // // Record operation request in black box // blackbox.insert_cmd(in_cmd, 1); // // Execute command // Any out_any = null; try { // If nb connection is closed to the maximum value, // throw an exception to do not block devices. Util.increaseAccessConter(); if (Util.getAccessConter() > Util.getPoaThreadPoolMax() - 2) { Util.decreaseAccessConter(); Except.throw_exception("API_MemoryAllocation", Util.instance().get_ds_real_name() + ": No thread available to connect device", "DeviceImpl.write_attributes()"); } switch (Util.get_serial_model()) { case BY_CLASS: synchronized (device_class) { out_any = device_class.command_handler(this, in_cmd, in_any); } break; case BY_DEVICE: synchronized (this) { out_any = device_class.command_handler(this, in_cmd, in_any); } break; default: // NO_SYNC out_any = device_class.command_handler(this, in_cmd, in_any); } } catch (final DevFailed exc) { Util.decreaseAccessConter(); throw exc; } catch (final Exception exc) { Util.decreaseAccessConter(); Except.throw_exception("API_ExceptionCatched", exc.toString(), "DeviceImpl.command_inout"); } Util.decreaseAccessConter(); // // Return value to the caller // Util.out4.println("DeviceImpl.command_inout(): leaving method for command " + in_cmd); return out_any; }
java
public Any command_inout(final String in_cmd, final Any in_any) throws DevFailed { Util.out4.println("DeviceImpl.command_inout(): command received : " + in_cmd); // // Record operation request in black box // blackbox.insert_cmd(in_cmd, 1); // // Execute command // Any out_any = null; try { // If nb connection is closed to the maximum value, // throw an exception to do not block devices. Util.increaseAccessConter(); if (Util.getAccessConter() > Util.getPoaThreadPoolMax() - 2) { Util.decreaseAccessConter(); Except.throw_exception("API_MemoryAllocation", Util.instance().get_ds_real_name() + ": No thread available to connect device", "DeviceImpl.write_attributes()"); } switch (Util.get_serial_model()) { case BY_CLASS: synchronized (device_class) { out_any = device_class.command_handler(this, in_cmd, in_any); } break; case BY_DEVICE: synchronized (this) { out_any = device_class.command_handler(this, in_cmd, in_any); } break; default: // NO_SYNC out_any = device_class.command_handler(this, in_cmd, in_any); } } catch (final DevFailed exc) { Util.decreaseAccessConter(); throw exc; } catch (final Exception exc) { Util.decreaseAccessConter(); Except.throw_exception("API_ExceptionCatched", exc.toString(), "DeviceImpl.command_inout"); } Util.decreaseAccessConter(); // // Return value to the caller // Util.out4.println("DeviceImpl.command_inout(): leaving method for command " + in_cmd); return out_any; }
[ "public", "Any", "command_inout", "(", "final", "String", "in_cmd", ",", "final", "Any", "in_any", ")", "throws", "DevFailed", "{", "Util", ".", "out4", ".", "println", "(", "\"DeviceImpl.command_inout(): command received : \"", "+", "in_cmd", ")", ";", "//", "// Record operation request in black box", "//", "blackbox", ".", "insert_cmd", "(", "in_cmd", ",", "1", ")", ";", "//\t", "// Execute command", "//", "Any", "out_any", "=", "null", ";", "try", "{", "// If nb connection is closed to the maximum value,", "// throw an exception to do not block devices.", "Util", ".", "increaseAccessConter", "(", ")", ";", "if", "(", "Util", ".", "getAccessConter", "(", ")", ">", "Util", ".", "getPoaThreadPoolMax", "(", ")", "-", "2", ")", "{", "Util", ".", "decreaseAccessConter", "(", ")", ";", "Except", ".", "throw_exception", "(", "\"API_MemoryAllocation\"", ",", "Util", ".", "instance", "(", ")", ".", "get_ds_real_name", "(", ")", "+", "\": No thread available to connect device\"", ",", "\"DeviceImpl.write_attributes()\"", ")", ";", "}", "switch", "(", "Util", ".", "get_serial_model", "(", ")", ")", "{", "case", "BY_CLASS", ":", "synchronized", "(", "device_class", ")", "{", "out_any", "=", "device_class", ".", "command_handler", "(", "this", ",", "in_cmd", ",", "in_any", ")", ";", "}", "break", ";", "case", "BY_DEVICE", ":", "synchronized", "(", "this", ")", "{", "out_any", "=", "device_class", ".", "command_handler", "(", "this", ",", "in_cmd", ",", "in_any", ")", ";", "}", "break", ";", "default", ":", "// NO_SYNC", "out_any", "=", "device_class", ".", "command_handler", "(", "this", ",", "in_cmd", ",", "in_any", ")", ";", "}", "}", "catch", "(", "final", "DevFailed", "exc", ")", "{", "Util", ".", "decreaseAccessConter", "(", ")", ";", "throw", "exc", ";", "}", "catch", "(", "final", "Exception", "exc", ")", "{", "Util", ".", "decreaseAccessConter", "(", ")", ";", "Except", ".", "throw_exception", "(", "\"API_ExceptionCatched\"", ",", "exc", ".", "toString", "(", ")", ",", "\"DeviceImpl.command_inout\"", ")", ";", "}", "Util", ".", "decreaseAccessConter", "(", ")", ";", "//", "// Return value to the caller", "//", "Util", ".", "out4", ".", "println", "(", "\"DeviceImpl.command_inout(): leaving method for command \"", "+", "in_cmd", ")", ";", "return", "out_any", ";", "}" ]
Execute a command. It's the master method executed when a "command_inout" CORBA operation is requested by a client. It updates the device black-box, call the TANGO command handler and returned the output Any @param in_cmd The command name @param in_any The command input data packed in a CORBA Any @return The command output data packed in a CORBA Any object @exception DevFailed Re-throw of the exception thrown by the command_handler method. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed" >here</a> to read <b>DevFailed</b> exception specification
[ "Execute", "a", "command", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/DeviceImpl.java#L428-L484
140,282
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/DeviceImpl.java
DeviceImpl.name
public String name() { Util.out4.println("DeviceImpl.name() arrived"); // // Record attribute request in black box // blackbox.insert_attr(Attr_Name); // // Return data to caller // Util.out4.println("Leaving DeviceImpl.name()"); return device_name; }
java
public String name() { Util.out4.println("DeviceImpl.name() arrived"); // // Record attribute request in black box // blackbox.insert_attr(Attr_Name); // // Return data to caller // Util.out4.println("Leaving DeviceImpl.name()"); return device_name; }
[ "public", "String", "name", "(", ")", "{", "Util", ".", "out4", ".", "println", "(", "\"DeviceImpl.name() arrived\"", ")", ";", "//", "// Record attribute request in black box", "//", "blackbox", ".", "insert_attr", "(", "Attr_Name", ")", ";", "//", "// Return data to caller", "//", "Util", ".", "out4", ".", "println", "(", "\"Leaving DeviceImpl.name()\"", ")", ";", "return", "device_name", ";", "}" ]
Get device name. It's the master method executed when the device name is requested via a CORBA attribute. It updates the device black-box and return the device name @return The device name
[ "Get", "device", "name", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/DeviceImpl.java#L708-L723
140,283
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/DeviceImpl.java
DeviceImpl.adm_name
public String adm_name() { Util.out4.println("DeviceImpl.adm_name() arrived"); // // Record attribute request in black box // blackbox.insert_attr(Attr_AdmName); // // Return data to caller // Util.out4.println("Leaving DeviceImpl.adm_name()"); return adm_device_name; }
java
public String adm_name() { Util.out4.println("DeviceImpl.adm_name() arrived"); // // Record attribute request in black box // blackbox.insert_attr(Attr_AdmName); // // Return data to caller // Util.out4.println("Leaving DeviceImpl.adm_name()"); return adm_device_name; }
[ "public", "String", "adm_name", "(", ")", "{", "Util", ".", "out4", ".", "println", "(", "\"DeviceImpl.adm_name() arrived\"", ")", ";", "//", "// Record attribute request in black box", "//", "blackbox", ".", "insert_attr", "(", "Attr_AdmName", ")", ";", "//", "// Return data to caller", "//", "Util", ".", "out4", ".", "println", "(", "\"Leaving DeviceImpl.adm_name()\"", ")", ";", "return", "adm_device_name", ";", "}" ]
Get administration device name. It's the master method executed when the administration device name is requested via a CORBA attribute. It updates the device black-box and return the administration device name @return The administration device name
[ "Get", "administration", "device", "name", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/DeviceImpl.java#L745-L760
140,284
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/DeviceImpl.java
DeviceImpl.description
public String description() { Util.out4.println("DeviceImpl.description() arrived"); // // Record attribute request in black box // blackbox.insert_attr(Attr_Description); // // Return data to caller // Util.out4.println("Leaving DeviceImpl.description()"); return desc; }
java
public String description() { Util.out4.println("DeviceImpl.description() arrived"); // // Record attribute request in black box // blackbox.insert_attr(Attr_Description); // // Return data to caller // Util.out4.println("Leaving DeviceImpl.description()"); return desc; }
[ "public", "String", "description", "(", ")", "{", "Util", ".", "out4", ".", "println", "(", "\"DeviceImpl.description() arrived\"", ")", ";", "//", "// Record attribute request in black box", "//", "blackbox", ".", "insert_attr", "(", "Attr_Description", ")", ";", "//", "// Return data to caller", "//", "Util", ".", "out4", ".", "println", "(", "\"Leaving DeviceImpl.description()\"", ")", ";", "return", "desc", ";", "}" ]
Get device description. It's the master method executed when the device description is requested via a CORBA attribute. It updates the device black-box and return the device description field @return The device description
[ "Get", "device", "description", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/DeviceImpl.java#L783-L798
140,285
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/DeviceImpl.java
DeviceImpl.black_box
public String[] black_box(final int n) throws DevFailed { Util.out4.println("DeviceImpl.black_box() arrived"); final String[] ret = blackbox.read(n); // // Record operation request in black box // blackbox.insert_op(Op_BlackBox); Util.out4.println("Leaving DeviceImpl.black_box()"); return ret; }
java
public String[] black_box(final int n) throws DevFailed { Util.out4.println("DeviceImpl.black_box() arrived"); final String[] ret = blackbox.read(n); // // Record operation request in black box // blackbox.insert_op(Op_BlackBox); Util.out4.println("Leaving DeviceImpl.black_box()"); return ret; }
[ "public", "String", "[", "]", "black_box", "(", "final", "int", "n", ")", "throws", "DevFailed", "{", "Util", ".", "out4", ".", "println", "(", "\"DeviceImpl.black_box() arrived\"", ")", ";", "final", "String", "[", "]", "ret", "=", "blackbox", ".", "read", "(", "n", ")", ";", "//", "// Record operation request in black box", "//", "blackbox", ".", "insert_op", "(", "Op_BlackBox", ")", ";", "Util", ".", "out4", ".", "println", "(", "\"Leaving DeviceImpl.black_box()\"", ")", ";", "return", "ret", ";", "}" ]
Get device black box. It's the master method executed when the device black box is requested. It reads the device black box, update it and return black-box data to the client @param n The number of actions description which must be returned to the client. The number of returned element is limited to the number of elements stored in the black-box or to the complete black-box depth if it is full. @return The device black box with one String for each action requested on the device @exception DevFailed If it is not possible to read the device black box. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed">here </a> to read <b>DevFailed</b> exception specification
[ "Get", "device", "black", "box", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/DeviceImpl.java#L926-L940
140,286
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/DeviceImpl.java
DeviceImpl.command_list_query
public DevCmdInfo[] command_list_query() { Util.out4.println("DeviceImpl.command_list_query() arrived"); // // Retrive number of command and allocate memory to send back info // final int nb_cmd = device_class.get_command_list().size(); Util.out4.println(nb_cmd + " command(s) for device"); final DevCmdInfo[] back = new DevCmdInfo[nb_cmd]; for (int loop = 0; loop < nb_cmd; loop++) { back[loop] = new DevCmdInfo(); } // // Populate the sequence // for (int i = 0; i < nb_cmd; i++) { back[i].cmd_name = ((Command) device_class.get_command_list().elementAt(i)).get_name(); back[i].cmd_tag = ((Command) device_class.get_command_list().elementAt(i)).get_tag(); back[i].in_type = ((Command) device_class.get_command_list().elementAt(i)) .get_in_type(); back[i].out_type = ((Command) device_class.get_command_list().elementAt(i)) .get_out_type(); String tmp_desc = ((Command) device_class.get_command_list().elementAt(i)) .get_in_type_desc(); if (tmp_desc == null) { back[i].in_type_desc = Tango_DescNotSet; } else { back[i].in_type_desc = tmp_desc; } tmp_desc = ((Command) device_class.get_command_list().elementAt(i)).get_out_type_desc(); if (tmp_desc == null) { back[i].out_type_desc = Tango_DescNotSet; } else { back[i].out_type_desc = tmp_desc; } } // // Record operation request in black box // blackbox.insert_op(Op_Command_list); // // Return to caller // Util.out4.println("Leaving DeviceImpl.command_list_query()"); return back; }
java
public DevCmdInfo[] command_list_query() { Util.out4.println("DeviceImpl.command_list_query() arrived"); // // Retrive number of command and allocate memory to send back info // final int nb_cmd = device_class.get_command_list().size(); Util.out4.println(nb_cmd + " command(s) for device"); final DevCmdInfo[] back = new DevCmdInfo[nb_cmd]; for (int loop = 0; loop < nb_cmd; loop++) { back[loop] = new DevCmdInfo(); } // // Populate the sequence // for (int i = 0; i < nb_cmd; i++) { back[i].cmd_name = ((Command) device_class.get_command_list().elementAt(i)).get_name(); back[i].cmd_tag = ((Command) device_class.get_command_list().elementAt(i)).get_tag(); back[i].in_type = ((Command) device_class.get_command_list().elementAt(i)) .get_in_type(); back[i].out_type = ((Command) device_class.get_command_list().elementAt(i)) .get_out_type(); String tmp_desc = ((Command) device_class.get_command_list().elementAt(i)) .get_in_type_desc(); if (tmp_desc == null) { back[i].in_type_desc = Tango_DescNotSet; } else { back[i].in_type_desc = tmp_desc; } tmp_desc = ((Command) device_class.get_command_list().elementAt(i)).get_out_type_desc(); if (tmp_desc == null) { back[i].out_type_desc = Tango_DescNotSet; } else { back[i].out_type_desc = tmp_desc; } } // // Record operation request in black box // blackbox.insert_op(Op_Command_list); // // Return to caller // Util.out4.println("Leaving DeviceImpl.command_list_query()"); return back; }
[ "public", "DevCmdInfo", "[", "]", "command_list_query", "(", ")", "{", "Util", ".", "out4", ".", "println", "(", "\"DeviceImpl.command_list_query() arrived\"", ")", ";", "//", "// Retrive number of command and allocate memory to send back info", "//", "final", "int", "nb_cmd", "=", "device_class", ".", "get_command_list", "(", ")", ".", "size", "(", ")", ";", "Util", ".", "out4", ".", "println", "(", "nb_cmd", "+", "\" command(s) for device\"", ")", ";", "final", "DevCmdInfo", "[", "]", "back", "=", "new", "DevCmdInfo", "[", "nb_cmd", "]", ";", "for", "(", "int", "loop", "=", "0", ";", "loop", "<", "nb_cmd", ";", "loop", "++", ")", "{", "back", "[", "loop", "]", "=", "new", "DevCmdInfo", "(", ")", ";", "}", "//", "// Populate the sequence", "//", "for", "(", "int", "i", "=", "0", ";", "i", "<", "nb_cmd", ";", "i", "++", ")", "{", "back", "[", "i", "]", ".", "cmd_name", "=", "(", "(", "Command", ")", "device_class", ".", "get_command_list", "(", ")", ".", "elementAt", "(", "i", ")", ")", ".", "get_name", "(", ")", ";", "back", "[", "i", "]", ".", "cmd_tag", "=", "(", "(", "Command", ")", "device_class", ".", "get_command_list", "(", ")", ".", "elementAt", "(", "i", ")", ")", ".", "get_tag", "(", ")", ";", "back", "[", "i", "]", ".", "in_type", "=", "(", "(", "Command", ")", "device_class", ".", "get_command_list", "(", ")", ".", "elementAt", "(", "i", ")", ")", ".", "get_in_type", "(", ")", ";", "back", "[", "i", "]", ".", "out_type", "=", "(", "(", "Command", ")", "device_class", ".", "get_command_list", "(", ")", ".", "elementAt", "(", "i", ")", ")", ".", "get_out_type", "(", ")", ";", "String", "tmp_desc", "=", "(", "(", "Command", ")", "device_class", ".", "get_command_list", "(", ")", ".", "elementAt", "(", "i", ")", ")", ".", "get_in_type_desc", "(", ")", ";", "if", "(", "tmp_desc", "==", "null", ")", "{", "back", "[", "i", "]", ".", "in_type_desc", "=", "Tango_DescNotSet", ";", "}", "else", "{", "back", "[", "i", "]", ".", "in_type_desc", "=", "tmp_desc", ";", "}", "tmp_desc", "=", "(", "(", "Command", ")", "device_class", ".", "get_command_list", "(", ")", ".", "elementAt", "(", "i", ")", ")", ".", "get_out_type_desc", "(", ")", ";", "if", "(", "tmp_desc", "==", "null", ")", "{", "back", "[", "i", "]", ".", "out_type_desc", "=", "Tango_DescNotSet", ";", "}", "else", "{", "back", "[", "i", "]", ".", "out_type_desc", "=", "tmp_desc", ";", "}", "}", "//", "// Record operation request in black box", "//", "blackbox", ".", "insert_op", "(", "Op_Command_list", ")", ";", "//", "// Return to caller", "//", "Util", ".", "out4", ".", "println", "(", "\"Leaving DeviceImpl.command_list_query()\"", ")", ";", "return", "back", ";", "}" ]
Get device command list. Invoked when the client request the command_list_query CORBA operation. It updates the device black box and returns an array of DevCmdInfo object with one object for each command. @return The device command list. One DevCmdInfo is initialised for each device command
[ "Get", "device", "command", "list", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/DeviceImpl.java#L964-L1017
140,287
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/DeviceImpl.java
DeviceImpl.command_query
public DevCmdInfo command_query(final String command) throws DevFailed { Util.out4.println("DeviceImpl.command_query() arrived"); final DevCmdInfo back = new DevCmdInfo(); // // Try to retrieve the command in the command list // final String cmd_name = command.toLowerCase(); int i; final int nb_cmd = device_class.get_command_list().size(); for (i = 0; i < nb_cmd; i++) { final Command cmd = (Command) device_class.get_command_list().elementAt(i); if (cmd.get_name().toLowerCase().equals(cmd_name) == true) { back.cmd_name = command; back.cmd_tag = cmd.get_tag(); back.in_type = cmd.get_in_type(); back.out_type = cmd.get_out_type(); String tmp_desc = cmd.get_in_type_desc(); if (tmp_desc == null) { back.in_type_desc = Tango_DescNotSet; } else { back.in_type_desc = tmp_desc; } tmp_desc = cmd.get_out_type_desc(); if (tmp_desc == null) { back.out_type_desc = Tango_DescNotSet; } else { back.out_type_desc = tmp_desc; } break; } } if (i == nb_cmd) { Util.out3.println("DeviceImpl.command_query(): operation " + command + " not found"); // // throw an exception to client // Except.throw_exception("API_CommandNotFound", "Command " + command + " not found", "DeviceImpl.command_query()"); } // // Record operation request in black box // blackbox.insert_op(Op_Command); // // Return to caller // Util.out4.println("Leaving DeviceImpl.command_query()"); return back; }
java
public DevCmdInfo command_query(final String command) throws DevFailed { Util.out4.println("DeviceImpl.command_query() arrived"); final DevCmdInfo back = new DevCmdInfo(); // // Try to retrieve the command in the command list // final String cmd_name = command.toLowerCase(); int i; final int nb_cmd = device_class.get_command_list().size(); for (i = 0; i < nb_cmd; i++) { final Command cmd = (Command) device_class.get_command_list().elementAt(i); if (cmd.get_name().toLowerCase().equals(cmd_name) == true) { back.cmd_name = command; back.cmd_tag = cmd.get_tag(); back.in_type = cmd.get_in_type(); back.out_type = cmd.get_out_type(); String tmp_desc = cmd.get_in_type_desc(); if (tmp_desc == null) { back.in_type_desc = Tango_DescNotSet; } else { back.in_type_desc = tmp_desc; } tmp_desc = cmd.get_out_type_desc(); if (tmp_desc == null) { back.out_type_desc = Tango_DescNotSet; } else { back.out_type_desc = tmp_desc; } break; } } if (i == nb_cmd) { Util.out3.println("DeviceImpl.command_query(): operation " + command + " not found"); // // throw an exception to client // Except.throw_exception("API_CommandNotFound", "Command " + command + " not found", "DeviceImpl.command_query()"); } // // Record operation request in black box // blackbox.insert_op(Op_Command); // // Return to caller // Util.out4.println("Leaving DeviceImpl.command_query()"); return back; }
[ "public", "DevCmdInfo", "command_query", "(", "final", "String", "command", ")", "throws", "DevFailed", "{", "Util", ".", "out4", ".", "println", "(", "\"DeviceImpl.command_query() arrived\"", ")", ";", "final", "DevCmdInfo", "back", "=", "new", "DevCmdInfo", "(", ")", ";", "//", "// Try to retrieve the command in the command list", "//", "final", "String", "cmd_name", "=", "command", ".", "toLowerCase", "(", ")", ";", "int", "i", ";", "final", "int", "nb_cmd", "=", "device_class", ".", "get_command_list", "(", ")", ".", "size", "(", ")", ";", "for", "(", "i", "=", "0", ";", "i", "<", "nb_cmd", ";", "i", "++", ")", "{", "final", "Command", "cmd", "=", "(", "Command", ")", "device_class", ".", "get_command_list", "(", ")", ".", "elementAt", "(", "i", ")", ";", "if", "(", "cmd", ".", "get_name", "(", ")", ".", "toLowerCase", "(", ")", ".", "equals", "(", "cmd_name", ")", "==", "true", ")", "{", "back", ".", "cmd_name", "=", "command", ";", "back", ".", "cmd_tag", "=", "cmd", ".", "get_tag", "(", ")", ";", "back", ".", "in_type", "=", "cmd", ".", "get_in_type", "(", ")", ";", "back", ".", "out_type", "=", "cmd", ".", "get_out_type", "(", ")", ";", "String", "tmp_desc", "=", "cmd", ".", "get_in_type_desc", "(", ")", ";", "if", "(", "tmp_desc", "==", "null", ")", "{", "back", ".", "in_type_desc", "=", "Tango_DescNotSet", ";", "}", "else", "{", "back", ".", "in_type_desc", "=", "tmp_desc", ";", "}", "tmp_desc", "=", "cmd", ".", "get_out_type_desc", "(", ")", ";", "if", "(", "tmp_desc", "==", "null", ")", "{", "back", ".", "out_type_desc", "=", "Tango_DescNotSet", ";", "}", "else", "{", "back", ".", "out_type_desc", "=", "tmp_desc", ";", "}", "break", ";", "}", "}", "if", "(", "i", "==", "nb_cmd", ")", "{", "Util", ".", "out3", ".", "println", "(", "\"DeviceImpl.command_query(): operation \"", "+", "command", "+", "\" not found\"", ")", ";", "//\t\t", "// throw an exception to client", "//", "Except", ".", "throw_exception", "(", "\"API_CommandNotFound\"", ",", "\"Command \"", "+", "command", "+", "\" not found\"", ",", "\"DeviceImpl.command_query()\"", ")", ";", "}", "//", "// Record operation request in black box", "//", "blackbox", ".", "insert_op", "(", "Op_Command", ")", ";", "//", "// Return to caller", "//", "Util", ".", "out4", ".", "println", "(", "\"Leaving DeviceImpl.command_query()\"", ")", ";", "return", "back", ";", "}" ]
Get command info. Invoked when the client request the command_query CORBA operation. It updates the device black box and returns a DevCmdInfo object for the command with name passed to the method as parameter. @param command The command name @return A DevCmdInfo initialised for the wanted command @exception DevFailed Thrown if the command does not exist. Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed" >here</a> to read <b>DevFailed</b> exception specification
[ "Get", "command", "info", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/DeviceImpl.java#L1156-L1213
140,288
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/DeviceImpl.java
DeviceImpl.info
public DevInfo info() { Util.out4.println("DeviceImpl.info() arrived"); final DevInfo back = new DevInfo(); // // Retrieve server host // final Util tg = Util.instance(); back.server_host = tg.get_host_name(); // // Fill-in remaining structure fields // back.dev_class = device_class.get_name(); back.server_id = tg.get_ds_real_name(); back.server_version = Tango_DevVersion; back.doc_url = device_class.get_doc_url(); // // Record operation request in black box // blackbox.insert_op(Op_Info); // // Return to caller // Util.out4.println("Leaving DeviceImpl.info()"); return back; }
java
public DevInfo info() { Util.out4.println("DeviceImpl.info() arrived"); final DevInfo back = new DevInfo(); // // Retrieve server host // final Util tg = Util.instance(); back.server_host = tg.get_host_name(); // // Fill-in remaining structure fields // back.dev_class = device_class.get_name(); back.server_id = tg.get_ds_real_name(); back.server_version = Tango_DevVersion; back.doc_url = device_class.get_doc_url(); // // Record operation request in black box // blackbox.insert_op(Op_Info); // // Return to caller // Util.out4.println("Leaving DeviceImpl.info()"); return back; }
[ "public", "DevInfo", "info", "(", ")", "{", "Util", ".", "out4", ".", "println", "(", "\"DeviceImpl.info() arrived\"", ")", ";", "final", "DevInfo", "back", "=", "new", "DevInfo", "(", ")", ";", "//", "// Retrieve server host", "//", "final", "Util", "tg", "=", "Util", ".", "instance", "(", ")", ";", "back", ".", "server_host", "=", "tg", ".", "get_host_name", "(", ")", ";", "//", "// Fill-in remaining structure fields", "//", "back", ".", "dev_class", "=", "device_class", ".", "get_name", "(", ")", ";", "back", ".", "server_id", "=", "tg", ".", "get_ds_real_name", "(", ")", ";", "back", ".", "server_version", "=", "Tango_DevVersion", ";", "back", ".", "doc_url", "=", "device_class", ".", "get_doc_url", "(", ")", ";", "//", "// Record operation request in black box", "//", "blackbox", ".", "insert_op", "(", "Op_Info", ")", ";", "//", "// Return to caller", "//", "Util", ".", "out4", ".", "println", "(", "\"Leaving DeviceImpl.info()\"", ")", ";", "return", "back", ";", "}" ]
Get device info. Invoked when the client request the info CORBA operation. It updates the black box and returns a DevInfo object with miscellaneous device info @return A DevInfo object
[ "Get", "device", "info", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/DeviceImpl.java#L1232-L1266
140,289
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/DeviceImpl.java
DeviceImpl.ping
public void ping() { Util.out4.println("DeviceImpl.ping() arrived"); // // Record operation request in black box // blackbox.insert_op(Op_Ping); // // Return to caller // Util.out4.println("Leaving DeviceImpl.ping()"); }
java
public void ping() { Util.out4.println("DeviceImpl.ping() arrived"); // // Record operation request in black box // blackbox.insert_op(Op_Ping); // // Return to caller // Util.out4.println("Leaving DeviceImpl.ping()"); }
[ "public", "void", "ping", "(", ")", "{", "Util", ".", "out4", ".", "println", "(", "\"DeviceImpl.ping() arrived\"", ")", ";", "//", "// Record operation request in black box", "//", "blackbox", ".", "insert_op", "(", "Op_Ping", ")", ";", "//", "// Return to caller", "//", "Util", ".", "out4", ".", "println", "(", "\"Leaving DeviceImpl.ping()\"", ")", ";", "}" ]
Ping the device to check if it is still alive. Invoked when the client request the ping CORBA operation. It updates the device black box and simply returns
[ "Ping", "the", "device", "to", "check", "if", "it", "is", "still", "alive", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/DeviceImpl.java#L1284-L1299
140,290
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/DeviceImpl.java
DeviceImpl.add_attribute
public void add_attribute(final Attr new_attr) throws DevFailed { final Vector attr_list = device_class.get_class_attr().get_attr_list(); final int old_attr_nb = attr_list.size(); // // Check that this attribute is not already defined for this device. // If it is alaredy there, immediately returns. // Trick : If you add an attribute to a device, this attribute will be // inserted in the device class attribute list. Therefore, all devices // created after this attribute addition will also have this attribute. // final String attr_name = new_attr.get_name(); boolean already_there = true; try { dev_attr.get_attr_by_name(attr_name); } catch (final DevFailed ex) { already_there = false; } if (already_there == true) { return; } // // Add this attribute in the MultiClassAttribute attr_list vector if it // does not // already exist // int i; for (i = 0; i < old_attr_nb; i++) { if (((Attr) attr_list.elementAt(i)).get_name().equals(attr_name) == true) { break; } } if (i == old_attr_nb) { attr_list.addElement(new_attr); // // Get all the properties defined for this attribute at class level // device_class.get_class_attr() .init_class_attribute(device_class.get_name(), old_attr_nb); } // // Add the attribute to the MultiAttribute object // dev_attr.add_attribute(device_name, device_class, i); }
java
public void add_attribute(final Attr new_attr) throws DevFailed { final Vector attr_list = device_class.get_class_attr().get_attr_list(); final int old_attr_nb = attr_list.size(); // // Check that this attribute is not already defined for this device. // If it is alaredy there, immediately returns. // Trick : If you add an attribute to a device, this attribute will be // inserted in the device class attribute list. Therefore, all devices // created after this attribute addition will also have this attribute. // final String attr_name = new_attr.get_name(); boolean already_there = true; try { dev_attr.get_attr_by_name(attr_name); } catch (final DevFailed ex) { already_there = false; } if (already_there == true) { return; } // // Add this attribute in the MultiClassAttribute attr_list vector if it // does not // already exist // int i; for (i = 0; i < old_attr_nb; i++) { if (((Attr) attr_list.elementAt(i)).get_name().equals(attr_name) == true) { break; } } if (i == old_attr_nb) { attr_list.addElement(new_attr); // // Get all the properties defined for this attribute at class level // device_class.get_class_attr() .init_class_attribute(device_class.get_name(), old_attr_nb); } // // Add the attribute to the MultiAttribute object // dev_attr.add_attribute(device_name, device_class, i); }
[ "public", "void", "add_attribute", "(", "final", "Attr", "new_attr", ")", "throws", "DevFailed", "{", "final", "Vector", "attr_list", "=", "device_class", ".", "get_class_attr", "(", ")", ".", "get_attr_list", "(", ")", ";", "final", "int", "old_attr_nb", "=", "attr_list", ".", "size", "(", ")", ";", "//", "// Check that this attribute is not already defined for this device.", "// If it is alaredy there, immediately returns.", "// Trick : If you add an attribute to a device, this attribute will be", "// inserted in the device class attribute list. Therefore, all devices", "// created after this attribute addition will also have this attribute.", "//\t", "final", "String", "attr_name", "=", "new_attr", ".", "get_name", "(", ")", ";", "boolean", "already_there", "=", "true", ";", "try", "{", "dev_attr", ".", "get_attr_by_name", "(", "attr_name", ")", ";", "}", "catch", "(", "final", "DevFailed", "ex", ")", "{", "already_there", "=", "false", ";", "}", "if", "(", "already_there", "==", "true", ")", "{", "return", ";", "}", "//", "// Add this attribute in the MultiClassAttribute attr_list vector if it", "// does not", "// already exist", "//", "int", "i", ";", "for", "(", "i", "=", "0", ";", "i", "<", "old_attr_nb", ";", "i", "++", ")", "{", "if", "(", "(", "(", "Attr", ")", "attr_list", ".", "elementAt", "(", "i", ")", ")", ".", "get_name", "(", ")", ".", "equals", "(", "attr_name", ")", "==", "true", ")", "{", "break", ";", "}", "}", "if", "(", "i", "==", "old_attr_nb", ")", "{", "attr_list", ".", "addElement", "(", "new_attr", ")", ";", "//", "// Get all the properties defined for this attribute at class level", "//", "device_class", ".", "get_class_attr", "(", ")", ".", "init_class_attribute", "(", "device_class", ".", "get_name", "(", ")", ",", "old_attr_nb", ")", ";", "}", "//", "// Add the attribute to the MultiAttribute object", "//", "dev_attr", ".", "add_attribute", "(", "device_name", ",", "device_class", ",", "i", ")", ";", "}" ]
Add a new attribute to the device attribute list. Attributes are normally constructed in the DeviceClass::attribute_factory() method. Nevertheless, it is still possible to add a new attribute to a device with this method. Please, note that if you add an attribute to a device at device creation time, this attribute will be added to the device class attribute list. Therefore, all devices belonging to the same class created after this attribute addition will also have this attribute. @param new_attr Reference to the new attribute to be added to the list @exception DevFailed . Click <a href="../../tango_basic/idl_html/Tango.html#DevFailed">here </a> to read <b>DevFailed</b> exception specification
[ "Add", "a", "new", "attribute", "to", "the", "device", "attribute", "list", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/DeviceImpl.java#L2350-L2404
140,291
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/DeviceImpl.java
DeviceImpl.get_logger
public Logger get_logger() { if (logger == null) { logger = Logger.getLogger(get_name().toLowerCase()); logger.setAdditivity(false); logger.setLevel(Level.WARN); last_level = Level.WARN; } return logger; }
java
public Logger get_logger() { if (logger == null) { logger = Logger.getLogger(get_name().toLowerCase()); logger.setAdditivity(false); logger.setLevel(Level.WARN); last_level = Level.WARN; } return logger; }
[ "public", "Logger", "get_logger", "(", ")", "{", "if", "(", "logger", "==", "null", ")", "{", "logger", "=", "Logger", ".", "getLogger", "(", "get_name", "(", ")", ".", "toLowerCase", "(", ")", ")", ";", "logger", ".", "setAdditivity", "(", "false", ")", ";", "logger", ".", "setLevel", "(", "Level", ".", "WARN", ")", ";", "last_level", "=", "Level", ".", "WARN", ";", "}", "return", "logger", ";", "}" ]
Returns the device's logger
[ "Returns", "the", "device", "s", "logger" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/DeviceImpl.java#L2734-L2742
140,292
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/DeviceImpl.java
DeviceImpl.init_logger
@SuppressWarnings( { "NestedTryStatement" }) public void init_logger() { try { Util.out4.println("Initializing logging for " + get_name()); // - Get Util instance final Util util = Util.instance(); // - Get cmd line logging level then ... final int trace_level = util.get_trace_level(); // ... convert it to log4j level Level cmd_line_level; // does the logging level set from cmd line? boolean level_set_from_cmd_line = true; if (trace_level <= 0) { level_set_from_cmd_line = false; cmd_line_level = Level.OFF; } else if (trace_level <= 2) { cmd_line_level = Level.INFO; } else { cmd_line_level = Level.DEBUG; } // - Add a console target if logging level set from cmd line if (level_set_from_cmd_line) { // add a console target if logging level set from cmd line try { Logging.instance().add_logging_target(get_logger(), LOGGING_CONSOLE_TARGET); } catch (final DevFailed df) { /** ignore exception */ } } if (!Util._UseDb) { // - Done if we are not using the database Util.out4.println("Not using the database. Logging Intialization complete"); return; } // - Get both logging level and targets from database final Logging.LoggingProperties properties = Logging.instance().get_logging_properties( get_logger(), util.get_database()); if (properties == null) { Util.out4.println("Failed to obtain logging properties from database"); Util.out4.println("Aborting logging intialization"); get_logger().setLevel(cmd_line_level); return; } // - Set logging level if (level_set_from_cmd_line == false) { get_logger().setLevel(properties.logging_level); Util.out4.println("Logging level set to " + properties.logging_level.toString()); } else { get_logger().setLevel(cmd_line_level); } // - Save current logging level last_level = get_logger().getLevel(); // - Get rolling threshold for file targets if (rft != properties.logging_rft) { rft = properties.logging_rft; Util.out4.println("Rolling threshold changed to " + String.valueOf(rft)); } // - Set logging targets if (properties.logging_targets != null) { Util.out4.println("Adding logging targets (" + properties.logging_targets.length + " entries in db)"); for (final String logging_target : properties.logging_targets) { try { Logging.instance().add_logging_target(get_logger(), logging_target); } catch (final DevFailed e) { /* ignore any exception */ } } } // set rolling file threshold for file targets Logging.instance().set_rolling_file_threshold(get_logger(), rft); } catch (final Exception e) { // igore any exception } }
java
@SuppressWarnings( { "NestedTryStatement" }) public void init_logger() { try { Util.out4.println("Initializing logging for " + get_name()); // - Get Util instance final Util util = Util.instance(); // - Get cmd line logging level then ... final int trace_level = util.get_trace_level(); // ... convert it to log4j level Level cmd_line_level; // does the logging level set from cmd line? boolean level_set_from_cmd_line = true; if (trace_level <= 0) { level_set_from_cmd_line = false; cmd_line_level = Level.OFF; } else if (trace_level <= 2) { cmd_line_level = Level.INFO; } else { cmd_line_level = Level.DEBUG; } // - Add a console target if logging level set from cmd line if (level_set_from_cmd_line) { // add a console target if logging level set from cmd line try { Logging.instance().add_logging_target(get_logger(), LOGGING_CONSOLE_TARGET); } catch (final DevFailed df) { /** ignore exception */ } } if (!Util._UseDb) { // - Done if we are not using the database Util.out4.println("Not using the database. Logging Intialization complete"); return; } // - Get both logging level and targets from database final Logging.LoggingProperties properties = Logging.instance().get_logging_properties( get_logger(), util.get_database()); if (properties == null) { Util.out4.println("Failed to obtain logging properties from database"); Util.out4.println("Aborting logging intialization"); get_logger().setLevel(cmd_line_level); return; } // - Set logging level if (level_set_from_cmd_line == false) { get_logger().setLevel(properties.logging_level); Util.out4.println("Logging level set to " + properties.logging_level.toString()); } else { get_logger().setLevel(cmd_line_level); } // - Save current logging level last_level = get_logger().getLevel(); // - Get rolling threshold for file targets if (rft != properties.logging_rft) { rft = properties.logging_rft; Util.out4.println("Rolling threshold changed to " + String.valueOf(rft)); } // - Set logging targets if (properties.logging_targets != null) { Util.out4.println("Adding logging targets (" + properties.logging_targets.length + " entries in db)"); for (final String logging_target : properties.logging_targets) { try { Logging.instance().add_logging_target(get_logger(), logging_target); } catch (final DevFailed e) { /* ignore any exception */ } } } // set rolling file threshold for file targets Logging.instance().set_rolling_file_threshold(get_logger(), rft); } catch (final Exception e) { // igore any exception } }
[ "@", "SuppressWarnings", "(", "{", "\"NestedTryStatement\"", "}", ")", "public", "void", "init_logger", "(", ")", "{", "try", "{", "Util", ".", "out4", ".", "println", "(", "\"Initializing logging for \"", "+", "get_name", "(", ")", ")", ";", "// - Get Util instance", "final", "Util", "util", "=", "Util", ".", "instance", "(", ")", ";", "// - Get cmd line logging level then ...", "final", "int", "trace_level", "=", "util", ".", "get_trace_level", "(", ")", ";", "// ... convert it to log4j level", "Level", "cmd_line_level", ";", "// does the logging level set from cmd line?", "boolean", "level_set_from_cmd_line", "=", "true", ";", "if", "(", "trace_level", "<=", "0", ")", "{", "level_set_from_cmd_line", "=", "false", ";", "cmd_line_level", "=", "Level", ".", "OFF", ";", "}", "else", "if", "(", "trace_level", "<=", "2", ")", "{", "cmd_line_level", "=", "Level", ".", "INFO", ";", "}", "else", "{", "cmd_line_level", "=", "Level", ".", "DEBUG", ";", "}", "// - Add a console target if logging level set from cmd line", "if", "(", "level_set_from_cmd_line", ")", "{", "// add a console target if logging level set from cmd line", "try", "{", "Logging", ".", "instance", "(", ")", ".", "add_logging_target", "(", "get_logger", "(", ")", ",", "LOGGING_CONSOLE_TARGET", ")", ";", "}", "catch", "(", "final", "DevFailed", "df", ")", "{", "/** ignore exception */", "}", "}", "if", "(", "!", "Util", ".", "_UseDb", ")", "{", "// - Done if we are not using the database", "Util", ".", "out4", ".", "println", "(", "\"Not using the database. Logging Intialization complete\"", ")", ";", "return", ";", "}", "// - Get both logging level and targets from database", "final", "Logging", ".", "LoggingProperties", "properties", "=", "Logging", ".", "instance", "(", ")", ".", "get_logging_properties", "(", "get_logger", "(", ")", ",", "util", ".", "get_database", "(", ")", ")", ";", "if", "(", "properties", "==", "null", ")", "{", "Util", ".", "out4", ".", "println", "(", "\"Failed to obtain logging properties from database\"", ")", ";", "Util", ".", "out4", ".", "println", "(", "\"Aborting logging intialization\"", ")", ";", "get_logger", "(", ")", ".", "setLevel", "(", "cmd_line_level", ")", ";", "return", ";", "}", "// - Set logging level", "if", "(", "level_set_from_cmd_line", "==", "false", ")", "{", "get_logger", "(", ")", ".", "setLevel", "(", "properties", ".", "logging_level", ")", ";", "Util", ".", "out4", ".", "println", "(", "\"Logging level set to \"", "+", "properties", ".", "logging_level", ".", "toString", "(", ")", ")", ";", "}", "else", "{", "get_logger", "(", ")", ".", "setLevel", "(", "cmd_line_level", ")", ";", "}", "// - Save current logging level", "last_level", "=", "get_logger", "(", ")", ".", "getLevel", "(", ")", ";", "// - Get rolling threshold for file targets", "if", "(", "rft", "!=", "properties", ".", "logging_rft", ")", "{", "rft", "=", "properties", ".", "logging_rft", ";", "Util", ".", "out4", ".", "println", "(", "\"Rolling threshold changed to \"", "+", "String", ".", "valueOf", "(", "rft", ")", ")", ";", "}", "// - Set logging targets", "if", "(", "properties", ".", "logging_targets", "!=", "null", ")", "{", "Util", ".", "out4", ".", "println", "(", "\"Adding logging targets (\"", "+", "properties", ".", "logging_targets", ".", "length", "+", "\" entries in db)\"", ")", ";", "for", "(", "final", "String", "logging_target", ":", "properties", ".", "logging_targets", ")", "{", "try", "{", "Logging", ".", "instance", "(", ")", ".", "add_logging_target", "(", "get_logger", "(", ")", ",", "logging_target", ")", ";", "}", "catch", "(", "final", "DevFailed", "e", ")", "{", "/* ignore any exception */", "}", "}", "}", "// set rolling file threshold for file targets", "Logging", ".", "instance", "(", ")", ".", "set_rolling_file_threshold", "(", "get_logger", "(", ")", ",", "rft", ")", ";", "}", "catch", "(", "final", "Exception", "e", ")", "{", "// igore any exception", "}", "}" ]
Initialize the logging for this device
[ "Initialize", "the", "logging", "for", "this", "device" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/DeviceImpl.java#L2747-L2820
140,293
tango-controls/JTango
server/src/main/java/org/tango/server/events/ArchiveEventTrigger.java
ArchiveEventTrigger.checkEventCriteria
public static void checkEventCriteria(final AttributeImpl attribute) throws DevFailed { // Check if value is not numerical (always true for State and String) if (attribute.isState() || attribute.isString()) { return; } // Else check criteria final EventProperties props = attribute.getProperties().getEventProp(); if (props.arch_event.period.equals(Constants.NOT_SPECIFIED) && props.arch_event.abs_change.equals(Constants.NOT_SPECIFIED) && props.arch_event.rel_change.equals(Constants.NOT_SPECIFIED)) { throw DevFailedUtils.newDevFailed(ExceptionMessages.EVENT_CRITERIA_NOT_SET, "Archive event properties (archive_abs_change or " + "archive_rel_change or archive_period) for attribute " + attribute.getName() + " are not set"); } }
java
public static void checkEventCriteria(final AttributeImpl attribute) throws DevFailed { // Check if value is not numerical (always true for State and String) if (attribute.isState() || attribute.isString()) { return; } // Else check criteria final EventProperties props = attribute.getProperties().getEventProp(); if (props.arch_event.period.equals(Constants.NOT_SPECIFIED) && props.arch_event.abs_change.equals(Constants.NOT_SPECIFIED) && props.arch_event.rel_change.equals(Constants.NOT_SPECIFIED)) { throw DevFailedUtils.newDevFailed(ExceptionMessages.EVENT_CRITERIA_NOT_SET, "Archive event properties (archive_abs_change or " + "archive_rel_change or archive_period) for attribute " + attribute.getName() + " are not set"); } }
[ "public", "static", "void", "checkEventCriteria", "(", "final", "AttributeImpl", "attribute", ")", "throws", "DevFailed", "{", "// Check if value is not numerical (always true for State and String)\r", "if", "(", "attribute", ".", "isState", "(", ")", "||", "attribute", ".", "isString", "(", ")", ")", "{", "return", ";", "}", "// Else check criteria\r", "final", "EventProperties", "props", "=", "attribute", ".", "getProperties", "(", ")", ".", "getEventProp", "(", ")", ";", "if", "(", "props", ".", "arch_event", ".", "period", ".", "equals", "(", "Constants", ".", "NOT_SPECIFIED", ")", "&&", "props", ".", "arch_event", ".", "abs_change", ".", "equals", "(", "Constants", ".", "NOT_SPECIFIED", ")", "&&", "props", ".", "arch_event", ".", "rel_change", ".", "equals", "(", "Constants", ".", "NOT_SPECIFIED", ")", ")", "{", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "ExceptionMessages", ".", "EVENT_CRITERIA_NOT_SET", ",", "\"Archive event properties (archive_abs_change or \"", "+", "\"archive_rel_change or archive_period) for attribute \"", "+", "attribute", ".", "getName", "(", ")", "+", "\" are not set\"", ")", ";", "}", "}" ]
Check if event criteria are set for specified attribute @param attribute the specified attribute @throws DevFailed if no event criteria is set for specified attribute.
[ "Check", "if", "event", "criteria", "are", "set", "for", "specified", "attribute" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/events/ArchiveEventTrigger.java#L92-L107
140,294
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/TangoDeviceAppender.java
TangoDeviceAppender.close
public void close () { if (lc_dev_proxy != null) { try { DeviceData dd = new DeviceData(); dd.insert(dev_name); lc_dev_proxy.command_inout_asynch("UnRegister", dd, true); } catch (DevFailed dv) { //Ignore: some old LogViewer may not support the Unregister cmd } } lc_dev_proxy = null; dev_name = null; }
java
public void close () { if (lc_dev_proxy != null) { try { DeviceData dd = new DeviceData(); dd.insert(dev_name); lc_dev_proxy.command_inout_asynch("UnRegister", dd, true); } catch (DevFailed dv) { //Ignore: some old LogViewer may not support the Unregister cmd } } lc_dev_proxy = null; dev_name = null; }
[ "public", "void", "close", "(", ")", "{", "if", "(", "lc_dev_proxy", "!=", "null", ")", "{", "try", "{", "DeviceData", "dd", "=", "new", "DeviceData", "(", ")", ";", "dd", ".", "insert", "(", "dev_name", ")", ";", "lc_dev_proxy", ".", "command_inout_asynch", "(", "\"UnRegister\"", ",", "dd", ",", "true", ")", ";", "}", "catch", "(", "DevFailed", "dv", ")", "{", "//Ignore: some old LogViewer may not support the Unregister cmd", "}", "}", "lc_dev_proxy", "=", "null", ";", "dev_name", "=", "null", ";", "}" ]
Release any resources allocated within the appender.
[ "Release", "any", "resources", "allocated", "within", "the", "appender", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/TangoDeviceAppender.java#L94-L107
140,295
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/TangoDeviceAppender.java
TangoDeviceAppender.append
public void append (LoggingEvent evt) { if (lc_dev_proxy == null) { return; } try { String[] dvsa = new String[6]; dvsa[0] = String.valueOf(evt.timeStamp); dvsa[1] = evt.getLevel().toString(); dvsa[2] = evt.getLoggerName(); dvsa[3] = evt.getRenderedMessage(); dvsa[4] = ""; dvsa[5] = evt.getThreadName(); DeviceData dd = new DeviceData(); dd.insert(dvsa); lc_dev_proxy.command_inout_asynch("Log", dd, true); } catch (DevFailed dv) { close(); } }
java
public void append (LoggingEvent evt) { if (lc_dev_proxy == null) { return; } try { String[] dvsa = new String[6]; dvsa[0] = String.valueOf(evt.timeStamp); dvsa[1] = evt.getLevel().toString(); dvsa[2] = evt.getLoggerName(); dvsa[3] = evt.getRenderedMessage(); dvsa[4] = ""; dvsa[5] = evt.getThreadName(); DeviceData dd = new DeviceData(); dd.insert(dvsa); lc_dev_proxy.command_inout_asynch("Log", dd, true); } catch (DevFailed dv) { close(); } }
[ "public", "void", "append", "(", "LoggingEvent", "evt", ")", "{", "if", "(", "lc_dev_proxy", "==", "null", ")", "{", "return", ";", "}", "try", "{", "String", "[", "]", "dvsa", "=", "new", "String", "[", "6", "]", ";", "dvsa", "[", "0", "]", "=", "String", ".", "valueOf", "(", "evt", ".", "timeStamp", ")", ";", "dvsa", "[", "1", "]", "=", "evt", ".", "getLevel", "(", ")", ".", "toString", "(", ")", ";", "dvsa", "[", "2", "]", "=", "evt", ".", "getLoggerName", "(", ")", ";", "dvsa", "[", "3", "]", "=", "evt", ".", "getRenderedMessage", "(", ")", ";", "dvsa", "[", "4", "]", "=", "\"\"", ";", "dvsa", "[", "5", "]", "=", "evt", ".", "getThreadName", "(", ")", ";", "DeviceData", "dd", "=", "new", "DeviceData", "(", ")", ";", "dd", ".", "insert", "(", "dvsa", ")", ";", "lc_dev_proxy", ".", "command_inout_asynch", "(", "\"Log\"", ",", "dd", ",", "true", ")", ";", "}", "catch", "(", "DevFailed", "dv", ")", "{", "close", "(", ")", ";", "}", "}" ]
Performs actual logging.
[ "Performs", "actual", "logging", "." ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/TangoDeviceAppender.java#L112-L131
140,296
tango-controls/JTango
server/src/main/java/org/tango/server/idl/CleverAnyAttribute.java
CleverAnyAttribute.set
public static Any set(final int tangoType, final Object value) throws DevFailed { final Any any = ORBManager.createAny(); if (value != null) { Object array = null; if (value.getClass().isArray()) { // convert to array of primitives if necessary array = org.tango.utils.ArrayUtils.toPrimitiveArray(value); } else { // put in an array before inserting for scalars array = Array.newInstance(AttributeTangoType.getTypeFromTango(tangoType).getType(), 1); Array.set(array, 0, value); } Method method = null; try { final Class<?> inserterClass = CLASS_MAP.get(tangoType); method = inserterClass.getMethod("insert", Any.class, PARAM_MAP.get(tangoType)); method.invoke(null, any, array); } catch (final IllegalArgumentException e) { throw DevFailedUtils.newDevFailed(ExceptionMessages.ATTR_OPT_PROP, value.getClass().getCanonicalName() + " is not of the good type, should be " + method); } catch (final IllegalAccessException e) { throw DevFailedUtils.newDevFailed(e); } catch (final InvocationTargetException e) { throw DevFailedUtils.newDevFailed(e.getCause()); } catch (final SecurityException e) { throw DevFailedUtils.newDevFailed(e); } catch (final NoSuchMethodException e) { throw DevFailedUtils.newDevFailed(e); } } return any; }
java
public static Any set(final int tangoType, final Object value) throws DevFailed { final Any any = ORBManager.createAny(); if (value != null) { Object array = null; if (value.getClass().isArray()) { // convert to array of primitives if necessary array = org.tango.utils.ArrayUtils.toPrimitiveArray(value); } else { // put in an array before inserting for scalars array = Array.newInstance(AttributeTangoType.getTypeFromTango(tangoType).getType(), 1); Array.set(array, 0, value); } Method method = null; try { final Class<?> inserterClass = CLASS_MAP.get(tangoType); method = inserterClass.getMethod("insert", Any.class, PARAM_MAP.get(tangoType)); method.invoke(null, any, array); } catch (final IllegalArgumentException e) { throw DevFailedUtils.newDevFailed(ExceptionMessages.ATTR_OPT_PROP, value.getClass().getCanonicalName() + " is not of the good type, should be " + method); } catch (final IllegalAccessException e) { throw DevFailedUtils.newDevFailed(e); } catch (final InvocationTargetException e) { throw DevFailedUtils.newDevFailed(e.getCause()); } catch (final SecurityException e) { throw DevFailedUtils.newDevFailed(e); } catch (final NoSuchMethodException e) { throw DevFailedUtils.newDevFailed(e); } } return any; }
[ "public", "static", "Any", "set", "(", "final", "int", "tangoType", ",", "final", "Object", "value", ")", "throws", "DevFailed", "{", "final", "Any", "any", "=", "ORBManager", ".", "createAny", "(", ")", ";", "if", "(", "value", "!=", "null", ")", "{", "Object", "array", "=", "null", ";", "if", "(", "value", ".", "getClass", "(", ")", ".", "isArray", "(", ")", ")", "{", "// convert to array of primitives if necessary", "array", "=", "org", ".", "tango", ".", "utils", ".", "ArrayUtils", ".", "toPrimitiveArray", "(", "value", ")", ";", "}", "else", "{", "// put in an array before inserting for scalars", "array", "=", "Array", ".", "newInstance", "(", "AttributeTangoType", ".", "getTypeFromTango", "(", "tangoType", ")", ".", "getType", "(", ")", ",", "1", ")", ";", "Array", ".", "set", "(", "array", ",", "0", ",", "value", ")", ";", "}", "Method", "method", "=", "null", ";", "try", "{", "final", "Class", "<", "?", ">", "inserterClass", "=", "CLASS_MAP", ".", "get", "(", "tangoType", ")", ";", "method", "=", "inserterClass", ".", "getMethod", "(", "\"insert\"", ",", "Any", ".", "class", ",", "PARAM_MAP", ".", "get", "(", "tangoType", ")", ")", ";", "method", ".", "invoke", "(", "null", ",", "any", ",", "array", ")", ";", "}", "catch", "(", "final", "IllegalArgumentException", "e", ")", "{", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "ExceptionMessages", ".", "ATTR_OPT_PROP", ",", "value", ".", "getClass", "(", ")", ".", "getCanonicalName", "(", ")", "+", "\" is not of the good type, should be \"", "+", "method", ")", ";", "}", "catch", "(", "final", "IllegalAccessException", "e", ")", "{", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "e", ")", ";", "}", "catch", "(", "final", "InvocationTargetException", "e", ")", "{", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "e", ".", "getCause", "(", ")", ")", ";", "}", "catch", "(", "final", "SecurityException", "e", ")", "{", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "e", ")", ";", "}", "catch", "(", "final", "NoSuchMethodException", "e", ")", "{", "throw", "DevFailedUtils", ".", "newDevFailed", "(", "e", ")", ";", "}", "}", "return", "any", ";", "}" ]
Set a value in an any @param tangoType @param value @return the Any @throws DevFailed
[ "Set", "a", "value", "in", "an", "any" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/idl/CleverAnyAttribute.java#L148-L180
140,297
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Logging.java
Logging.get_logging_properties
public LoggingProperties get_logging_properties (Logger logger, Database db) { //- Instanciate the returned value LoggingProperties properties = new LoggingProperties(); //- Check input if (logger == null) { return properties; } try { //- Be sure the specified Database is valid if (db == null) { return properties; } //- Get logging properties from database String[] prop_names = new String[4]; //- Logging path property (overwrites env. var) prop_names[0] = "logging_path"; //- Logging file rolling threshold property prop_names[1] = "logging_rft"; //- Logging level property prop_names[2] = "logging_level"; //- Logging target property prop_names[3] = "logging_target"; //- Get properties from db DbDatum[] db_data = db.get_device_property(logger.getName(), prop_names); //- Set logging path if (db_data[0].is_empty() == false) { properties.logging_path = db_data[0].extractString(); } //- Set logging rft if (db_data[1].is_empty() == false) { properties.logging_rft = db_data[1].extractLong(); } if (properties.logging_rft < LOGGING_MIN_RFT) properties.logging_rft = LOGGING_MIN_RFT; else if (properties.logging_rft > LOGGING_MAX_RFT) properties.logging_rft = LOGGING_MAX_RFT; //- Set logging level (if not set from cmd line) if (db_data[2].is_empty() == false) { String level_str = db_data[2].extractString(); properties.logging_level = tango_to_log4j_level(level_str); } //- Get logging targets (will be set later) if (db_data[3].is_empty() == false) { properties.logging_targets = db_data[3].extractStringArray(); } } catch (java.lang.Exception e) { //- ignore any exception e.printStackTrace(); } return properties; }
java
public LoggingProperties get_logging_properties (Logger logger, Database db) { //- Instanciate the returned value LoggingProperties properties = new LoggingProperties(); //- Check input if (logger == null) { return properties; } try { //- Be sure the specified Database is valid if (db == null) { return properties; } //- Get logging properties from database String[] prop_names = new String[4]; //- Logging path property (overwrites env. var) prop_names[0] = "logging_path"; //- Logging file rolling threshold property prop_names[1] = "logging_rft"; //- Logging level property prop_names[2] = "logging_level"; //- Logging target property prop_names[3] = "logging_target"; //- Get properties from db DbDatum[] db_data = db.get_device_property(logger.getName(), prop_names); //- Set logging path if (db_data[0].is_empty() == false) { properties.logging_path = db_data[0].extractString(); } //- Set logging rft if (db_data[1].is_empty() == false) { properties.logging_rft = db_data[1].extractLong(); } if (properties.logging_rft < LOGGING_MIN_RFT) properties.logging_rft = LOGGING_MIN_RFT; else if (properties.logging_rft > LOGGING_MAX_RFT) properties.logging_rft = LOGGING_MAX_RFT; //- Set logging level (if not set from cmd line) if (db_data[2].is_empty() == false) { String level_str = db_data[2].extractString(); properties.logging_level = tango_to_log4j_level(level_str); } //- Get logging targets (will be set later) if (db_data[3].is_empty() == false) { properties.logging_targets = db_data[3].extractStringArray(); } } catch (java.lang.Exception e) { //- ignore any exception e.printStackTrace(); } return properties; }
[ "public", "LoggingProperties", "get_logging_properties", "(", "Logger", "logger", ",", "Database", "db", ")", "{", "//- Instanciate the returned value", "LoggingProperties", "properties", "=", "new", "LoggingProperties", "(", ")", ";", "//- Check input", "if", "(", "logger", "==", "null", ")", "{", "return", "properties", ";", "}", "try", "{", "//- Be sure the specified Database is valid", "if", "(", "db", "==", "null", ")", "{", "return", "properties", ";", "}", "//- Get logging properties from database", "String", "[", "]", "prop_names", "=", "new", "String", "[", "4", "]", ";", "//- Logging path property (overwrites env. var)", "prop_names", "[", "0", "]", "=", "\"logging_path\"", ";", "//- Logging file rolling threshold property", "prop_names", "[", "1", "]", "=", "\"logging_rft\"", ";", "//- Logging level property", "prop_names", "[", "2", "]", "=", "\"logging_level\"", ";", "//- Logging target property", "prop_names", "[", "3", "]", "=", "\"logging_target\"", ";", "//- Get properties from db", "DbDatum", "[", "]", "db_data", "=", "db", ".", "get_device_property", "(", "logger", ".", "getName", "(", ")", ",", "prop_names", ")", ";", "//- Set logging path", "if", "(", "db_data", "[", "0", "]", ".", "is_empty", "(", ")", "==", "false", ")", "{", "properties", ".", "logging_path", "=", "db_data", "[", "0", "]", ".", "extractString", "(", ")", ";", "}", "//- Set logging rft", "if", "(", "db_data", "[", "1", "]", ".", "is_empty", "(", ")", "==", "false", ")", "{", "properties", ".", "logging_rft", "=", "db_data", "[", "1", "]", ".", "extractLong", "(", ")", ";", "}", "if", "(", "properties", ".", "logging_rft", "<", "LOGGING_MIN_RFT", ")", "properties", ".", "logging_rft", "=", "LOGGING_MIN_RFT", ";", "else", "if", "(", "properties", ".", "logging_rft", ">", "LOGGING_MAX_RFT", ")", "properties", ".", "logging_rft", "=", "LOGGING_MAX_RFT", ";", "//- Set logging level (if not set from cmd line)", "if", "(", "db_data", "[", "2", "]", ".", "is_empty", "(", ")", "==", "false", ")", "{", "String", "level_str", "=", "db_data", "[", "2", "]", ".", "extractString", "(", ")", ";", "properties", ".", "logging_level", "=", "tango_to_log4j_level", "(", "level_str", ")", ";", "}", "//- Get logging targets (will be set later)", "if", "(", "db_data", "[", "3", "]", ".", "is_empty", "(", ")", "==", "false", ")", "{", "properties", ".", "logging_targets", "=", "db_data", "[", "3", "]", ".", "extractStringArray", "(", ")", ";", "}", "}", "catch", "(", "java", ".", "lang", ".", "Exception", "e", ")", "{", "//- ignore any exception", "e", ".", "printStackTrace", "(", ")", ";", "}", "return", "properties", ";", "}" ]
Reads logging properties from TANGO database
[ "Reads", "logging", "properties", "from", "TANGO", "database" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Logging.java#L246-L298
140,298
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Logging.java
Logging.set_logging_level
public void set_logging_level (DevVarLongStringArray dvlsa) throws DevFailed { //- Check input if (dvlsa.svalue.length != dvlsa.svalue.length) { String desc = "Imcompatible command argument type, long and string arrays must have the same length"; Except.throw_exception("API_IncompatibleCmdArgumentType", desc, "Logging::set_logging_level"); } //- For each entry in dvlsa.svalue for (int i = 0; i < dvlsa.svalue.length; i++) { //- Check/get logging level (may throw DevFailed) Level level = tango_to_log4j_level(dvlsa.lvalue[i]); //- Get ith wilcard String pattern = dvlsa.svalue[i].toLowerCase(); //- Get devices which name matches the pattern pattern Vector dl = Util.instance().get_device_list(pattern); //- For each device in dl Iterator it = dl.iterator(); while (it.hasNext()) { Logger logger = ((DeviceImpl)it.next()).get_logger(); if (logger == null) { String desc = "Internal error. Got invalid logger for device " + logger.getName(); Except.throw_exception("API_InternalError", desc, "Logging::set_logging_level"); } // set logger's level logger.setLevel(level); Util.out4.println("Logging level set to " + level.toString() + " for device " + logger.getName()); } // while it.hasNext } // for i }
java
public void set_logging_level (DevVarLongStringArray dvlsa) throws DevFailed { //- Check input if (dvlsa.svalue.length != dvlsa.svalue.length) { String desc = "Imcompatible command argument type, long and string arrays must have the same length"; Except.throw_exception("API_IncompatibleCmdArgumentType", desc, "Logging::set_logging_level"); } //- For each entry in dvlsa.svalue for (int i = 0; i < dvlsa.svalue.length; i++) { //- Check/get logging level (may throw DevFailed) Level level = tango_to_log4j_level(dvlsa.lvalue[i]); //- Get ith wilcard String pattern = dvlsa.svalue[i].toLowerCase(); //- Get devices which name matches the pattern pattern Vector dl = Util.instance().get_device_list(pattern); //- For each device in dl Iterator it = dl.iterator(); while (it.hasNext()) { Logger logger = ((DeviceImpl)it.next()).get_logger(); if (logger == null) { String desc = "Internal error. Got invalid logger for device " + logger.getName(); Except.throw_exception("API_InternalError", desc, "Logging::set_logging_level"); } // set logger's level logger.setLevel(level); Util.out4.println("Logging level set to " + level.toString() + " for device " + logger.getName()); } // while it.hasNext } // for i }
[ "public", "void", "set_logging_level", "(", "DevVarLongStringArray", "dvlsa", ")", "throws", "DevFailed", "{", "//- Check input", "if", "(", "dvlsa", ".", "svalue", ".", "length", "!=", "dvlsa", ".", "svalue", ".", "length", ")", "{", "String", "desc", "=", "\"Imcompatible command argument type, long and string arrays must have the same length\"", ";", "Except", ".", "throw_exception", "(", "\"API_IncompatibleCmdArgumentType\"", ",", "desc", ",", "\"Logging::set_logging_level\"", ")", ";", "}", "//- For each entry in dvlsa.svalue", "for", "(", "int", "i", "=", "0", ";", "i", "<", "dvlsa", ".", "svalue", ".", "length", ";", "i", "++", ")", "{", "//- Check/get logging level (may throw DevFailed)", "Level", "level", "=", "tango_to_log4j_level", "(", "dvlsa", ".", "lvalue", "[", "i", "]", ")", ";", "//- Get ith wilcard", "String", "pattern", "=", "dvlsa", ".", "svalue", "[", "i", "]", ".", "toLowerCase", "(", ")", ";", "//- Get devices which name matches the pattern pattern", "Vector", "dl", "=", "Util", ".", "instance", "(", ")", ".", "get_device_list", "(", "pattern", ")", ";", "//- For each device in dl", "Iterator", "it", "=", "dl", ".", "iterator", "(", ")", ";", "while", "(", "it", ".", "hasNext", "(", ")", ")", "{", "Logger", "logger", "=", "(", "(", "DeviceImpl", ")", "it", ".", "next", "(", ")", ")", ".", "get_logger", "(", ")", ";", "if", "(", "logger", "==", "null", ")", "{", "String", "desc", "=", "\"Internal error. Got invalid logger for device \"", "+", "logger", ".", "getName", "(", ")", ";", "Except", ".", "throw_exception", "(", "\"API_InternalError\"", ",", "desc", ",", "\"Logging::set_logging_level\"", ")", ";", "}", "// set logger's level", "logger", ".", "setLevel", "(", "level", ")", ";", "Util", ".", "out4", ".", "println", "(", "\"Logging level set to \"", "+", "level", ".", "toString", "(", ")", "+", "\" for device \"", "+", "logger", ".", "getName", "(", ")", ")", ";", "}", "// while it.hasNext", "}", "// for i", "}" ]
Set logging level for the specified devices @param dvlsa A Tango.DevVarLongStringArray containing device-names and logging levels
[ "Set", "logging", "level", "for", "the", "specified", "devices" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Logging.java#L576-L603
140,299
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoDs/Logging.java
Logging.get_logging_level
public DevVarLongStringArray get_logging_level (String[] dvsa) throws DevFailed { //- Temp vector int i; Iterator it; Vector tmp_name = new Vector(); Vector tmp_level = new Vector(); //- For each entry in dvsa for (i = 0; i < dvsa.length; i++) { //- Get devices which name matches the pattern pattern Vector dl = Util.instance().get_device_list(dvsa[i].toLowerCase()); //- For each device in dl it = dl.iterator(); while (it.hasNext()) { DeviceImpl dev = (DeviceImpl)it.next(); tmp_name.addElement(dev.get_name()); tmp_level.addElement(dev.get_logger().getLevel()); } } //- Instanciate retuned value DevVarLongStringArray dvlsa = new DevVarLongStringArray(); dvlsa.lvalue = new int[tmp_level.size()]; dvlsa.svalue = new String[tmp_name.size()]; i = 0; Iterator name_it = tmp_name.iterator(); Iterator level_it = tmp_level.iterator(); while (name_it.hasNext() && level_it.hasNext()) { dvlsa.svalue[i] = (String)name_it.next(); dvlsa.lvalue[i] = log4j_to_tango_level((Level)level_it.next()); i++; } return dvlsa; }
java
public DevVarLongStringArray get_logging_level (String[] dvsa) throws DevFailed { //- Temp vector int i; Iterator it; Vector tmp_name = new Vector(); Vector tmp_level = new Vector(); //- For each entry in dvsa for (i = 0; i < dvsa.length; i++) { //- Get devices which name matches the pattern pattern Vector dl = Util.instance().get_device_list(dvsa[i].toLowerCase()); //- For each device in dl it = dl.iterator(); while (it.hasNext()) { DeviceImpl dev = (DeviceImpl)it.next(); tmp_name.addElement(dev.get_name()); tmp_level.addElement(dev.get_logger().getLevel()); } } //- Instanciate retuned value DevVarLongStringArray dvlsa = new DevVarLongStringArray(); dvlsa.lvalue = new int[tmp_level.size()]; dvlsa.svalue = new String[tmp_name.size()]; i = 0; Iterator name_it = tmp_name.iterator(); Iterator level_it = tmp_level.iterator(); while (name_it.hasNext() && level_it.hasNext()) { dvlsa.svalue[i] = (String)name_it.next(); dvlsa.lvalue[i] = log4j_to_tango_level((Level)level_it.next()); i++; } return dvlsa; }
[ "public", "DevVarLongStringArray", "get_logging_level", "(", "String", "[", "]", "dvsa", ")", "throws", "DevFailed", "{", "//- Temp vector", "int", "i", ";", "Iterator", "it", ";", "Vector", "tmp_name", "=", "new", "Vector", "(", ")", ";", "Vector", "tmp_level", "=", "new", "Vector", "(", ")", ";", "//- For each entry in dvsa", "for", "(", "i", "=", "0", ";", "i", "<", "dvsa", ".", "length", ";", "i", "++", ")", "{", "//- Get devices which name matches the pattern pattern", "Vector", "dl", "=", "Util", ".", "instance", "(", ")", ".", "get_device_list", "(", "dvsa", "[", "i", "]", ".", "toLowerCase", "(", ")", ")", ";", "//- For each device in dl", "it", "=", "dl", ".", "iterator", "(", ")", ";", "while", "(", "it", ".", "hasNext", "(", ")", ")", "{", "DeviceImpl", "dev", "=", "(", "DeviceImpl", ")", "it", ".", "next", "(", ")", ";", "tmp_name", ".", "addElement", "(", "dev", ".", "get_name", "(", ")", ")", ";", "tmp_level", ".", "addElement", "(", "dev", ".", "get_logger", "(", ")", ".", "getLevel", "(", ")", ")", ";", "}", "}", "//- Instanciate retuned value", "DevVarLongStringArray", "dvlsa", "=", "new", "DevVarLongStringArray", "(", ")", ";", "dvlsa", ".", "lvalue", "=", "new", "int", "[", "tmp_level", ".", "size", "(", ")", "]", ";", "dvlsa", ".", "svalue", "=", "new", "String", "[", "tmp_name", ".", "size", "(", ")", "]", ";", "i", "=", "0", ";", "Iterator", "name_it", "=", "tmp_name", ".", "iterator", "(", ")", ";", "Iterator", "level_it", "=", "tmp_level", ".", "iterator", "(", ")", ";", "while", "(", "name_it", ".", "hasNext", "(", ")", "&&", "level_it", ".", "hasNext", "(", ")", ")", "{", "dvlsa", ".", "svalue", "[", "i", "]", "=", "(", "String", ")", "name_it", ".", "next", "(", ")", ";", "dvlsa", ".", "lvalue", "[", "i", "]", "=", "log4j_to_tango_level", "(", "(", "Level", ")", "level_it", ".", "next", "(", ")", ")", ";", "i", "++", ";", "}", "return", "dvlsa", ";", "}" ]
Get logging level for the specified devices @param dvsa A Tango.DevVarStringArray containing device names
[ "Get", "logging", "level", "for", "the", "specified", "devices" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/Logging.java#L610-L641