Package org.drools.grid.io.impl

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


                        null,
                        id,
                        "" );


        CommandImpl cmd = new CommandImpl( "execute",
                    Arrays.asList( new Object[] { c, id } )
                );

        ConversationUtil.sendAsyncMessage(this.cm,
                (InetSocketAddress) this.gsd.getAddresses().get("socket").getObject(),
View Full Code Here


    }

    public GridServiceDescription create(String serviceDescriptionId) {
        GridServiceDescription<WhitePages> wpGsd = getGsd();
        InetSocketAddress[] sockets = (InetSocketAddress[]) ((Address) wpGsd.getAddresses().get( "socket" )).getObject();
        CommandImpl cmd = new CommandImpl( "WhitePages.create",
                                           Arrays.asList( new Object[]{serviceDescriptionId} ) );
        ConversationManager convm = this.grid.get( ConversationManager.class );
        GridServiceDescription gsd = (GridServiceDescription) sendMessage( convm,
                                                                           sockets,
                                                                           wpGsd.getId(),
View Full Code Here

    }

    public GridServiceDescription lookup(String serviceDescriptionId) {
        GridServiceDescription<WhitePages> wpGsd = getGsd();
        InetSocketAddress[] sockets = (InetSocketAddress[]) ((Address) wpGsd.getAddresses().get( "socket" )).getObject();
        CommandImpl cmd = new CommandImpl( "WhitePages.lookup",
                                           Arrays.asList( new Object[]{serviceDescriptionId} ) );
        ConversationManager convm = this.grid.get( ConversationManager.class );
        GridServiceDescription gsd = (GridServiceDescription) sendMessage( convm,
                                                                           sockets,
                                                                           wpGsd.getId(),
View Full Code Here

    public void remove(String serviceDescriptionId) {
        GridServiceDescription<WhitePages> wpGsd = getGsd();

        InetSocketAddress[] sockets = (InetSocketAddress[]) ((Address) wpGsd.getAddresses().get( "socket" )).getObject();
        CommandImpl cmd = new CommandImpl( "WhitePages.remove",
                                           Arrays.asList( new Object[]{serviceDescriptionId} ) );
        ConversationManager convm = this.grid.get( ConversationManager.class );
        sendMessage( convm,
                     sockets,
                     wpGsd.getId(),
View Full Code Here

    public <T> T get(String identifier,
                     Class<T> cls) {
        //@TODO: this was done just as a hack to have the information ready, requires review and refactoring
        if(cls.isAssignableFrom(String.class)){
            CommandImpl cmd = new CommandImpl( "lookupKsessionId",
                    Arrays.asList( new Object[]{identifier} ) );

            ConversationManager connm = this.grid.get( ConversationManager.class );
            Object result = ConversationUtil.sendMessage( connm,
                    (InetSocketAddress) ((Map<String, Address>)this.gsd.getAddresses()).get( "socket" ).getObject(),
                    this.gsd.getId(),
                    cmd );
            return (T)result;
        }
        if(cls.isAssignableFrom(StatefulKnowledgeSession.class) ){
            if ( logger.isDebugEnabled() ) {
                logger.debug( "(" + Thread.currentThread().getId() + ")"+Thread.currentThread().getName() +"GNRC I'm now trying to locate a happy SKS..." + identifier );
            }
            CommandImpl cmd = new CommandImpl( "lookupKsession",
                    Arrays.asList( new Object[]{identifier} ) );
            if ( logger.isDebugEnabled() ) {
                logger.debug( "(" + Thread.currentThread().getId() + ")"+Thread.currentThread().getName() +"GNRC I have the command ready" );
            }
View Full Code Here

        //We need a way to do it more generic, so we can set whatever we want.

        if(object instanceof StatefulKnowledgeSessionRemoteClient){
            String localId = UUID.randomUUID().toString();

            CommandImpl cmd = new CommandImpl( "registerKsession",
                    Arrays.asList( new Object[]{identifier, ((StatefulKnowledgeSessionRemoteClient)object).getInstanceId()} ) );

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

    }
   
    public String[] getParameters(){
        String kresultsId = "kresults_" + this.gsd.getId();
       
        CommandImpl cmd = new CommandImpl( "execute",
                                           Arrays.asList( new Object[]{ new KnowledgeContextResolveFromContextCommand( new GetQueryParametersRemoteCommand(this.queryName, this.localId  ),
                                                                                                                      null,
                                                                                                                      null,
                                                                                                                      this.instanceId,
                                                                                                                      kresultsId )} ) );
View Full Code Here

    }
   
    public Object getObject(String key){
        //String kresultsId = "kresults_" + this.gsd.getId();
        String kresultsId = "kresults_execute" ;
        CommandImpl cmd = new CommandImpl( "execute",
                                           Arrays.asList( new Object[]{ new KnowledgeContextResolveFromContextCommand( new GetQueryObjectRemoteCommand(this.localId, key ),
                                                                                                                      null,
                                                                                                                      null,
                                                                                                                      this.instanceId,
                                                                                                                      kresultsId )} ) );
View Full Code Here

        throw new UnsupportedOperationException( "Not supported yet." );
    }

    public void dispose() {
        String kresultsId = "kresults_" + this.gsd.getId();
        CommandImpl cmd = new CommandImpl( "execute",
                                           Arrays.asList( new Object[]{new KnowledgeContextResolveFromContextCommand( new DisposeCommand(),
                                                                                                                      null,
                                                                                                                      null,
                                                                                                                      this.instanceId,
                                                                                                                      kresultsId ), this.instanceId} ) );
View Full Code Here

    }

    public int fireAllRules(int max) {
        String kresultsId = "kresults_" + this.gsd.getId();
        CommandImpl cmd = new CommandImpl( "execute",
                                           Arrays.asList( new Object[]{new KnowledgeContextResolveFromContextCommand( CommandFactory.newFireAllRules( max ),
                                                                                                                      null,
                                                                                                                      null,
                                                                                                                      this.instanceId,
                                                                                                                      kresultsId )} ) );
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.