Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-1926 Adding more commands to Forge and improve existing ones
  3. FORGE-2081

Being able to add a new CDI event producer to an existing class

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Unresolved
    • Icon: Major Major
    • 3.x Future
    • 2.12.1.Final
    • Java EE
    • None

      It would be useful to have a command to add a new CDI event producer to an existing class. A command such as :

      cdi-add-event-producer --named firePurchaseOrder --type PurchaseOrder
      

      Would add to an existing class the following code :

         @Inject
         private Event<PurchaseOrder> eventPurchaseOrder;
      
         public void firePurchaseOrder()
         {	  
            PurchaseOrder purchaseOrder = new PurchaseOrder();	  
            event.fire(order);
         }
      

      Adding qualifiers :

      cdi-add-event-producer --named firePurchaseOrder --type PurchaseOrder --qualifiers MyQualif MySecondQualif
      
         @Inject @MyQualif @MySecondQualif
         private Event<PurchaseOrder> eventPurchaseOrder;
      
         public void firePurchaseOrder()
         {	  
            PurchaseOrder purchaseOrder = new PurchaseOrder();	  
            event.fire(order);
         }
      

              Unassigned Unassigned
              agoncal Antonio Goncalves (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: