1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
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... clientClassLoaders)
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... clientClassLoaders)
46          throws RulesEngineException;
47  
48      @MessagingProxy(mode = ProxyMode.SYNC)
49      public Map<String, ?> execute(
50              RulesResourceRetriever RulesResourceRetriever, List<Fact<?>> facts,
51              Query query,
52              @ExecutingClassLoaders ClassLoader... clientClassLoaders)
53          throws RulesEngineException;
54  
55      @MessagingProxy(mode = ProxyMode.ASYNC)
56      public void execute(
57              String domainName, List<Fact<?>> facts,
58              @ExecutingClassLoaders ClassLoader... clientClassLoaders)
59          throws RulesEngineException;
60  
61      @MessagingProxy(mode = ProxyMode.SYNC)
62      public Map<String, ?> execute(
63              String domainName, List<Fact<?>> facts, Query query,
64              @ExecutingClassLoaders ClassLoader... clientClassLoaders)
65          throws RulesEngineException;
66  
67      @MessagingProxy(mode = ProxyMode.SYNC)
68      public void remove(String domainName) throws RulesEngineException;
69  
70      @MessagingProxy(mode = ProxyMode.SYNC)
71      public void update(
72              String domainName, RulesResourceRetriever RulesResourceRetriever,
73              @ExecutingClassLoaders ClassLoader... clientClassLoaders)
74          throws RulesEngineException;
75  
76  }