TANGO Java API
( TangORB-7.3.3.jar)

fr.esrf.TangoDs
Class TemplCommand

java.lang.Object
  extended by fr.esrf.TangoDs.Command
      extended by fr.esrf.TangoDs.TemplCommand
All Implemented Interfaces:
TangoConst
Direct Known Subclasses:
TemplCommandIn, TemplCommandInOut, TemplCommandOut

public class TemplCommand
extends Command
implements TangoConst

This class is a class representing a command in the template command model without input or output parameter

Version:
$Revision: 1.4 $
Author:
$Author: pascal_verdier $ // // Copyright (C) : 2004,2005,2006,2007,2008,2009 // European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // // This file is part of Tango. // // Tango is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Tango is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Tango. If not, see . // // $Revision: 1.4 $ // // $Log: TemplCommand.java,v $ // Revision 1.4 2009/03/25 13:33:28 pascal_verdier // ... // // Revision 1.3 2009/01/16 12:37:13 pascal_verdier // IntelliJIdea warnings removed. // // Revision 1.2 2008/10/10 11:30:46 pascal_verdier // Headers changed for LGPL conformity. // // Revision 1.1 2007/08/23 08:33:24 ounsy // updated change from api/java // // Revision 3.9 2007/05/29 08:07:43 pascal_verdier // Long64, ULong64, ULong, UShort and DevState attributes added. // // Revision 3.8 2005/12/02 09:55:46 pascal_verdier // java import have been optimized. // // Revision 3.7 2004/06/29 04:05:09 pascal_verdier // Comments used by javadoc added. // // Revision 3.6 2004/05/14 13:47:57 pascal_verdier // Compatibility with Tango-2.2.0 cpp // (polling commands and attibites). // // Revision 3.5 2004/03/12 14:07:57 pascal_verdier // Use JacORB-2.1 // // Revision 2.0 2003/01/09 16:02:58 taurel // - Update release number before using SourceForge // // Revision 1.1.1.1 2003/01/09 15:54:39 taurel // Imported sources into CVS before using SourceForge // // Revision 1.6 2001/10/10 08:11:25 taurel // See Tango WEB pages for list of changes // // Revision 1.5 2001/07/04 15:06:38 taurel // Many changes due to new release // // Revision 1.2 2001/05/04 12:03:22 taurel // Fix bug in the Util.get_device_by_name() method // // Revision 1.1.1.1 2001/04/04 08:23:53 taurel // Imported sources // // Revision 1.3 2000/04/13 08:23:02 taurel // Added attribute support // // Revision 1.2 2000/02/04 09:10:00 taurel // Just update revision number // // Revision 1.1.1.1 2000/02/04 09:08:24 taurel // Imported sources // // // copyleft : European Synchrotron Radiation Facility // BP 220, Grenoble 38043 // FRANCE // //-============================================================================ package fr.esrf.TangoDs; import fr.esrf.Tango.DevFailed; import fr.esrf.Tango.DispLevel; import org.omg.CORBA.Any; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; /** This class is a class representing a command in the template command model without input or output parameter, $Author: pascal_verdier $

Field Summary
 
Fields inherited from interface fr.esrf.TangoDs.TangoConst
ACCESS_READ, ACCESS_SERVICE, ACCESS_WRITE, ARCHIVE_EVENT, ATT_CONF_EVENT, Attr_AdmName, Attr_Description, Attr_Name, Attr_State, Attr_Status, Attr_Unknown, ATTRIBUTE, BY_CLASS, BY_DEVICE, BY_PROCESS, CHANGE_EVENT, COMMAND, CONTROL_SYSTEM, DATA_READY_EVENT, DEFAULT_LOCK_VALIDITY, eventNames, LOGGING_CONSOLE_TARGET, LOGGING_CONSOLE_TARGET_ID, LOGGING_DEBUG, LOGGING_DEF_RFT, LOGGING_DEVICE_TARGET, LOGGING_DEVICE_TARGET_ID, LOGGING_ERROR, LOGGING_FATAL, LOGGING_FILE_TARGET, LOGGING_FILE_TARGET_ID, LOGGING_INFO, LOGGING_LEVELS, LOGGING_MAX_RFT, LOGGING_MIN_RFT, LOGGING_OFF, LOGGING_SEPARATOR, LOGGING_UNKNOWN_TARGET_ID, LOGGING_WARN, NO_SYNC, NOT_STATELESS, NotANumber, Op_BlackBox, Op_Command, Op_Command_2, Op_Command_inout, Op_Command_inout_2, Op_Command_inout_history_2, Op_Command_list, Op_Command_list_2, Op_Get_Attr_Config, Op_Get_Attr_Config_2, Op_Info, Op_Ping, Op_Read_Attr, Op_Read_Attr_2, Op_Read_Attr_history_2, Op_Set_Attr_Config, Op_Unknown, Op_Write_Attr, PERIODIC_EVENT, QUALITY_EVENT, Req_Attribute, Req_Operation, Req_Unknown, SERVICE_PROP_NAME, STATELESS, Tango_AllAttr, Tango_AllAttr_3, Tango_AlrmValueNotSpec, Tango_AssocWritNotSpec, Tango_AttrDataFormatName, Tango_CLNT_TIMEOUT, Tango_CmdArgTypeName, Tango_CONST_DEV_STRING, Tango_DbObjName, Tango_DEFAULT_POLL_OLD_FACTOR, Tango_DEFAULT_TIMEOUT, Tango_DEFAULT_TIMEOUT_SEC, Tango_DefaultBlackBoxDepth, Tango_DefaultDocUrl, Tango_DefaultPollRingDepth, Tango_DefaultWritableProp, Tango_DELTA_T, Tango_DescNotSet, Tango_DescNotSpec, Tango_DEV_BOOLEAN, Tango_DEV_CHAR, Tango_DEV_DOUBLE, Tango_DEV_ENCODED, Tango_DEV_FLOAT, Tango_DEV_INT, Tango_DEV_LONG, Tango_DEV_LONG64, Tango_DEV_SHORT, Tango_DEV_STATE, Tango_DEV_STRING, Tango_DEV_UCHAR, Tango_DEV_ULONG, Tango_DEV_ULONG64, Tango_DEV_USHORT, Tango_DEV_VOID, Tango_DevStateName, Tango_DEVVAR_CHARARRAY, Tango_DEVVAR_DOUBLEARRAY, Tango_DEVVAR_DOUBLESTRINGARRAY, Tango_DEVVAR_FLOATARRAY, Tango_DEVVAR_LONG64ARRAY, Tango_DEVVAR_LONGARRAY, Tango_DEVVAR_LONGSTRINGARRAY, Tango_DEVVAR_SHORTARRAY, Tango_DEVVAR_STRINGARRAY, Tango_DEVVAR_ULONG64ARRAY, Tango_DEVVAR_ULONGARRAY, Tango_DEVVAR_USHORTARRAY, Tango_DevVersion, Tango_DISCARD_THRESHOLD, Tango_DispUnitNotSpec, Tango_DSDeviceDomain, Tango_EXPERT_ATTR, Tango_EXPERT_CMD, Tango_FormatNotSpec, Tango_InitialOutput, Tango_LabelNotSpec, TANGO_LOG_PATH, Tango_MAX_TRANSFER_SIZE, Tango_MaxServerNameLength, Tango_MIN_POLL_PERIOD, Tango_OPERATOR_ATTR, Tango_OPERATOR_CMD, Tango_POLL_ADD_OBJ, Tango_POLL_ATTR, Tango_POLL_CMD, Tango_POLL_REM_DEV, Tango_POLL_REM_OBJ, Tango_POLL_START, Tango_POLL_STOP, Tango_POLL_UPD_PERIOD, Tango_PollAttribute, Tango_PollCommand, Tango_QualityName, Tango_REL_1, Tango_REL_2, Tango_ResNotDefined, Tango_StdUnitNotSpec, Tango_SysProperty, Tango_TG_IMP_MINOR_DEVFAILED, Tango_TG_IMP_MINOR_NON_DEVFAILED, Tango_TG_IMP_MINOR_TO, Tango_TgLibVers, Tango_UnitNotSpec, USER_EVENT
 
Constructor Summary
TemplCommand(java.lang.String name)
          Constructs a newly allocated TemplCommand object for a command with a name only.
TemplCommand(java.lang.String name, DispLevel disp)
          Constructs a newly allocated TemplCommand object for a command with a name only.
TemplCommand(java.lang.String name, java.lang.String exe_method)
          Constructs a newly allocated TemplCommand object for a command with a name and an execution method.
TemplCommand(java.lang.String name, java.lang.String exe_method, DispLevel disp)
          Constructs a newly allocated TemplCommand object for a command with a name and an execution method.
TemplCommand(java.lang.String name, java.lang.String exe_method, java.lang.String state_method)
          Constructs a newly allocated TemplCommand object for a command with a name, an execution method and a command allowed method.
TemplCommand(java.lang.String name, java.lang.String exe_method, java.lang.String state_method, DispLevel disp)
          Constructs a newly allocated TemplCommand object for a command with a name, an execution method and a command allowed method.
TemplCommand(java.lang.String name, java.lang.String in_desc, java.lang.String out_desc, DispLevel disp, double dummy)
          Constructs a newly allocated TemplCommand object for a command with a name and input plus output parameter description.
TemplCommand(java.lang.String name, java.lang.String in_desc, java.lang.String out_desc, double dummy)
          Constructs a newly allocated TemplCommand object for a command with a name and input plus output parameter description.
TemplCommand(java.lang.String name, java.lang.String exe_method, java.lang.String in_desc, java.lang.String out_desc)
          Constructs a newly allocated TemplCommand object for a command with a name, an execution method and a description for the input and output command parameters The command display type is set to OPERATOR_CMD.
TemplCommand(java.lang.String name, java.lang.String exe_method, java.lang.String in_desc, java.lang.String out_desc, DispLevel disp)
          Constructs a newly allocated TemplCommand object for a command with a name, an execution method and a description for the input and output command parameters
TemplCommand(java.lang.String name, java.lang.String exe_method, java.lang.String state_method, java.lang.String in_desc, java.lang.String out_desc)
          Constructs a newly allocated TemplCommand object for a command with a name, an execution method, a command allowed method and a description for the input and output command parameters.
TemplCommand(java.lang.String name, java.lang.String exe_method, java.lang.String state_method, java.lang.String in_desc, java.lang.String out_desc, DispLevel disp)
          Constructs a newly allocated TemplCommand object for a command with a name, an execution method, a command allowed method and a description for the input and output command parameters.
 
Method Summary
 void analyse_methods()
          Analyse the method given at construction time.
 org.omg.CORBA.Any execute(DeviceImpl dev, org.omg.CORBA.Any in_any)
          Invoke the command execution method given at object creation time.
 boolean is_allowed(DeviceImpl dev, org.omg.CORBA.Any data_in)
          Invoke the command allowed method given at object creation time.
 
Methods inherited from class fr.esrf.TangoDs.Command
extract_DevBoolean, extract_DevDouble, extract_DevFloat, extract_DevLong, extract_DevLong64, extract_DevShort, extract_DevState, extract_DevString, extract_DevULong, extract_DevULong64, extract_DevUShort, extract_DevVarCharArray, extract_DevVarDoubleArray, extract_DevVarDoubleStringArray, extract_DevVarFloatArray, extract_DevVarLong64Array, extract_DevVarLongArray, extract_DevVarLongStringArray, extract_DevVarShortArray, extract_DevVarStringArray, extract_DevVarULong64Array, extract_DevVarULongArray, extract_DevVarUShortArray, get_device_class_name, get_disp_level, get_in_type_desc, get_in_type, get_name, get_out_type_desc, get_out_type, get_polling_period, get_tag, insert_u, insert_u, insert_u, insert_u, insert_u, insert_u, insert, insert, insert, insert, insert, insert, insert, insert, insert, insert, insert, insert, insert, insert, insert, insert, insert, insert, is_template, set_device_class_name, set_disp_level, set_in_type_desc, set_out_type_desc, set_polling_period
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplCommand

public TemplCommand(java.lang.String name,
                    java.lang.String exe_method,
                    java.lang.String state_method)
Constructs a newly allocated TemplCommand object for a command with a name, an execution method and a command allowed method. This constructor set the command input and output type to Tango_DEV_VOID The input and output parameter description are set to the default String "Uninitialised". The command display type is set to OPERATOR_CMD.

Parameters:
name - The command name
exe_method - The command execution method name
state_method - The command allowed method name

TemplCommand

public TemplCommand(java.lang.String name,
                    java.lang.String exe_method)
Constructs a newly allocated TemplCommand object for a command with a name and an execution method. This constructor set the command input and output type to Tango_DEV_VOID. The input and output parameter description are set to the default String "Uninitialised". The command display type is set to OPERATOR_CMD.

Parameters:
name - The command name
exe_method - The command execution method name

TemplCommand

public TemplCommand(java.lang.String name,
                    java.lang.String exe_method,
                    java.lang.String state_method,
                    java.lang.String in_desc,
                    java.lang.String out_desc)
Constructs a newly allocated TemplCommand object for a command with a name, an execution method, a command allowed method and a description for the input and output command parameters. This constructor set the command input and output type to Tango_DEV_VOID The command display type is set to OPERATOR_CMD.

Parameters:
name - The command name
exe_method - The command execution method name
state_method - The command allowed method name
in_desc - The command input parameter description
out_desc - The command output parameter description

TemplCommand

public TemplCommand(java.lang.String name,
                    java.lang.String exe_method,
                    java.lang.String in_desc,
                    java.lang.String out_desc)
Constructs a newly allocated TemplCommand object for a command with a name, an execution method and a description for the input and output command parameters The command display type is set to OPERATOR_CMD.

Parameters:
name - The command name
exe_method - The command execution method name
in_desc - The command input parameter description
out_desc - The command output parameter description

TemplCommand

public TemplCommand(java.lang.String name)
Constructs a newly allocated TemplCommand object for a command with a name only. This constructor is used only by sub-classes and is not intended to be used to construct a "real" TemplCommand object This constructor set the command input and output type to Tango_DEV_VOID. The input and output parameter description are set to the default String "Uninitialised". The command display type is set to OPERATOR_CMD.

Parameters:
name - The command name

TemplCommand

public TemplCommand(java.lang.String name,
                    java.lang.String in_desc,
                    java.lang.String out_desc,
                    double dummy)
Constructs a newly allocated TemplCommand object for a command with a name and input plus output parameter description. This constructor is used only by sub-classes and is not intended to be used to construct a "real" TemplCommand object. The last parameter is only needed to differentiate this constructor from the one with the command name, the execution method and the state method which is also an object constructor from three String. This constructor set the command input and output type to Tango_DEV_VOID The command display type is set to OPERATOR_CMD.

Parameters:
name - The command name
in_desc - The command input parameter description
out_desc - The command output parameter description
dummy - Not used parameter

TemplCommand

public TemplCommand(java.lang.String name,
                    java.lang.String exe_method,
                    java.lang.String state_method,
                    DispLevel disp)
Constructs a newly allocated TemplCommand object for a command with a name, an execution method and a command allowed method. This constructor set the command input and output type to Tango_DEV_VOID The input and output parameter description are set to the default String "Uninitialised".

Parameters:
name - The command name
exe_method - The command execution method name
state_method - The command allowed method name
disp - The command display type

TemplCommand

public TemplCommand(java.lang.String name,
                    java.lang.String exe_method,
                    DispLevel disp)
Constructs a newly allocated TemplCommand object for a command with a name and an execution method. This constructor set the command input and output type to Tango_DEV_VOID. The input and output parameter description are set to the default String "Uninitialised".

Parameters:
name - The command name
exe_method - The command execution method name
disp - The command display type

TemplCommand

public TemplCommand(java.lang.String name,
                    java.lang.String exe_method,
                    java.lang.String state_method,
                    java.lang.String in_desc,
                    java.lang.String out_desc,
                    DispLevel disp)
Constructs a newly allocated TemplCommand object for a command with a name, an execution method, a command allowed method and a description for the input and output command parameters. This constructor set the command input and output type to Tango_DEV_VOID

Parameters:
name - The command name
exe_method - The command execution method name
state_method - The command allowed method name
in_desc - The command input parameter description
out_desc - The command output parameter description
disp - The command display type

TemplCommand

public TemplCommand(java.lang.String name,
                    java.lang.String exe_method,
                    java.lang.String in_desc,
                    java.lang.String out_desc,
                    DispLevel disp)
Constructs a newly allocated TemplCommand object for a command with a name, an execution method and a description for the input and output command parameters

Parameters:
name - The command name
exe_method - The command execution method name
in_desc - The command input parameter description
out_desc - The command output parameter description
disp - The command display type

TemplCommand

public TemplCommand(java.lang.String name,
                    DispLevel disp)
Constructs a newly allocated TemplCommand object for a command with a name only. This constructor is used only by sub-classes and is not intended to be used to construct a "real" TemplCommand object This constructor set the command input and output type to Tango_DEV_VOID. The input and output parameter description are set to the default String "Uninitialised".

Parameters:
name - The command name
disp - The command display type

TemplCommand

public TemplCommand(java.lang.String name,
                    java.lang.String in_desc,
                    java.lang.String out_desc,
                    DispLevel disp,
                    double dummy)
Constructs a newly allocated TemplCommand object for a command with a name and input plus output parameter description. This constructor is used only by sub-classes and is not intended to be used to construct a "real" TemplCommand object. The last parameter is only needed to differentiate this constructor from the one with the command name, the execution method and the state method which is also an object constructor from three String. This constructor set the command input and output type to Tango_DEV_VOID

Parameters:
name - The command name
in_desc - The command input parameter description
out_desc - The command output parameter description
dummy - Not used parameter
disp - The command display type
Method Detail

analyse_methods

public void analyse_methods()
                     throws DevFailed
Analyse the method given at construction time. This method check if the method(s) given at construction time fulfill the required specification. It always analyse the execution method and eventually the command allowed method.

Overrides:
analyse_methods in class Command
Throws:
DevFailed - If one of the method does not fulfill the requirements. Click here to read DevFailed exception specification

is_allowed

public boolean is_allowed(DeviceImpl dev,
                          org.omg.CORBA.Any data_in)
Invoke the command allowed method given at object creation time. This method is automtically called by the TANGO core classes when the associated command is requested by a client to check if the command is allowed in the actual device state. If the user give a command allowed method at object creation time, this method will be invoked.

Overrides:
is_allowed in class Command
Parameters:
dev - The device on which the command must be executed
data_in - The incoming data still packed in a CORBA Any object. For command created with this TemplCommand class, this Any object does not contain data
Returns:
A boolean set to true is the command is allowed. Otherwise, the return value is false. This return value is always set to true if the user does not supply a method to be excuted. If a method has been supplied, the return value is the value returned by the user supplied mehod.

execute

public org.omg.CORBA.Any execute(DeviceImpl dev,
                                 org.omg.CORBA.Any in_any)
                          throws DevFailed
Invoke the command execution method given at object creation time. This method is automatically called by the TANGO core classes when the associated command is requested by a client.

Specified by:
execute in class Command
Parameters:
dev - The device on which the command must be executed
in_any - The incoming data still packed in a CORBA Any object. For command created with this TemplCommand class, this Any object does not contain usefull data
Returns:
The CORBA Any object returned to the client. For command created with this TemplCommand class, this any object does not contain data.
Throws:
DevFailed - If the execution method failed Click here to read DevFailed exception specification

TANGO Java API
( TangORB-7.3.3.jar)