indexing description: "Base type of all messages that are exchanged." author: "Patrick Ruckstuhl " date: "$Date$" revision: "$Revision$" class MESSAGE inherit WRAPPER_BASE create make feature -- Queries get_ems_message_id: STRING is -- Return the message id of the message. do Result := cpp_get_ems_message_id (item) end get_ems_correlation_id: STRING is -- Return the correlation id of the message. do Result := cpp_get_ems_correlation_id (item) end get_ems_reply_to: DESTINATION is -- Return the reply destination. local l_dest: POINTER do l_dest := cpp_get_ems_reply_to (item) if l_dest /= l_dest.default then create Result.make (l_dest) end end get_string_property (a_name: STRING): STRING is -- Return a string property. local l_name: C_STRING do create l_name.make (a_name) Result := cpp_get_string_property (item, l_name.item) end get_natural_64_property (a_name: STRING): NATURAL_64 is -- Return a string property. local l_name: C_STRING do create l_name.make (a_name) Result := cpp_get_long_property (item, l_name.item) end feature -- Update set_ems_correlation_id (a_id: STRING) is -- Set the correlation id of the message. local l_id: C_STRING do create l_id.make (a_id) cpp_set_ems_correlation_id (item, l_id.item) end set_ems_reply_to (a_destination: DESTINATION) is -- Set the reply destination. do cpp_set_ems_reply_to (item, a_destination.item) end set_string_property (a_name: STRING; a_value: STRING) is -- Set the string property with a_name and a_value. local l_name, l_value: C_STRING do create l_name.make (a_name) create l_value.make (a_value) cpp_set_string_property (item, l_name.item, l_value.item) end set_natural_64_property (a_name: STRING; a_value: NATURAL_64) is -- Set the natural 64 property with a_name and a_value. local l_name: C_STRING do create l_name.make (a_name) cpp_set_long_property (item, l_name.item, a_value) end feature -- Actions acknowledge is -- Acknowledge the message. do cpp_acknowledge (item) end feature {NONE} -- C++ methods cpp_delete (a_object: POINTER) is -- Delete cpp object. external "C++ inline use " alias "[ delete (cms::Message*)$a_object; ]" end cpp_get_ems_message_id (a_object: POINTER): STRING is -- Get message id. external "C++ inline use " alias "[ try{ std::string str = ((cms::Message*)$a_object)->getCMSMessageID(); char* c_str = (char*)(str.c_str()); return RTMS(c_str); }catch(cms::CMSException& e){ eraise((char*)(e.getStackTraceString().c_str()), EN_PROG); } ]" end cpp_get_ems_correlation_id (a_object: POINTER): STRING is -- Get correlation id. external "C++ inline use " alias "[ try{ std::string str = ((cms::Message*)$a_object)->getCMSCorrelationID(); char* c_str = (char*)(str.c_str()); return RTMS(c_str); }catch(cms::CMSException& e){ eraise((char*)(e.getStackTraceString().c_str()), EN_PROG); } ]" end cpp_set_ems_correlation_id (a_object: POINTER; a_string: POINTER) is -- Set the correlation id. external "C++ inline use " alias "[ try{ ((cms::Message*)$a_object)->setCMSCorrelationID((char*)$a_string); }catch(cms::CMSException& e){ eraise((char*)(e.getStackTraceString().c_str()), EN_PROG); } ]" end cpp_get_ems_reply_to (a_object: POINTER): POINTER is -- Get reply destination id. external "C++ inline use " alias "[ try{ cms::Destination* dest = (cms::Destination*)(((cms::Message*)$a_object)->getCMSReplyTo()); if( dest != NULL ){ return dest->clone(); } else { return NULL; } }catch(cms::CMSException& e){ eraise((char*)(e.getStackTraceString().c_str()), EN_PROG); } ]" end cpp_set_ems_reply_to (a_object: POINTER; a_destination: POINTER) is -- Set the reply destination id. external "C++ inline use " alias "[ try{ ((cms::Message*)$a_object)->setCMSReplyTo((cms::Destination*)$a_destination); }catch(cms::CMSException& e){ eraise((char*)(e.getStackTraceString().c_str()), EN_PROG); } ]" end cpp_get_string_property (a_object: POINTER; a_name: POINTER): STRING is -- Get a string property. external "C++ inline use " alias "[ try{ std::string str = ((cms::Message*)$a_object)->getStringProperty((char*)$a_name); char* c_str = (char*)(str.c_str()); return RTMS(c_str); }catch(cms::CMSException& e){ eraise((char*)(e.getStackTraceString().c_str()), EN_PROG); } ]" end cpp_set_string_property (a_object: POINTER; a_name: POINTER; a_value: POINTER) is -- Set a string property. external "C++ inline use " alias "[ try{ (((cms::Message*)$a_object)->setStringProperty((char*)$a_name, (char*)$a_value)); }catch(cms::CMSException& e){ eraise((char*)(e.getStackTraceString().c_str()), EN_PROG); } ]" end cpp_get_long_property (a_object: POINTER; a_name: POINTER): NATURAL_64 is -- Get a string property. external "C++ inline use " alias "[ try{ return ((cms::Message*)$a_object)->getLongProperty((char*)$a_name); }catch(cms::CMSException& e){ eraise((char*)(e.getStackTraceString().c_str()), EN_PROG); } ]" end cpp_set_long_property (a_object: POINTER; a_name: POINTER; a_value: NATURAL_64) is -- Set a string property. external "C++ inline use " alias "[ try{ (((cms::Message*)$a_object)->setLongProperty((char*)$a_name, (long long)$a_value)); }catch(cms::CMSException& e){ eraise((char*)(e.getStackTraceString().c_str()), EN_PROG); } ]" end cpp_acknowledge (a_object: POINTER) is -- Acknowledge the message. external "C++ inline use " alias "[ try{ ((cms::Message*)$a_object)->acknowledge(); }catch(cms::CMSException& e){ eraise((char*)(e.getStackTraceString().c_str()), EN_PROG); } ]" end end