groupdefiner

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
groupdefiner [2014/08/28 15:07]
rafael [Usage]
groupdefiner [2017/07/21 03:08] (current)
Line 60: Line 60:
 </file> </file>
  
 +Implementado o GroupSelector, é simples utilizar o GroupDefiner. Basta apenas instanciar o GroupDefiner informando a implementação do GroupSelector. Uma vez instanciado, o GroupDefiner se comunica com o Gateway para informar quando um MN entra ou sai de um grupo. Um HelloWorld é mostrado abaixo.
  
 +<file java GroupDefinerMock.java>
 +public class GroupDefinerMock {
 +
 +  /**
 +   * @param args
 +   */
 +  public static void main(final String[] args) {
 +    new GroupDefiner(new GroupSelectorMock());
 +  }
 +
 +}
 +</file>
 +
 +A classe GroupSelectorMock é como segue:
 +
 +<file java GroupSelectorMock.java>
 +public class GroupSelectorMock implements GroupSelector {
 +
 +  @Override
 +  public int getGroupType() {
 +    return 10;
 +  }
 +
 +  @Override
 +  public Set<Integer> processGroups(final Message nodeMessage) {
 +    System.out.println(nodeMessage.toString());
 +
 +    return new TreeSet<Integer>();
 +  }
 +
 +}
 +</file>
 ===== Architecture ===== ===== Architecture =====
 The GroupDefiner internally consists of a generic message processing part, and an application-specific part, the //Group selection module//. The generic part is responsible for reading any application message disseminated in the DDS domain, recording the current groups associated with the message and handing the message's application object to the Group Selection module. This module will execute an application-specific group mapping algorithm in order to determine all the  context-defined group(s) that the message sender is in, according to the received object's type and attributes. e.g. if a data value is inside a certain interval or within a 2D region. This list of detected groups  is then handed back to the generic processing part of GroupDefiner, which will calculate the G-diff message and write it to the GroupAdvertisement topic in the DDS domain The GroupDefiner internally consists of a generic message processing part, and an application-specific part, the //Group selection module//. The generic part is responsible for reading any application message disseminated in the DDS domain, recording the current groups associated with the message and handing the message's application object to the Group Selection module. This module will execute an application-specific group mapping algorithm in order to determine all the  context-defined group(s) that the message sender is in, according to the received object's type and attributes. e.g. if a data value is inside a certain interval or within a 2D region. This list of detected groups  is then handed back to the generic processing part of GroupDefiner, which will calculate the G-diff message and write it to the GroupAdvertisement topic in the DDS domain
  • groupdefiner.1409249220.txt.gz
  • Last modified: 2017/07/21 02:50
  • (external edit)