Package org.apache.isis.objectstore.jdo.applib.service.command

Examples of org.apache.isis.objectstore.jdo.applib.service.command.CommandJdo


    public List<CommandJdo> siblingCommands(final CommandJdo siblingCommand) {
        final Command parent = siblingCommand.getParent();
        if(parent == null || !(parent instanceof CommandJdo)) {
            return Collections.emptyList();
        }
        final CommandJdo parentJdo = (CommandJdo) parent;
        final List<CommandJdo> siblingCommands = backgroundCommandRepository.findByParent(parentJdo);
        siblingCommands.remove(siblingCommand);
        return siblingCommands;
    }
View Full Code Here


public class CommandJdoTest_next {

    @Test
    public void test() {
        CommandJdo raj = new CommandJdo();
        assertThat(raj.next("foo"), is(0));
        assertThat(raj.next("foo"), is(1));
        assertThat(raj.next("bar"), is(0));
        assertThat(raj.next("bar"), is(1));
        assertThat(raj.next("foo"), is(2));
        assertThat(raj.next("bar"), is(2));
        assertThat(raj.next("bar"), is(3));
    }
View Full Code Here

            final String targetArgs) {
       
        final UUID transactionId = UUID.randomUUID();
        final String user = parentCommand.getUser();

        final CommandJdo backgroundCommand = newTransientInstance(CommandJdo.class);

        backgroundCommand.setParent(parentCommand);
       
        backgroundCommand.setTransactionId(transactionId);

        backgroundCommand.setUser(user);
        backgroundCommand.setTimestamp(Clock.getTimeAsJavaSqlTimestamp());

        backgroundCommand.setExecuteIn(ExecuteIn.BACKGROUND);

        backgroundCommand.setTargetClass(targetClassName);
        backgroundCommand.setTargetAction(targetActionName);
        backgroundCommand.setTargetStr(aim.getTarget().toString());
        backgroundCommand.setMemberIdentifier(aim.getActionId());

        backgroundCommand.setArguments(targetArgs);
        backgroundCommand.setMemento(aim.asMementoString());
       
        parentCommand.setPersistHint(true);
       
        persist(backgroundCommand);
    }
View Full Code Here

            final String targetArgs) {
       
        final UUID transactionId = UUID.randomUUID();
        final String user = parentCommand.getUser();

        final CommandJdo backgroundCommand = newTransientInstance(CommandJdo.class);

        backgroundCommand.setParent(parentCommand);
       
        backgroundCommand.setTransactionId(transactionId);

        backgroundCommand.setUser(user);
        backgroundCommand.setTimestamp(Clock.getTimeAsJavaSqlTimestamp());

        backgroundCommand.setExecuteIn(ExecuteIn.BACKGROUND);

        backgroundCommand.setTargetClass(targetClassName);
        backgroundCommand.setTargetAction(targetActionName);
        backgroundCommand.setTargetStr(aim.getTarget().toString());
        backgroundCommand.setMemberIdentifier(aim.getActionId());

        backgroundCommand.setArguments(targetArgs);
        backgroundCommand.setMemento(aim.asMementoString());
       
        parentCommand.setPersistHint(true);
       
        persist(backgroundCommand);
    }
View Full Code Here

    public List<CommandJdo> siblingCommands(final CommandJdo siblingCommand) {
        final Command parent = siblingCommand.getParent();
        if(parent == null || !(parent instanceof CommandJdo)) {
            return Collections.emptyList();
        }
        final CommandJdo parentJdo = (CommandJdo) parent;
        final List<CommandJdo> siblingCommands = backgroundCommandRepository.findByParent(parentJdo);
        siblingCommands.remove(siblingCommand);
        return siblingCommands;
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.objectstore.jdo.applib.service.command.CommandJdo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.