Package org.drools.grid.io.impl

Examples of org.drools.grid.io.impl.CommandImpl


        this.whitePages = whitePages;
    }

    public void messageReceived(Conversation conversation,
                                Message msg) {
        final CommandImpl cmd = (CommandImpl) msg.getBody();
        this.execs.get( cmd.getName() ).execute( whitePages,
                                                 conversation,
                                                 msg,
                                                 cmd );
    }
View Full Code Here


    public void addKnowledgePackages(Collection<KnowledgePackage> kpackages) {
        String kuilderInstanceId = ((CollectionClient<KnowledgePackage>) kpackages).getParentInstanceId();
        String kresultsId = "kresults_" + this.cm.toString();
        String localId = UUID.randomUUID().toString();

        CommandImpl cmd = new CommandImpl( "execute",
                                           Arrays.asList( new Object[]{new KnowledgeContextResolveFromContextCommand( new KnowledgeBaseAddKnowledgePackagesCommand(),
                                                                                                                       kuilderInstanceId,
                                                                                                                       this.instanceId,
                                                                                                                       null,
                                                                                                                       kresultsId )} ) );
View Full Code Here

    public StatefulKnowledgeSession newStatefulKnowledgeSession(KnowledgeSessionConfiguration conf,
                                                                Environment environment) {
        String kresultsId = "kresults_" + this.cm.toString();
        String localId = UUID.randomUUID().toString();
       
        CommandImpl registerKAgentCmd = new CommandImpl( "execute",
                                           Arrays.asList( new Object[]{new SetVariableCommandFromCommand( "__TEMP__",
                                                                                                localId+"_kAgent",
                                                                                                new KnowledgeContextResolveFromContextCommand( new RegisterKAgentRemoteCommand( localId ),
                                                                                                                                               null,
                                                                                                                                               this.instanceId,
                                                                                                                                               null,
                                                                                                                                               kresultsId ) )} ) );
        ConversationUtil.sendMessage( this.cm,
                                      (InetSocketAddress) this.gsd.getAddresses().get( "socket" ).getObject(),
                                      this.gsd.getId(),
                                      registerKAgentCmd );
       
        CommandImpl newSessionCmd = new CommandImpl( "execute",
                                           Arrays.asList( new Object[]{new SetVariableCommandFromCommand( "__TEMP__",
                                                                                                localId,
                                                                                                new KnowledgeContextResolveFromContextCommand( new NewStatefulKnowledgeSessionFromKAgentRemoteCommand( conf , environment, localId),
                                                                                                                                               null,
                                                                                                                                               this.instanceId,
View Full Code Here

        this.grid = grid;
    }

    public void setProperty(String name, String value) {
        System.out.println("This InstanceId (ConfRemoteClient) = "+instanceId);
        CommandImpl cmd = new CommandImpl( "execute",
                                           Arrays.asList( new Object[]{CommandFactory.newKBuilderSetPropertyCommand(instanceId, name, value)} ) );

        ConversationUtil.sendMessage( this.grid.get(ConversationManager.class),
                                                      (InetSocketAddress) this.gsd.getAddresses().get( "socket" ).getObject(),
                                                      this.gsd.getId(),
View Full Code Here

        //If not use the configuration and the bucket systems.
        for ( int i = 0; i < redundancy; i++ ) {
            int bucket = (int) jobhandle.hashCode() % addresses.length;
            //InetSocketAddress[] sockets = (InetSocketAddress[]) ((Address) schedulerGsd.getAddresses().get( "socket" )).getObject();
            InetSocketAddress socket = addresses[bucket];
            CommandImpl cmd = new CommandImpl( "Scheduler.scheduleJob",
                                               Arrays.asList( new Object[]{ new ScheduledJob( jobhandle,
                                                                                              job,
                                                                                              ctx,
                                                                                              trigger,
                                                                                              null ) } ) );
View Full Code Here

    public String getProperty(String name) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public <T extends KnowledgeBuilderOption> void setOption(T option) {
        CommandImpl cmd = new CommandImpl( "execute",
                                           Arrays.asList( new Object[]{CommandFactory.newKBuilderSetPropertyCommand(instanceId, option.getPropertyName(), ((AccumulateFunctionOption)option).getFunction().getClass().getCanonicalName())} ) );
       
        ConversationUtil.sendMessage( this.grid.get(ConversationManager.class),
                                                      (InetSocketAddress) this.gsd.getAddresses().get( "socket" ).getObject(),
                                                      this.gsd.getId(),
View Full Code Here

        this.scheduler = scheduler;
    }

    public void messageReceived(Conversation conversation,
                                Message msg) {
        final CommandImpl cmd = (CommandImpl) msg.getBody();
        this.execs.get( cmd.getName() ).execute( scheduler,
                                                 conversation,
                                                 msg,
                                                 cmd );
    }
View Full Code Here

    }

    public KnowledgeBuilderConfiguration newKnowledgeBuilderConfiguration() {
        String localId = UUID.randomUUID().toString();
        System.out.println("This InstanceId (just generated) = "+localId);
        CommandImpl cmd = new CommandImpl( "execute",
                                           Arrays.asList( new Object[]{ CommandFactory.newNewKnowledgeBuilderConfigurationCommand( localId ) } ) );

        ConversationManager connm = this.grid.get( ConversationManager.class );
        ConversationUtil.sendMessage( connm,
                                      (InetSocketAddress) this.gsd.getAddresses().get( "socket" ).getObject(),
View Full Code Here

        String localId = UUID.randomUUID().toString();
        String remoteConfId = null;
        if(conf != null) {
            remoteConfId = ((KnowledgeBuilderConfigurationRemoteClient)conf).getId();
        }
        CommandImpl cmd = new CommandImpl( "execute",
                                           Arrays.asList( new Object[]{new SetVariableCommandFromCommand( "__TEMP__",
                                                                                                          localId,
                                                                                                          new NewKnowledgeBuilderRemoteCommand( remoteConfId ) )} ) );

        ConversationManager connm = this.grid.get( ConversationManager.class );
View Full Code Here

                null,
                id,
                "" );
       
       
        CommandImpl cmd = new CommandImpl( "execute",
                    Arrays.asList( new Object[] { c, id } )
                );
       
       
        ConversationUtil.sendAsyncMessage(this.cm,
View Full Code Here

TOP

Related Classes of org.drools.grid.io.impl.CommandImpl

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.