Examples of GenericCommand


Examples of org.drools.command.impl.GenericCommand

        str += "end\n";
       
        Cheese stilton = new Cheese( "stilton", 5 );
       
        StatelessKnowledgeSession ksession = getSession2( ResourceFactory.newByteArrayResource( str.getBytes() ) );
        GenericCommand cmd = ( GenericCommand ) CommandFactory.newInsert( stilton, "outStilton" );
        BatchExecutionCommandImpl batch = new BatchExecutionCommandImplArrays.asList( new GenericCommand<?>[] { cmd } ) );
       
        ExecutionResults result = ( ExecutionResults ) ksession.execute( batch );
        stilton = ( Cheese ) result.getValue( "outStilton" );
        assertEquals( 30,
View Full Code Here

Examples of org.drools.command.impl.GenericCommand

        str += "end\n";
       
        Cheese stilton = new Cheese( "stilton", 5 );
       
        StatelessKnowledgeSession ksession = getSession2( ResourceFactory.newByteArrayResource( str.getBytes() ) );
        GenericCommand cmd = ( GenericCommand ) CommandFactory.newInsert( stilton, "outStilton" );
        BatchExecutionCommand batch = new BatchExecutionCommandArrays.asList( new GenericCommand<?>[] { cmd } ) );
       
        ExecutionResults result = ( ExecutionResults ) ksession.execute( batch );
        stilton = ( Cheese ) result.getValue( "outStilton" );
        assertEquals( 30,
View Full Code Here

Examples of org.drools.core.command.impl.GenericCommand

            while ( reader.hasMoreChildren() ) {
                reader.moveDown();
                if ( "commands".equals( reader.getNodeName() ) ) {
                    while ( reader.hasMoreChildren() ) {
                        reader.moveDown();
                        GenericCommand cmd = (GenericCommand) readItem( reader,
                                                                        context,
                                                                        null );
                        list.add( cmd );
                        reader.moveUp();
                    }
View Full Code Here

Examples of org.drools.core.command.impl.GenericCommand

            while ( reader.hasMoreChildren() ) {
                reader.moveDown();
                if ( "commands".equals( reader.getNodeName() ) ) {
                    while ( reader.hasMoreChildren() ) {
                        reader.moveDown();
                        GenericCommand cmd = (GenericCommand) readItem( reader,
                                                                        context,
                                                                        null );
                        list.add( cmd );
                        reader.moveUp();
                    }
View Full Code Here

Examples of org.drools.core.command.impl.GenericCommand

        str += "end\n";
       
        Cheese stilton = new Cheese( "stilton", 5 );
       
        StatelessKnowledgeSession ksession = getSession2( ResourceFactory.newByteArrayResource( str.getBytes() ) );
        GenericCommand cmd = ( GenericCommand ) CommandFactory.newInsert( stilton, "outStilton" );
        BatchExecutionCommandImpl batch = new BatchExecutionCommandImplArrays.asList( new GenericCommand<?>[] { cmd } ) );
       
        ExecutionResults result = ( ExecutionResults ) ksession.execute( batch );
        stilton = ( Cheese ) result.getValue( "outStilton" );
        assertEquals( 30,
View Full Code Here

Examples of org.drools.core.command.impl.GenericCommand

        str += "end\n";
       
        Cheese stilton = new Cheese( "stilton", 5 );
       
        StatelessKnowledgeSession ksession = getSession2( ResourceFactory.newByteArrayResource( str.getBytes() ) );
        GenericCommand cmd = ( GenericCommand ) CommandFactory.newInsert( stilton, "outStilton" );
        BatchExecutionCommandImpl batch = new BatchExecutionCommandImplArrays.asList( new GenericCommand<?>[] { cmd } ) );
       
        ExecutionResults result = ( ExecutionResults ) ksession.execute( batch );
        stilton = ( Cheese ) result.getValue( "outStilton" );
        assertEquals( 30,
View Full Code Here

Examples of org.rhq.enterprise.communications.command.impl.generic.GenericCommand

        assert agent1.isStarted() : "agent1 should have been started";
        assert agent2.isStarted() : "agent2 should have been started";

        String stream_data = "Stream this string...";
        InputStream in = new ByteArrayInputStream(stream_data.getBytes());
        GenericCommand test_command = new GenericCommand(SimpleTestStreamService.COMMAND_TYPE, null);
        CommandResponse results = null;
        Long stream_id = null;

        try {
            stream_id = agent1.getServiceContainer().addRemoteInputStream(in);
            test_command.setParameterValue(SimpleTestStreamService.INPUT_STREAM_PARAM, new RemoteInputStream(stream_id,
                agent1.getServiceContainer()));

            results = agent1.getClientCommandSender().sendSynch(test_command);
        } catch (Throwable t) {
            throw new Exception(t);
View Full Code Here

Examples of org.rhq.enterprise.communications.command.impl.generic.GenericCommand

        assert agent1.isStarted() : "agent1 should have been started";
        assert agent2.isStarted() : "agent2 should have been started";

        String stream_data = "Streaming this string should fail";
        InputStream in = new ByteArrayInputStream(stream_data.getBytes());
        GenericCommand test_command = new GenericCommand(SimpleTestStreamService.COMMAND_TYPE, null);
        CommandResponse results = null;

        try {
            test_command.setParameterValue(SimpleTestStreamService.INPUT_STREAM_PARAM, new RemoteInputStream(in, agent1
                .getServiceContainer()));
            Thread.sleep(5500L); // the timer only runs the task every 5 secs even though our timeout is 1 sec
            results = agent1.getClientCommandSender().sendSynch(test_command);
        } catch (Throwable t) {
            throw new Exception(t);
View Full Code Here

Examples of org.rhq.enterprise.communications.command.impl.generic.GenericCommand

        assert agent1.isStarted() : "agent1 should have been started";
        assert agent2.isStarted() : "agent2 should have been started";

        String stream_data = "Stream this string...";
        InputStream in = new ByteArrayInputStream(stream_data.getBytes());
        GenericCommand test_command = new GenericCommand(SimpleTestStreamService.COMMAND_TYPE, null);
        CommandResponse results = null;
        Long stream_id = null;

        try {
            stream_id = agent1.getServiceContainer().addRemoteInputStream(in);
            test_command.setParameterValue(SimpleTestStreamService.INPUT_STREAM_PARAM, new RemoteInputStream(stream_id,
                agent1.getServiceContainer()));

            results = agent1.getClientCommandSender().sendSynch(test_command);
        } catch (Throwable t) {
            throw new Exception(t);
View Full Code Here

Examples of org.rhq.enterprise.communications.command.impl.generic.GenericCommand

        assert agent1.isStarted() : "agent1 should have been started";
        assert agent2.isStarted() : "agent2 should have been started";

        InputStream in = new ByteArrayInputStream(LARGE_STRING_BYTES);
        GenericCommand test_command = new GenericCommand(SimpleTestStreamService.COMMAND_TYPE, null);
        CommandResponse results = null;
        Long stream_id = null;

        try {
            test_command.setParameterValue(SimpleTestStreamService.INPUT_STREAM_PARAM, new RemoteInputStream(in, agent1
                .getServiceContainer()));

            results = agent1.getClientCommandSender().sendSynch(test_command);
        } catch (Throwable t) {
            throw new Exception(ThrowableUtil.getAllMessages(t), t);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.