code: public DevAttrHistory[] read_attribute_history_2(final String name, int n) throws DevFailed,
  	    SystemException {
  	Util.out4.println("Device_2Impl.read_attribute_history_2 arrived");
  
  	// Record operation request in black box
  	blackbox.insert_op(Op_Read_Attr_history_2);
  
  	final Vector poll_list = get_poll_obj_list();
  	final int nb_poll = poll_list.size();
  
  	// Check that the device supports this attribute.
  	// This method returns an exception in case of unsupported attribute
  	final Attribute att = dev_attr.get_attr_by_name(name);
  	final String attr_str = name.toLowerCase();
  
  	// Check that the wanted attribute is polled.
  	PollObj polled_attr = null;
  	for (int i = 0; i < nb_poll; i++) {
  	    final PollObj poll_obj = (PollObj) poll_list.elementAt(i);
  	    if (poll_obj.get_type() == Tango_POLL_ATTR && poll_obj.get_name().equals(attr_str)) {
  		polled_attr = poll_obj;
  		break;
  	    }
  	}
  
  	if (polled_attr == null) {
  	    Except.throw_exception("API_AttrNotPolled", "No data available in cache for attribute "
  		    + attr_str, "Device_2Impl.read_attribute_history_2");
  	}
  
  	// Check that some data is available in cache
  	assert polled_attr != null;
  	if (polled_attr.is_ring_empty()) {
  	    Except.throw_exception("API_NoDataYet", "No data available in cache for attribute "
  		    + attr_str, "Device_2Impl.read_attribute_history_2");
  	}
  
  	// Set the number of returned records
  	final int in_buf = polled_attr.get_elt_nb_in_buffer();
  	if (n > in_buf) {
  	    n = in_buf;
  	}
  
  	// return attribute value history
  	return polled_attr.get_attr_history(n, att.get_data_type());
      }
docs: --------------------------------------------------------------------------