All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.drools.agent.KnowledgeAgent Maven / Gradle / Ivy

There is a newer version: 5.1.1
Show newest version
package org.drools.agent;

import org.drools.KnowledgeBase;

/**
 * 

* The KnowlegeAgent is created by the KnowlegeAgentFactory. It's role is to provide a cached * KnowlegeBase and to update or rebuild this KnowlegeBase as the resources it uses are changed. * The strategy for this is determined by the configuration given to the factory, but it is * typically pull based using regular polling. We hope to add push based updates and rebuilds in future * versions. *

*

* The Follow example constructs an agent that will build a new KnowledgeBase from the files specified in the path String. * It will poll those files every 30 seconds to see if they are updated. If new files are found it will construct a new * KnowledgeBase, instead of upating the existing one, due to the "newInstance" set to "true": *

*

 * Properties props = new Properties();
 * props.setProperty( "file", path );
 *
 * props.setProperty( "newInstance", "true" );
 * props.setProperty( "poll", "30" );
 * KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent( "agent1", props );
 * KnowledgeBase kbase = kagent.getKnowledgeBase();
 * 
* * @see org.drools.agent.KnowledgeAgentFactory * */ public interface KnowledgeAgent { /** * * @return * The name */ String getName(); /** * Returns the cached KnowledgeBase * @return * The KnowledgeBase */ KnowledgeBase getKnowledgeBase(); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy