Skip to content

Commit

Permalink
FORGE-2319: Internal refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Jun 17, 2015
1 parent 082a390 commit f00d4e4
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import org.jboss.forge.addon.facets.constraints.FacetConstraint;
import org.jboss.forge.addon.facets.constraints.FacetInspector;
import org.jboss.forge.addon.facets.events.FacetInstalled;
import org.jboss.forge.addon.facets.events.FacetEvent;
import org.jboss.forge.addon.facets.events.FacetInstalledImpl;
import org.jboss.forge.furnace.Furnace;
import org.jboss.forge.furnace.addons.AddonRegistry;
Expand Down Expand Up @@ -215,7 +215,8 @@ else if (FacetInspector.isConstraintSatisfied(faceted, requiredFacets) && filter
try
{
result = ((MutableFaceted<FACETTYPE>) faceted).install(facet);
fireFacetInstalled(facet);
// Firing Facet installed event
fireFacetEvent(new FacetInstalledImpl(facet));
}
catch (Exception e)
{
Expand Down Expand Up @@ -266,18 +267,17 @@ public FacetListener removeListener()
};
}

private <FACET extends Facet<?>> void fireFacetInstalled(FACET facet)
private void fireFacetEvent(FacetEvent event)
{
FacetInstalled event = new FacetInstalledImpl(facet);
for (FacetListener listener : getFacetListeners())
{
try
{
listener.processEvent(event);
}
catch (Exception e)
catch (Throwable e)
{
log.log(Level.WARNING, "Error while firing FacetInstalledEvent", e);
log.log(Level.WARNING, "Error while firing " + event, e);
}
}
// Fire event using Furnace's event architecture
Expand Down

0 comments on commit f00d4e4

Please sign in to comment.