001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.kernel.bi.rules;
016    
017    import com.liferay.portal.kernel.messaging.proxy.ExecutingClassLoaders;
018    import com.liferay.portal.kernel.messaging.proxy.MessagingProxy;
019    import com.liferay.portal.kernel.messaging.proxy.ProxyMode;
020    
021    import java.util.List;
022    import java.util.Map;
023    
024    /**
025     * @author Michael C. Han
026     * @author Vihang Pathak
027     */
028    public interface RulesEngine {
029    
030            @MessagingProxy(mode = ProxyMode.SYNC)
031            public void add(
032                            String domainName, RulesResourceRetriever rulesResourceRetriever,
033                            @ExecutingClassLoaders ClassLoader... classloaders)
034                    throws RulesEngineException;
035    
036            @MessagingProxy(mode = ProxyMode.SYNC)
037            public boolean containsRuleDomain(String domainName)
038                    throws RulesEngineException;
039    
040            @MessagingProxy(mode = ProxyMode.ASYNC)
041            public void execute(
042                            RulesResourceRetriever rulesResourceRetriever, List<Fact<?>> facts,
043                            @ExecutingClassLoaders ClassLoader... classloaders)
044                    throws RulesEngineException;
045    
046            @MessagingProxy(mode = ProxyMode.SYNC)
047            public Map<String, ?> execute(
048                            RulesResourceRetriever rulesResourceRetriever, List<Fact<?>> facts,
049                            Query query, @ExecutingClassLoaders ClassLoader... classloaders)
050                    throws RulesEngineException;
051    
052            @MessagingProxy(mode = ProxyMode.ASYNC)
053            public void execute(
054                            String domainName, List<Fact<?>> facts,
055                            @ExecutingClassLoaders ClassLoader... classloaders)
056                    throws RulesEngineException;
057    
058            @MessagingProxy(mode = ProxyMode.SYNC)
059            public Map<String, ?> execute(
060                            String domainName, List<Fact<?>> facts, Query query,
061                            @ExecutingClassLoaders ClassLoader... classloaders)
062                    throws RulesEngineException;
063    
064            @MessagingProxy(mode = ProxyMode.SYNC)
065            public void remove(String domainName) throws RulesEngineException;
066    
067            @MessagingProxy(mode = ProxyMode.SYNC)
068            public void update(
069                            String domainName, RulesResourceRetriever rulesResourceRetriever,
070                            @ExecutingClassLoaders ClassLoader... classloaders)
071                    throws RulesEngineException;
072    
073    }