[forge-dev] Firing ResourceEvents before CommandExecuted event?

Lincoln Baxter, III lincolnbaxter at gmail.com
Tue Jun 19 17:08:34 EDT 2012


That line is to ensure proper ClassLoading while running in a modular
environment.

Before I answer this, it might be better to ask why you want to fire
ResourceEvents before CommandExecuted event. I think I agree with the
change to fire CommandExecuted after, but I just want to know to be sure.

I think that introducing a second event might be useful if what you are
trying to do is capture all changed resources:

EnteredWaitState to notify when the shell is again waiting for user input.
There may be an event like this already. Also, is it possible to do what
you need without the resource events entirely? Just a thought. Doesn't GIT
already tell you which files have changed somehow?

~Lincoln

On Tue, Jun 19, 2012 at 3:48 PM, Jevgeni Zelenkov <
jevgeni.zelenkov at googlemail.com> wrote:

> Hi guys,
>
> I am having an issue with Events in Forge. I would like to get a list
> of Resources modified by a forge command, after a forge command has
> been executed.
>
> Fortunately, forge fires events when command execution completes
> (either successfully, or unsuccessfully) and when resources are
> created/modified/deteled/etc. Sadly, it fires CommandExecuted event
> before any of ResourceEvents. (EventBusInvoker listens to
> CommandExecuted event and fires all ResourceEvents queued in the
> EventBus).
>
> I expect ResourceEvents to be fired before the CommandExecuted event
> (which would correspond to what actually happends). I tried commenting
> out code inside of EventBusInvoker's fire method and adding
> "bus.fireAll();" into Execution class (right before firing
> CommandExecuted event) but that doesn't seem to work.
>
> How could I fire ResourceEvents before CommandExecuted event? Or is
> there another way to get a list of modified resources during forge
> command exection?
>
> What does this line do? Is forge multi-threaded?
> "Thread.currentThread().setContextClassLoader(current);"
>
> Jevgeni
> _______________________________________________
> forge-dev mailing list
> forge-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/forge-dev
>



-- 
Lincoln Baxter, III
http://ocpsoft.org
"Simpler is better."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/forge-dev/attachments/20120619/5dc2c24d/attachment.html 


More information about the forge-dev mailing list