public class AttributeFactory extends AEntityFactory
AttributeFactory
is an extension of AEntityFactory
which takes care of instantiating Attribute objects. It is a Singleton,
so please use getInstance to instantiate the Factory.Modifier and Type | Field and Description |
---|---|
protected java.lang.String[] |
attNames |
protected java.util.Vector<AAttribute> |
attributes |
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, INTERFACE_CHANGE, 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, PIPE_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_ENUM, Tango_DEV_FLOAT, Tango_DEV_INT, Tango_DEV_LONG, Tango_DEV_LONG64, Tango_DEV_PIPE_BLOB, 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
Modifier | Constructor and Description |
---|---|
protected |
AttributeFactory()
Creates a new
AttributeFactory instance. |
Modifier and Type | Method and Description |
---|---|
protected void |
buildNames(java.lang.String fqname,
int insertionPos) |
IAttribute |
getAttribute(java.lang.String fqname)
Returns an Attribute corresponding to the given name.
|
protected AAttribute |
getAttributeOfType(Device device,
fr.esrf.TangoApi.AttributeInfoEx config)
getAttributeOfType figures out what type of
attribute is demanded, and deletates the work of instantiating the
attribute to getScalar, getSpectrum, or getImage. |
AAttribute[] |
getAttributes()
Returns all attributes belonging to this factory.
|
protected AAttribute |
getConnectionlessDevStateScalar(Device device,
java.lang.String fqname)
getConnectionlessDevStateScalar does the work of instantiating the
DevState scalar attribute even if the device is not responding. |
protected java.util.List<IEntity> |
getConnectionlessSingleAttribute(java.lang.String name)
getConnectionlessSingleAttribute |
protected IEntity |
getConnectionlessStateAttribute(java.lang.String fqname,
Device device)
getConnectionlessStateAttribute returns an attribute corresponding
to the name given in the first parameter. |
static AttributeFactory |
getInstance()
getInstance returns an instance of the AttributeFactory. |
protected IEntity |
getSingleEntity(java.lang.String fqname,
Device device)
getSingleEntity returns an attribute corresponding
to the name given in the first parameter. |
int |
getSize()
Returns the number of entity present in this factory.
|
java.lang.String |
getVersion()
Return release information of this factory.
|
protected java.util.List<IEntity> |
getWildCardEntities(java.lang.String name,
Device device)
getWildCardEntities |
protected AAttribute |
initAttribute(Device device,
fr.esrf.TangoApi.AttributeInfoEx config,
int insertionPos,
java.lang.String fqname)
initAttribute ask getAttributeOfType for an
AAttribute of the type given in the AttributeInfo passed as
parameter, and then calls init() on the attribute |
protected AAttribute |
initConnectionlessStateAttribute(Device device,
int insertionPos,
java.lang.String fqname)
initConnectionlessStateAttribute ask getConnectionlessDevStateScalar for an
AAttribute of the type given in the AttributeInfo passed as
parameter, and then calls init() on the attribute |
boolean |
isAttribute(java.lang.String fqname)
Check wether the given name correspond to an existing attribute.
|
boolean |
isConnectionLessAttribute(java.lang.String fqname)
Check whether the given name corresponds to a state attribute whose device is not reachable.
|
extractDeviceName, extractDeviceNameAdvanced, extractEntityName, getDevice, getEntities, getFQName, isWildCard
protected java.util.Vector<AAttribute> attributes
protected java.lang.String[] attNames
protected AttributeFactory()
AttributeFactory
instance. Do not use
this.getInstance()
public static AttributeFactory getInstance()
getInstance
returns an instance of the AttributeFactory.
There will be only one AttributeFactory per running instance of the JVM.AttributeFactory
valuepublic AAttribute[] getAttributes()
public int getSize()
AEntityFactory
getSize
in class AEntityFactory
protected java.util.List<IEntity> getWildCardEntities(java.lang.String name, Device device) throws fr.esrf.Tango.DevFailed
getWildCardEntities
getWildCardEntities
in class AEntityFactory
name
- a String
value containing the name of the
attributes to be instantiated.device
- a Device
value containging the device
that the attribute belongs toList
value containing the corresponding
IAttributesfr.esrf.Tango.DevFailed
- if an error occursIAttribute
protected java.util.List<IEntity> getConnectionlessSingleAttribute(java.lang.String name) throws ConnectionException
getConnectionlessSingleAttribute
getConnectionlessSingleAttribute
in class AEntityFactory
name
- a String
value containing the name of the
state attribute to be instantiated.List
value containing the corresponding
IAttributesConnectionException
IAttribute
protected IEntity getConnectionlessStateAttribute(java.lang.String fqname, Device device) throws ConnectionException
getConnectionlessStateAttribute
returns an attribute corresponding
to the name given in the first parameter. If such an attribute already
exists, the existing attribute is returned. Otherwise it is created.fqname
- a String
value containing the state attribute name
fully qualified with device name.device
- a Device
value the deviceIEntity
valueConnectionException
protected IEntity getSingleEntity(java.lang.String fqname, Device device) throws fr.esrf.Tango.DevFailed
getSingleEntity
returns an attribute corresponding
to the name given in the first parameter. If such an attribute already
exists, the existing attribute is returned. Otherwise it is created.getSingleEntity
in class AEntityFactory
fqname
- a String
value containing the EntityName
fully qualified with device name.device
- a Device
value the deviceIEntity
valuefr.esrf.Tango.DevFailed
- if an error occurspublic IAttribute getAttribute(java.lang.String fqname) throws ConnectionException, fr.esrf.Tango.DevFailed
fqname
- a String
value containing the EntityName
fully qualified with device name.ConnectionException
fr.esrf.Tango.DevFailed
public boolean isAttribute(java.lang.String fqname)
fqname
- Full entity namepublic boolean isConnectionLessAttribute(java.lang.String fqname)
fqname
- Full entity nameprotected AAttribute initAttribute(Device device, fr.esrf.TangoApi.AttributeInfoEx config, int insertionPos, java.lang.String fqname)
initAttribute
ask getAttributeOfType for an
AAttribute of the type given in the AttributeInfo passed as
parameter, and then calls init()
on the attributedevice
- a Device
valueconfig
- an AttributeInfo
valueinsertionPos
- Insertion postion of this new attribute in the global listfqname
- Full entity name (can include host and port)AAttribute
valueprotected AAttribute initConnectionlessStateAttribute(Device device, int insertionPos, java.lang.String fqname) throws ConnectionException
initConnectionlessStateAttribute
ask getConnectionlessDevStateScalar for an
AAttribute of the type given in the AttributeInfo passed as
parameter, and then calls init()
on the attributedevice
- a Device
valueinsertionPos
- Insertion postion of this new attribute in the global listfqname
- Full entity name (can include host and port)AAttribute
valueConnectionException
protected void buildNames(java.lang.String fqname, int insertionPos)
protected AAttribute getAttributeOfType(Device device, fr.esrf.TangoApi.AttributeInfoEx config)
getAttributeOfType
figures out what type of
attribute is demanded, and deletates the work of instantiating the
attribute to getScalar, getSpectrum, or getImage. The typeinference
is based on the value of AttributeConfig.data_format.device
- a Device
valueconfig
- an AttributeInfo
valueAAttribute
valuejava.lang.IllegalArgumentException
- if the format is unknown.protected AAttribute getConnectionlessDevStateScalar(Device device, java.lang.String fqname) throws ConnectionException
getConnectionlessDevStateScalar
does the work of instantiating the
DevState scalar attribute even if the device is not responding.device
- a Device
valueAAttribute
valuejava.lang.IllegalArgumentException
- if the attribute name is not state.ConnectionException
public java.lang.String getVersion()
AEntityFactory
getVersion
in class AEntityFactory