Java Doc for RuleAgent.java in  » Rule-Engine » drolls-Rule-Engine » org » drools » agent » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Rule Engine » drolls Rule Engine » org.drools.agent 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.drools.agent.RuleAgent

All known Subclasses:   org.drools.agent.MockRuleAgent,
RuleAgent
public class RuleAgent (Code)
This manages a single rulebase, based on the properties given. You should only have ONE instance of this agent per rulebase configuration. You can get the rulebase from this agent repeatedly, as needed, or if you keep the rulebase, under most configurations it will be automatically updated. How this behaves depends on the properties that you pass into it (documented below) CONFIG OPTIONS (to be passed in as properties): newInstance: setting this to "true" means that each time the rules are changed a new instance of the rulebase is created (as opposed to updated in place) the default is to update in place. DEFAULT: false. If you set this to true, then you will need to call getRuleBase() each time you want to use it. If it is false, then it means you can keep your reference to the rulebase and it will be updated automatically (as well as any stateful sessions). pollThe number of seconds to poll for changes. Polling happens in a background thread. eg: poll=30 #30 second polling. file: a space seperated listing of files that make up the packages of the rulebase. Each package can only be in one file. You can't have packages spread across files. eg: file=/your/dir/file1.pkg file=/your/dir/file2.pkg dir: a single file system directory to monitor for packages. As with files, each package must be in its own file. eg: dir=/your/dir url: A space seperated URL to a binary rulebase in the BRMS. eg: url=http://server/drools-jbrms/packages/somePakage/VERSION_1 For URL you will also want a local cache directory setup: eg: localCacheDir=/some/dir/that/exists This is needed so that the runtime can startup and load packages even if the BRMS is not available (or the network). name the Name is used in any logging, so each agent can be differentiated (you may have one agent per rulebase that you need in your application). There is also an AgentEventListener interface which you can provide which will call back when lifecycle events happen, or errors/warnings occur. As the updating happens in a background thread, this may be important. The default event listener logs to the System.err output stream.
author:
   Michael Neale


Field Summary
final public static  StringCONFIG_NAME
    
final public static  StringDIRECTORY
    
final public static  StringFILES
    
final public static  StringLOCAL_URL_CACHE
    
final public static  StringNEW_INSTANCE
     Following are property keys to be used in the property config file.
public static  MapPACKAGE_PROVIDERS
     Here is where we have a map of providers to the key that appears on the configuration.
final public static  StringPOLL_INTERVAL
    
final public static  StringURLS
    
 AgentEventListenerlistener
     For logging events (important for stuff that happens in the background).
 Mappackages
     This keeps the packages around that have been loaded.
 Listproviders
     The providers that actually do the work.

Constructor Summary
 RuleAgent(RuleBaseConfiguration ruleBaseConf)
    

Method Summary
synchronized  voidconfigure(boolean newInstance, List provs, int secondsToRefresh)
    
public synchronized  RuleBasegetRuleBase()
     Return a current rulebase.
 voidinit(Properties config)
    
 booleanisNewInstance()
    
public synchronized  booleanisPolling()
    
static  Listlist(String property)
     Convert a space seperated list into a List of stuff.
static  PropertiesloadFromProperties(String propsFileName)
    
public static  RuleAgentnewRuleAgent(Properties config)
     Properties configured to load up packages into a rulebase (and monitor them for changes).
public static  RuleAgentnewRuleAgent(Properties config, RuleBaseConfiguration ruleBaseConf)
     Properties configured to load up packages into a rulebase with the provided configuration (and monitor them for changes).
public static  RuleAgentnewRuleAgent(Properties config, AgentEventListener listener)
     This allows an optional listener to be passed in.
public static  RuleAgentnewRuleAgent(Properties config, AgentEventListener listener, RuleBaseConfiguration ruleBaseConf)
     This allows an optional listener to be passed in.
public static  RuleAgentnewRuleAgent(String propsFileName)
     Pass in the name and full path to a config file that is on the classpath.
public static  RuleAgentnewRuleAgent(String propsFileName, RuleBaseConfiguration ruleBaseConfiguration)
     Pass in the name and full path to a config file that is on the classpath.
public static  RuleAgentnewRuleAgent(String propsFileName, AgentEventListener listener)
     This takes in an optional listener.
public static  RuleAgentnewRuleAgent(String propsFileName, AgentEventListener listener, RuleBaseConfiguration ruleBaseConfiguration)
     This takes in an optional listener and RuleBaseConfiguration.
public  voidrefreshRuleBase()
    
public synchronized  voidstartPolling()
     Will start polling.
public synchronized  voidstartPolling(int secondsToRefresh)
     Will start polling.
public synchronized  voidstopPolling()
    

Field Detail
CONFIG_NAME
final public static String CONFIG_NAME(Code)



DIRECTORY
final public static String DIRECTORY(Code)



FILES
final public static String FILES(Code)



LOCAL_URL_CACHE
final public static String LOCAL_URL_CACHE(Code)



NEW_INSTANCE
final public static String NEW_INSTANCE(Code)
Following are property keys to be used in the property config file.



PACKAGE_PROVIDERS
public static Map PACKAGE_PROVIDERS(Code)
Here is where we have a map of providers to the key that appears on the configuration.



POLL_INTERVAL
final public static String POLL_INTERVAL(Code)



URLS
final public static String URLS(Code)



listener
AgentEventListener listener(Code)
For logging events (important for stuff that happens in the background).



packages
Map packages(Code)
This keeps the packages around that have been loaded.



providers
List providers(Code)
The providers that actually do the work.




Constructor Detail
RuleAgent
RuleAgent(RuleBaseConfiguration ruleBaseConf)(Code)




Method Detail
configure
synchronized void configure(boolean newInstance, List provs, int secondsToRefresh)(Code)



getRuleBase
public synchronized RuleBase getRuleBase()(Code)
Return a current rulebase. Depending on the configuration, this may be a new object each time the rules are updated.



init
void init(Properties config)(Code)



isNewInstance
boolean isNewInstance()(Code)



isPolling
public synchronized boolean isPolling()(Code)



list
static List list(String property)(Code)
Convert a space seperated list into a List of stuff.
Parameters:
  property -



loadFromProperties
static Properties loadFromProperties(String propsFileName)(Code)



newRuleAgent
public static RuleAgent newRuleAgent(Properties config)(Code)
Properties configured to load up packages into a rulebase (and monitor them for changes).



newRuleAgent
public static RuleAgent newRuleAgent(Properties config, RuleBaseConfiguration ruleBaseConf)(Code)
Properties configured to load up packages into a rulebase with the provided configuration (and monitor them for changes).



newRuleAgent
public static RuleAgent newRuleAgent(Properties config, AgentEventListener listener)(Code)
This allows an optional listener to be passed in. The default one prints some stuff out to System.err only when really needed.



newRuleAgent
public static RuleAgent newRuleAgent(Properties config, AgentEventListener listener, RuleBaseConfiguration ruleBaseConf)(Code)
This allows an optional listener to be passed in. The default one prints some stuff out to System.err only when really needed.



newRuleAgent
public static RuleAgent newRuleAgent(String propsFileName)(Code)
Pass in the name and full path to a config file that is on the classpath.



newRuleAgent
public static RuleAgent newRuleAgent(String propsFileName, RuleBaseConfiguration ruleBaseConfiguration)(Code)
Pass in the name and full path to a config file that is on the classpath.



newRuleAgent
public static RuleAgent newRuleAgent(String propsFileName, AgentEventListener listener)(Code)
This takes in an optional listener. Listener must not be null in this case.



newRuleAgent
public static RuleAgent newRuleAgent(String propsFileName, AgentEventListener listener, RuleBaseConfiguration ruleBaseConfiguration)(Code)
This takes in an optional listener and RuleBaseConfiguration. Listener must not be null in this case.



refreshRuleBase
public void refreshRuleBase()(Code)



startPolling
public synchronized void startPolling()(Code)
Will start polling. If polling is already running it does nothing.



startPolling
public synchronized void startPolling(int secondsToRefresh)(Code)
Will start polling. If polling is already happening and of the same interval it will do nothing, if the interval is different it will stop the current Timer and create a new Timer for the new interval.
Parameters:
  secondsToRefresh -



stopPolling
public synchronized void stopPolling()(Code)
Stop the polling (if it is happening)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.