final int[] count2 = new int[]{0};
final int[] catchAllCount = new int[]{0};
DefaultOutboundRouterCollection messageRouter = new DefaultOutboundRouterCollection();
FilteringOutboundRouter filterRouter1 = new FilteringOutboundRouter()
{
@Override
public MuleEvent route(MuleEvent event)
{
count1[0]++;
return event;
}
};
FilteringOutboundRouter filterRouter2 = new FilteringOutboundRouter()
{
@Override
public MuleEvent route(MuleEvent event)
{
count2[0]++;
return event;
}
};
filterRouter1.setFilter(new PayloadTypeFilter(Exception.class));
filterRouter2.setFilter(new PayloadTypeFilter(StringBuilder.class));
messageRouter.addRoute(filterRouter1);
messageRouter.addRoute(filterRouter2);
AbstractCatchAllStrategy strategy = new AbstractCatchAllStrategy()
{