package com.tandbergtv.watchpoint.pmm.communication;

import com.tandbergtv.workflow.adaptor.conf.IDispatcherConfiguration;
import com.tandbergtv.workflow.adaptor.dispatcher.AbstractDispatcher;
import com.tandbergtv.workflow.adaptor.dispatcher.DispatcherException;
import com.tandbergtv.workflow.comm.IDestination;
import com.tandbergtv.workflow.core.service.ServiceRegistry;
import com.tandbergtv.workflow.message.IMessage;

/**
 * Dispatches requests to PMM.
 * 
 * @author Raj Prakash
 */
public class PMMDispatcher extends AbstractDispatcher {

	/**
	 * Constructor.
	 */
	public PMMDispatcher(IDispatcherConfiguration conf, IDestination destination) {
		super(conf, destination);
	}

	/* (non-Javadoc)
	 * @see com.tandbergtv.workflow.adaptor.dispatcher.IDispatcher#send(com.tandbergtv.workflow.message.IMessage)
	 */
	public IMessage send(IMessage msg) throws DispatcherException {
		return ServiceRegistry.getDefault().lookup(PMMMessageService.class).receive(msg);
	}

}
