// the background service is used here merely as a means to capture an invocation memento
final BackgroundService backgroundService = getServicesInjector().lookupService(BackgroundService.class);
if(backgroundService != null) {
final Object targetObject = unwrap(targetAdapter);
final Object[] args = CommandUtil.objectsFor(arguments);
ActionInvocationMemento aim = backgroundService.asActionInvocationMemento(method, targetObject, args);
if(aim != null) {
command.setMemento(aim.asMementoString());
} else {
throw new IsisException(
"Unable to build memento for action " +
owningAction.getIdentifier().toClassAndNameIdentityString());
}