*
* @param command An object representing a EclipseLink command
*/
public void propagateCommand(Object command) {
Command newCommand;
CommandPropagator propagator;
if (commandConverter != null) {
// Use the converter if we have one
Object[] args = { command };
logDebug("converting_to_toplink_command", args);
//for dms profiling
if (isCommandProcessorASession()) {
getCommandProcessor().processCommand(new ProfileMessageSentCommand());
}
newCommand = commandConverter.convertToEclipseLinkCommand(command);
} else if (command instanceof Command) {
// If converter is not set then maybe it just doesn't need converting
newCommand = (Command)command;
} else {
// We can't convert the thing - we may as well chuck it!
Object[] args = { command };
logWarning("missing_converter", args);
return;
}
// Set our service id on the command to indicate that it came from us
newCommand.setServiceId(getServiceId());
// Propagate the command (synchronously or asynchronously)
propagator = new CommandPropagator(this, newCommand);
if (shouldPropagateAsynchronously()) {
propagator.asynchronousPropagateCommand();
} else {
propagator.synchronousPropagateCommand();
}
}