Package org.drools.grid.conf.impl

Examples of org.drools.grid.conf.impl.GridPeerConfiguration


        SystemEventListener l = SystemEventListenerFactory.getSystemEventListener();

        GridImpl grid1 = new GridImpl( 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(), 5012 );

        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" );
View Full Code Here


        if ( this.coreServices == null ) {
            this.coreServices = new HashMap();
        }

        GridPeerConfiguration conf = new GridPeerConfiguration();
        GridPeerServiceConfiguration coreSeviceLookupConf = new CoreServicesLookupConfiguration( this.coreServices );
        conf.addConfiguration( coreSeviceLookupConf );

        //Configuring the WhitePages
        if ( this.whitePages != null ) {
            WhitePagesLocalConfiguration wplConf = new WhitePagesLocalConfiguration();
            wplConf.setWhitePages( this.whitePages );
            conf.addConfiguration( wplConf );
        }

        conf.configure( this.grid );

        // We do this after the main grid configuration, to make sure all services are instantiated
        if ( this.socketServiceConfiguration != null ) {
            AcceptorFactoryService acc = null;
            if ( "mina".equals( this.socketServiceConfiguration.getAcceptor() ) ) {
View Full Code Here

TOP

Related Classes of org.drools.grid.conf.impl.GridPeerConfiguration

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.