loader.addSingletonFixup(component);
msg.setReceiver(component);
component.setMetadata(loader.getMetadata());
component.addPrimitivePropertyInitializer("channel", channel);
final PrimitivePropertyInitializer dispatcherInitializer = component.addPrimitivePropertyInitializer("dispatcherComponent", null);
loader.addComponentFixup(new XMLMetadataHelper.ContextFixup(loader.getHelper())
{
public void fixup()
{
// Use findComponent, as "System.ObjectQueueDispatcher" does not exist if core repository is not used.
// The component instance can't be recovered at this point, because the metadata may not be sufficiently loaded
// for the initializer to succeed.
dispatcherInitializer.setValue(loader.getMetadata().findComponent("System.ObjectQueueDispatcher"));
}
});
}
}