Package org.drools.grid

Examples of org.drools.grid.GridNode


        grid2 = new GridImpl("peer2", new HashMap<String, Object>() );
        configureGrid1( grid2,
                        -1,
                        wps );

        GridNode n1 = grid1.createGridNode( "n1" );
        grid1.get( SocketService.class ).addService( "n1", 8000, n1 );
              
        GridServiceDescription<GridNode> n1Gsd = grid2.get( WhitePages.class ).lookup( "n1" );
        GridConnection<GridNode> conn = grid2.get( ConnectionFactoryService.class ).createConnection( n1Gsd );
        remoteN1 = conn.connect();
View Full Code Here


            XStream xstream = this.strategy.lookup(name);
            if (xstream == null) {
                throw new IllegalArgumentException("Unable to lookup XStream parser using name '" + name + "'");
            }
            ExecutionNodePipelineContextImpl executionNodeContext = (ExecutionNodePipelineContextImpl) context;
            GridNode node = executionNodeContext.getGridNode();
           
            CommandExecutor executor = node.get(name, CommandExecutor.class);
            if (executor == null) {
                throw new IllegalArgumentException("Unable to lookup CommandExecutor using name '" + name + "'");
            }
            executionNodeContext.setCommandExecutor(executor);
            ClassLoader cl = null;
View Full Code Here

    public Set<Integer> getPorts() {
        return acceptors.keySet();
    }

    public <T> GridConnection<T> getConnection(GridServiceDescription<T> gsd) {
        GridNode gnode = grid.getGridNode( gsd.getId() );
        if ( gnode != null ) {
            LocalGridNodeConnection conn = new LocalGridNodeConnection( gnode );
        } else {
           
        }
View Full Code Here

        inXml += "  <fire-all-rules />";
        inXml += "</batch-execution>";

        GridImpl grid = new GridImpl( new HashMap() );
        grid.addService( WhitePages.class, new WhitePagesImpl() );
        GridNode node = grid.createGridNode( "local" );

        StatefulKnowledgeSession ksession = getExecutionNodeSessionStateful(node, ResourceFactory.newByteArrayResource( str.getBytes() ) );

        node.set("ksession1", ksession);

        XStreamResolverStrategy xstreamStrategy = new XStreamResolverStrategy() {
            public XStream lookup(String name) {
                return BatchExecutionHelper.newXStreamMarshaller();
            }
View Full Code Here

    public GridNode createGridNode(String id) {
//        WhitePages wp = get( WhitePages.class );
//        GridServiceDescription gsd = wp.create( id );
//        gsd.setServiceInterface( GridNode.class );
        GridNode node = new GridNodeImpl( id );
        this.localNodes.put( id, node );
        return node;
    }
View Full Code Here

    @Test
    public void testNoConnection() throws Exception {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("org/drools/container/spring/beans.xml");

        GridNode node1 = (GridNode) context.getBean( "node1" );
        assertNotNull( node1 );

        GridNode node2 = (GridNode) context.getBean( "node2" );
        assertNotNull( node2 );
    }
View Full Code Here

    @Test
    public void testNode() {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("org/drools/container/spring/beans.xml");

        GridNode node = (GridNode) context.getBean( "node1" );
        List<String> list = new ArrayList<String>();
        StatelessKieSession kstateless = node.get( "stateless1",
                                                   StatelessKieSession.class );
        assertNotNull( "can't obtain session named: stateless1",
                       kstateless );
        kstateless.setGlobal( "list",
                              list );
        kstateless.execute( new Person( "Darth",
                                        "Cheddar",
                                        50 ) );
        assertEquals( 2,
                      list.size() );

        list = new ArrayList<String>();
        KieSession kstateful = node.get( "ksession2",
                                         KieSession.class );
        kstateful.setGlobal( "list",
                             list );
        kstateful.insert( new Person( "Darth",
                                      "Cheddar",
View Full Code Here

        inXml += "]}}";
        inXml = roundTripFromXml( inXml );
       
        GridImpl grid = new GridImpl( new HashMap() );
        grid.addService( WhitePages.class, new WhitePagesImpl() );
        GridNode node = grid.createGridNode( "local" );
       
        StatefulKnowledgeSession ksession = getExecutionNodeSessionStateful(node, ResourceFactory.newByteArrayResource( str.getBytes() ) );

        node.set( "ksession1", ksession );

        XStreamResolverStrategy xstreamStrategy = new XStreamResolverStrategy() {
            public XStream lookup(String name) {
                return BatchExecutionHelper.newJSonMarshaller();
            }
View Full Code Here

        inXml += "  <fire-all-rules />";
        inXml += "</batch-execution>";

        GridImpl grid = new GridImpl( new HashMap() );
        grid.addService( WhitePages.class, new WhitePagesImpl() );
        GridNode node = grid.createGridNode( "local" );

        StatefulKnowledgeSession ksession = getExecutionNodeSessionStateful(node, ResourceFactory.newByteArrayResource( str.getBytes() ) );

        node.set("ksession1", ksession);

        XStreamResolverStrategy xstreamStrategy = new XStreamResolverStrategy() {
            public XStream lookup(String name) {
                return BatchExecutionHelper.newXStreamMarshaller();
            }
View Full Code Here

    public Set<Integer> getPorts() {
        return acceptors.keySet();
    }

    public <T> GridConnection<T> getConnection(GridServiceDescription<T> gsd) {
        GridNode gnode = grid.getGridNode( gsd.getId() );
        if ( gnode != null ) {
            LocalGridNodeConnection conn = new LocalGridNodeConnection( gnode );
        } else {
           
        }
View Full Code Here

TOP

Related Classes of org.drools.grid.GridNode

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.