protected IMessageDispatcher buildDispatcher(
     MessagingContext context, IHandlerInvocation invocation) {
   IMessageDispatcher dispatcher = new MessageDispatcher(context, invocation);
   if (context.getHandlerMetadata().isEnveloped()) {
     dispatcher = new EnvelopedMessageDispatcher(dispatcher);
   }
   if (context.getHandlerMetadata().isFiltered()) {
     dispatcher = new FilteredMessageDispatcher(dispatcher);
   }
   return dispatcher;
 }
 protected IHandlerInvocation buildInvocationForHandler(MessagingContext context) {
   IHandlerInvocation invocation = new ReflectiveHandlerInvocation(context);
   if (context.getHandlerMetadata().isAsynchronous()) {
     invocation = new AsynchronousHandlerInvocation(invocation);
   }
   return invocation;
 }