Package org.drools.grid.impl

Examples of org.drools.grid.impl.GridImpl


    }

    //
    public void afterPropertiesSet() throws Exception {
        if ( grid == null ) {
            this.grid = new GridImpl( new HashMap<String, Object>() );
            ((GridImpl) this.grid).addService( WhitePages.class,
                                               new WhitePagesImpl() );
        }
        this.node = this.grid.createGridNode( id );
View Full Code Here


    public boolean isSingleton() {
        return true;
    }

    public void afterPropertiesSet() throws Exception {
        this.grid = new GridImpl( new HashMap() );
        MultiplexSocketServiceCongifuration socketConf = null;

        if ( this.coreServices == null ) {
            this.coreServices = new HashMap();
        }
View Full Code Here

    protected CommandExecutor exec2;

    protected Context createJndiContext() throws Exception {
        Context context = super.createJndiContext();

        GridImpl grid = new GridImpl( new HashMap() );
        grid.addService( WhitePages.class,
                         new WhitePagesImpl() );
        node = grid.createGridNode( "local" );
       
        node.set( "ksession1",
                  this.exec );
       
      
View Full Code Here

                                         5012 ),
                  accHandler,
                  l );


        ConversationManager cm = new ConversationManagerImpl( new GridImpl(),
                                                              l );

        Conversation cv = cm.startConversation( "s1",
                                                new InetSocketAddress( "127.0.0.1",
                                                                       5012 ),
View Full Code Here

                               KnowledgeBase.class ) );
    }

    @Test
    public void testNodeCreationAndWhitePagesRegistration() {
        Grid grid = new GridImpl( new HashMap<String, Object>() );

        GridPeerConfiguration conf = new GridPeerConfiguration();

        //Configuring the WhitePages
        GridPeerServiceConfiguration wplConf = new WhitePagesLocalConfiguration();
        conf.addConfiguration( wplConf );

        conf.configure( grid );

        GridNode gnode = grid.createGridNode( "test1@local" );

        WhitePages pages = grid.get( WhitePages.class );
        GridServiceDescription<GridNode> gsd = pages.create( "test1@local" );
       
        GridServiceDescription<GridNode> serviceDescription = pages.lookup( "test1@local" );

        GridConnection connection = grid.get( ConnectionFactoryService.class ).createConnection( gsd );
        assertSame( gnode,
                    connection.connect() );
    }
View Full Code Here

        remoteN1.dispose();
        grid1.get(SocketService.class).close();
    }
   
    private void createRemoteNode(){
        grid1 = new GridImpl( new HashMap<String, Object>() );
        configureGrid1( grid1,
                        8000,
                        null );

        Grid grid2 = new GridImpl( new HashMap<String, Object>() );
        configureGrid1( grid2,
                        -1,
                        grid1.get( WhitePages.class ) );

        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

    protected CommandExecutor exec2;

    protected Context createJndiContext() throws Exception {
        Context context = super.createJndiContext();

        GridImpl grid = new GridImpl( new HashMap() );
        node = grid.createGridNode( "local" );
       
        node.set( "ksession1",
                  this.exec );
       
      
View Full Code Here

    }

    protected Context createJndiContext() throws Exception {
        Context context = super.createJndiContext();

        GridImpl grid = new GridImpl( new HashMap() );
        node = grid.createGridNode( "node" );
        node.set( "ksession1",
                  this.exec );
        context.bind( "node",
                      node );
        return context;
View Full Code Here

                               KnowledgeBase.class ) );
    }

    @Test
    public void testNodeCreationAndWhitePagesRegistration() {
        Grid grid = new GridImpl( new HashMap<String, Object>() );

        GridPeerConfiguration conf = new GridPeerConfiguration();

        //Configuring the WhitePages
        GridPeerServiceConfiguration wplConf = new WhitePagesLocalConfiguration();
        conf.addConfiguration( wplConf );

        conf.configure( grid );

        GridNode gnode = grid.createGridNode( "test1@local" );

        WhitePages pages = grid.get( WhitePages.class );
        GridServiceDescription<GridNode> gsd = pages.create( "test1@local");
       
        GridServiceDescription<GridNode> serviceDescription = pages.lookup( "test1@local" );

        GridConnection connection = grid.get( ConnectionFactoryService.class ).createConnection( gsd );
        assertSame( gnode,
                    connection.connect() );
    }
View Full Code Here

        Map<String, GridServiceDescription> coreServicesMap = new HashMap<String, GridServiceDescription>();//Hazelcast.newHazelcastInstance( null ).getMap( CoreServicesLookup.class.getName() );

        SystemEventListener l = SystemEventListenerFactory.getSystemEventListener();

        GridImpl grid1 = new GridImpl("peer", new ConcurrentHashMap<String, Object>() );

        GridPeerConfiguration conf = new GridPeerConfiguration();

        GridPeerServiceConfiguration coreSeviceConf = new CoreServicesLookupConfiguration( coreServicesMap );
        conf.addConfiguration( coreSeviceConf );

        MultiplexSocketServiceCongifuration socketConf = new MultiplexSocketServiceCongifuration( new MultiplexSocketServerImpl( "127.0.0.1",
                                                                                                                          new MinaAcceptorFactoryService(),
                                                                                                                          l,
                                                                                                                          grid1 ) );
        conf.addConfiguration( socketConf );

        WhitePagesLocalConfiguration wplConf = new WhitePagesLocalConfiguration();
        wplConf.setWhitePages( new JpaWhitePages( Persistence.createEntityManagerFactory( "org.drools.grid" ) ) );
        conf.addConfiguration( wplConf );

        socketConf.addService( WhitePages.class.getName(), wplConf.getWhitePages(), 8000 );

        conf.configure( grid1 );

        GridImpl grid2 = new GridImpl( new ConcurrentHashMap<String, Object>() );
        conf = new GridPeerConfiguration();

        //coreServicesMap = Hazelcast.newHazelcastInstance( null ).getMap( CoreServicesLookup.class.getName() );
        coreSeviceConf = new CoreServicesLookupConfiguration( coreServicesMap );
        conf.addConfiguration( coreSeviceConf );

        GridPeerServiceConfiguration wprConf = new WhitePagesRemoteConfiguration( );
        conf.addConfiguration( wprConf );

        conf.configure( grid2 );

        WhitePages wp = grid2.get( WhitePages.class );

        wp.create( "s1" );
        wp.create( "s2" );
        wp.create( "s3" );
View Full Code Here

TOP

Related Classes of org.drools.grid.impl.GridImpl

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.