private AttributeValue[] buildAttributeValue(final String[] real_names) throws DevFailed {
	// Allocate memory for the AttributeValue structures
	AttributeValue[] back = new AttributeValue[0];
	// noinspection ErrorNotRethrown
	try {
	    back = new AttributeValue[real_names.length];
	    for (int i = 0; i < real_names.length; i++) {
		back[i] = new AttributeValue();
	    }
	} catch (final OutOfMemoryError ex) {
	    Except.throw_exception("API_MemoryAllocation", "Can't allocate memory in server",
		    "DeviceImpl.read_attributes");
	}

	// Build the sequence returned to caller for readable attributes and
	// check
	// that all the wanted attributes set value has been updated
	for (int i = 0; i < real_names.length; i++) {
	    final Attribute att = dev_attr.get_attr_by_name(real_names[i]);
	    if (att.get_value_flag()) {
		final AttrWriteType w_type = att.get_writable();
		if (w_type == AttrWriteType.READ || w_type == AttrWriteType.READ_WRITE
			|| w_type == AttrWriteType.READ_WITH_WRITE) {
		    if (w_type == AttrWriteType.READ_WRITE
			    || w_type == AttrWriteType.READ_WITH_WRITE) {
			dev_attr.add_write_value(att);
		    }

		    if (att.is_alarmed() == true
			    && att.get_quality().value() != AttrQuality._ATTR_INVALID) {
			att.check_alarm();
		    }
		}
		back[i].time = att.get_when();
		back[i].quality = att.get_quality();
		back[i].name = att.get_name();
		back[i].dim_x = att.get_x();
		back[i].dim_y = att.get_y();

		final Util tg = Util.instance();
		back[i].value = tg.get_orb().create_any();

		switch (att.get_data_type()) {
		case Tango_DEV_BOOLEAN:
		    DevVarBooleanArrayHelper.insert(back[i].value, att.get_boolean_value());
		    break;

		case Tango_DEV_SHORT:
		    DevVarShortArrayHelper.insert(back[i].value, att.get_short_value());
		    break;

		case Tango_DEV_USHORT:
		    DevVarUShortArrayHelper.insert(back[i].value, att.get_short_value());
		    break;

		case Tango_DEV_LONG:
		    DevVarLongArrayHelper.insert(back[i].value, att.get_long_value());
		    break;

		case Tango_DEV_ULONG:
		    DevVarULongArrayHelper.insert(back[i].value, att.get_long_value());
		    break;

		case Tango_DEV_LONG64:
		    DevVarLong64ArrayHelper.insert(back[i].value, att.get_long64_value());
		    break;

		case Tango_DEV_ULONG64:
		    DevVarULong64ArrayHelper.insert(back[i].value, att.get_long64_value());
		    break;

		case Tango_DEV_DOUBLE:
		    DevVarDoubleArrayHelper.insert(back[i].value, att.get_double_value());
		    break;

		case Tango_DEV_STRING:
		    DevVarStringArrayHelper.insert(back[i].value, att.get_string_value());
		    break;
		case Tango_DEV_STATE:
		    DevVarStateArrayHelper.insert(back[i].value, att.get_state_value());
		    break;

		/*
		 * //======================================================== //
		 * Not possible (DevEncoded type is not transfered inside an
		 * any)
		 * //========================================================
		 * case Tango_DEV_ENCODED :
		 * DevEncodedHelper.insert(back[i].value,att.get_enc_value());
		 * break;
		 */
		default:
		    Except.throw_exception("API_DatTypeNotSupported", "Attribute " + att.get_name()
			    + " data type not supported !", "Device_2Impl.read_attributes()");
		}
	    } else {
		Except.throw_exception("API_AttrValueNotSet", "Read value for attribute "
			+ att.get_name() + " has not been updated", "DeviceImpl.read_attributes");
	    }
	} // End of for ( ; ; )
	return back;
    }
private AttributeValue [ ] buildAttributeValue ( final String [ ] real_names ) throws DevFailed { AttributeValue [ ] back = new AttributeValue [ 0 ] ; try { back = new AttributeValue [ real_names . length ] ; for ( int i = 0 ; i < real_names . length ; i ++ ) { back [ i ] = new AttributeValue ( ) ; } } catch ( final OutOfMemoryError ex ) { Except . throw_exception ( "API_MemoryAllocation" , "Can't allocate memory in server" , "DeviceImpl.read_attributes" ) ; } for ( int i = 0 ; i < real_names . length ; i ++ ) { final Attribute att = dev_attr . get_attr_by_name ( real_names [ i ] ) ; if ( att . get_value_flag ( ) ) { final AttrWriteType w_type = att . get_writable ( ) ; if ( w_type == AttrWriteType . READ || w_type == AttrWriteType . READ_WRITE || w_type == AttrWriteType . READ_WITH_WRITE ) { if ( w_type == AttrWriteType . READ_WRITE || w_type == AttrWriteType . READ_WITH_WRITE ) { dev_attr . add_write_value ( att ) ; } if ( att . is_alarmed ( ) == true && att . get_quality ( ) . value ( ) != AttrQuality . _ATTR_INVALID ) { att . check_alarm ( ) ; } } back [ i ] . time = att . get_when ( ) ; back [ i ] . quality = att . get_quality ( ) ; back [ i ] . name = att . get_name ( ) ; back [ i ] . dim_x = att . get_x ( ) ; back [ i ] . dim_y = att . get_y ( ) ; final Util tg = Util . instance ( ) ; back [ i ] . value = tg . get_orb ( ) . create_any ( ) ; switch ( att . get_data_type ( ) ) { case Tango_DEV_BOOLEAN : DevVarBooleanArrayHelper . insert ( back [ i ] . value , att . get_boolean_value ( ) ) ; break ; case Tango_DEV_SHORT : DevVarShortArrayHelper . insert ( back [ i ] . value , att . get_short_value ( ) ) ; break ; case Tango_DEV_USHORT : DevVarUShortArrayHelper . insert ( back [ i ] . value , att . get_short_value ( ) ) ; break ; case Tango_DEV_LONG : DevVarLongArrayHelper . insert ( back [ i ] . value , att . get_long_value ( ) ) ; break ; case Tango_DEV_ULONG : DevVarULongArrayHelper . insert ( back [ i ] . value , att . get_long_value ( ) ) ; break ; case Tango_DEV_LONG64 : DevVarLong64ArrayHelper . insert ( back [ i ] . value , att . get_long64_value ( ) ) ; break ; case Tango_DEV_ULONG64 : DevVarULong64ArrayHelper . insert ( back [ i ] . value , att . get_long64_value ( ) ) ; break ; case Tango_DEV_DOUBLE : DevVarDoubleArrayHelper . insert ( back [ i ] . value , att . get_double_value ( ) ) ; break ; case Tango_DEV_STRING : DevVarStringArrayHelper . insert ( back [ i ] . value , att . get_string_value ( ) ) ; break ; case Tango_DEV_STATE : DevVarStateArrayHelper . insert ( back [ i ] . value , att . get_state_value ( ) ) ; break ; default : Except . throw_exception ( "API_DatTypeNotSupported" , "Attribute " + att . get_name ( ) + " data type not supported !" , "Device_2Impl.read_attributes()" ) ; } } else { Except . throw_exception ( "API_AttrValueNotSet" , "Read value for attribute " + att . get_name ( ) + " has not been updated" , "DeviceImpl.read_attributes" ) ; } } return back ; }
=========================================================================