use of org.omg.CosNotification.StructuredEvent in project ACS by ACS-Community.
the class StructuredEventCreator method createEvent.
public StructuredEvent createEvent(IDLEntity customStruct) throws AcsJException {
// The Java class name without package becomes the name of the "event type".
String typeName = customStruct.getClass().getName().substring(customStruct.getClass().getName().lastIndexOf('.') + 1);
// event to send
StructuredEvent event = getCORBAEvent(typeName, "");
// Store the info for Exec/I&T into the event.
// create the any
event.remainder_of_body = m_services.getAdvancedContainerServices().getAny();
// get the useful data which includes the component's name, timestamp, and event count (=1 here)
EventDescription descrip = new EventDescription(m_services.getName(), alma.acs.util.UTCUtility.utcJavaToOmg(System.currentTimeMillis()), 1);
// store the IDL struct into the structured event
EventDescriptionHelper.insert(event.remainder_of_body, descrip);
// preallocate one name/value pair
event.filterable_data = new Property[1];
event.filterable_data[0] = new Property(alma.acscommon.DEFAULTDATANAME.value, m_anyAide.complexObjectToCorbaAny(customStruct));
return event;
}
Aggregations