1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portal.kernel.bi.rules;
16  
17  import com.liferay.portal.kernel.messaging.proxy.ExecutingClassLoaders;
18  import com.liferay.portal.kernel.messaging.proxy.MessagingProxy;
19  import com.liferay.portal.kernel.messaging.proxy.ProxyMode;
20  
21  import java.util.List;
22  import java.util.Map;
23  
24  /**
25   * <a href="RulesEngine.java.html"><b><i>View Source</i></b></a>
26   *
27   * @author Michael C. Han
28   * @author Vihang Pathak
29   */
30  public interface RulesEngine {
31  
32      @MessagingProxy(mode = ProxyMode.SYNC)
33      public void add(
34              String domainName, RulesResourceRetriever rulesResourceRetriever,
35              @ExecutingClassLoaders ClassLoader... classloaders)
36          throws RulesEngineException;
37  
38      @MessagingProxy(mode = ProxyMode.SYNC)
39      public boolean containsRuleDomain(String domainName)
40          throws RulesEngineException;
41  
42      @MessagingProxy(mode = ProxyMode.ASYNC)
43      public void execute(
44              RulesResourceRetriever rulesResourceRetriever, List<Fact<?>> facts,
45              @ExecutingClassLoaders ClassLoader... classloaders)
46          throws RulesEngineException;
47  
48      @MessagingProxy(mode = ProxyMode.SYNC)
49      public Map<String, ?> execute(
50              RulesResourceRetriever rulesResourceRetriever, List<Fact<?>> facts,
51              Query query, @ExecutingClassLoaders ClassLoader... classloaders)
52          throws RulesEngineException;
53  
54      @MessagingProxy(mode = ProxyMode.ASYNC)
55      public void execute(
56              String domainName, List<Fact<?>> facts,
57              @ExecutingClassLoaders ClassLoader... classloaders)
58          throws RulesEngineException;
59  
60      @MessagingProxy(mode = ProxyMode.SYNC)
61      public Map<String, ?> execute(
62              String domainName, List<Fact<?>> facts, Query query,
63              @ExecutingClassLoaders ClassLoader... classloaders)
64          throws RulesEngineException;
65  
66      @MessagingProxy(mode = ProxyMode.SYNC)
67      public void remove(String domainName) throws RulesEngineException;
68  
69      @MessagingProxy(mode = ProxyMode.SYNC)
70      public void update(
71              String domainName, RulesResourceRetriever rulesResourceRetriever,
72              @ExecutingClassLoaders ClassLoader... classloaders)
73          throws RulesEngineException;
74  
75  }