Package org.drools.guvnor.client.rpc

Examples of org.drools.guvnor.client.rpc.PushResponse


    /**
     * Pushes a message back to (all) clients.
     */
    private void push(String messageType,
                      String message) {
        Backchannel.getInstance().publish( new PushResponse( messageType,
                                                             message ) );
    }
View Full Code Here


        return discussion;
    }

    private void push(String messageType,
                      String message) {
        Backchannel.getInstance().publish( new PushResponse( messageType,
                                                             message ) );
    }
View Full Code Here

        return repositoryAssetOperations.getAssetCount(request);
    }

    private void push(String messageType,
                      String message) {
        backchannel.publish(new PushResponse(messageType,
                message));
    }
View Full Code Here

        return iterator;
    }

    private void push(String messageType,
            String message) {
        backchannel.publish(new PushResponse(messageType,
                message));
    }
View Full Code Here

    /**
     * Pushes a message back to (all) clients.
     */
    private void push(String messageType,
                      String message) {
        backchannel.publish( new PushResponse( messageType,
                                                             message ) );
    }
View Full Code Here

        t.start();
        t2.start();

        Thread.sleep( 200 );

        backchannel.publish( new PushResponse( "hey",
                                               "ho" ) );

        //t.join();
        //t2.join();
View Full Code Here

    public void testSimple() throws Exception {

        final Backchannel backchannel = Backchannel.getInstance();

        backchannel.push( "mici",
                          new PushResponse( "m",
                                            "b" ) );
        backchannel.push( "davos",
                          new PushResponse( "d",
                                            "b" ) );
        List<PushResponse> r = backchannel.await( "mici" );
        assertEquals( 1,
                      r.size() );
        assertEquals( "m",
                      r.get( 0 ).messageType );
        r = backchannel.await( "davos" );
        assertEquals( 1,
                      r.size() );
        assertEquals( "d",
                      r.get( 0 ).messageType );

        final boolean[] check = new boolean[1];

        Thread t = new Thread( new Runnable() {
            public void run() {
                try {
                    @SuppressWarnings("unused")
                    List<PushResponse> list = backchannel.await( "mici" );
                    /*
                    for (PushResponse resp: list) {
                                       System.err.println(resp.messageType + "," + resp.message);
                    }
                    */
                    check[0] = true;
                } catch ( InterruptedException e ) {
                    fail( "Should not interrupt" );
                }
            }
        } );

        t.setDaemon( true );
        t.start();

        Thread.sleep( 400 );

        assertFalse( check[0] );
        backchannel.push( "davos",
                          new PushResponse( "x",
                                            "y" ) );
        //bc.push("mic", new PushResponse("Q", "W"));
        t.join();

        check[0] = false;
        backchannel.push( "mici",
                          new PushResponse( "R",
                                            "T" ) );
        backchannel.push( "mici",
                          new PushResponse( "Q",
                                            "A" ) );

        final List<List<PushResponse>> container = new ArrayList<List<PushResponse>>();

        t = new Thread( new Runnable() {
View Full Code Here

        for ( int i = 0; i < 1000; i++ ) {
            spinup( backchannel,
                    i );
        }
        backchannel.push( "mc",
                          new PushResponse( "yo",
                                            "yo" ) );
        backchannel.push( "mc",
                          new PushResponse( "yo",
                                            "yo" ) );

        //for (int i=0; i< 1000; i++) {
        List<PushResponse> res = backchannel.await( "mc" );
        assertEquals( 2,
                      res.size() );

        res = backchannel.await( "mc" );
        assertEquals( 0,
                      res.size() );
        //assertNull(res); //as other concurrent things will be unlatching...

        Thread.sleep( 20 );

        for ( int i = 0; i < 20000; i++ ) {
            backchannel.push( "mc",
                              new PushResponse( "yo",
                                                "yo" ) );
            backchannel.push( "mc",
                              new PushResponse( "yo",
                                                "yo" ) );

            res = backchannel.await( "mc" );
            assertEquals( 2,
                          res.size() );
View Full Code Here

                    Thread.sleep( i / 2 );
                } catch ( InterruptedException e ) {
                    fail( "should not interrupt" );
                }
                bc.push( i + "user",
                         new PushResponse( i + "type",
                                           "message" ) );
            }
        } );

        t.setDaemon( true );
View Full Code Here

        t2.start();


        Thread.sleep(200);

        bc.publish(new PushResponse("hey", "ho"));

        //t.join();
        //t2.join();

        Thread.sleep(500);
View Full Code Here

TOP

Related Classes of org.drools.guvnor.client.rpc.PushResponse

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.