You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by GitBox <gi...@apache.org> on 2019/06/21 06:58:40 UTC

[GitHub] [tomee] marcoantoniobferreira commented on a change in pull request #491: TOMEE-2543 - Translate to Portuguese: examples/cdi-events .

marcoantoniobferreira commented on a change in pull request #491: TOMEE-2543 - Translate to Portuguese: examples/cdi-events .
URL: https://github.com/apache/tomee/pull/491#discussion_r296116280
 
 

 ##########
 File path: examples/cdi-events/README_pt.adoc
 ##########
 @@ -0,0 +1,33 @@
+= CDI Events - Loose Coupling and Extensibility
+:index-group: CDI
+:jbake-type: page
+:jbake-status: published
+
+O CDI permite estender o código de negócios pelo padrão Notificador / Observador.
+
+Para fazer isso, basta injetar um campo `Event` na classe notifier. Essa classe é um modelo e o tipo de parâmetro é o tipo de objeto a ser disparado. Então, quando você quiser notificar observadores, você simplesmente chamará o método fire do objeto de evento passando como parâmetro o próprio evento.
+(sua própria classe!)
+
+On the other side you annotated a method parameter `@Observes` and the parameter type is the sent type
+by the notifier.
+
+NOTE: Você pode adicionar qualificadores para ser mais preciso em seus eventos.
+
+== Exemplo
+
+O exemplo é bem simples: um ejb usa a anotação `@ Schedule` para receber uma notificação a cada segundo.
+A cada secondo este EJB enviará a data atual por meio de eventos do CDI.
 
 Review comment:
   at this point, I believe that the right would be "segundo" rather than "secondo"

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services