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

Details

    • Sub-task
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 2.12.1.Final
    • 3.x Future
    • Java EE
    • None

    Description

      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);
         }
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              agoncal agoncal
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: