001    /**
002     * Copyright (c) 2000-2010 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... clientClassLoaders)
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... clientClassLoaders)
044                    throws RulesEngineException;
045    
046            @MessagingProxy(mode = ProxyMode.SYNC)
047            public Map<String, ?> execute(
048                            RulesResourceRetriever RulesResourceRetriever, List<Fact<?>> facts,
049                            Query query,
050                            @ExecutingClassLoaders ClassLoader... clientClassLoaders)
051                    throws RulesEngineException;
052    
053            @MessagingProxy(mode = ProxyMode.ASYNC)
054            public void execute(
055                            String domainName, List<Fact<?>> facts,
056                            @ExecutingClassLoaders ClassLoader... clientClassLoaders)
057                    throws RulesEngineException;
058    
059            @MessagingProxy(mode = ProxyMode.SYNC)
060            public Map<String, ?> execute(
061                            String domainName, List<Fact<?>> facts, Query query,
062                            @ExecutingClassLoaders ClassLoader... clientClassLoaders)
063                    throws RulesEngineException;
064    
065            @MessagingProxy(mode = ProxyMode.SYNC)
066            public void remove(String domainName) throws RulesEngineException;
067    
068            @MessagingProxy(mode = ProxyMode.SYNC)
069            public void update(
070                            String domainName, RulesResourceRetriever RulesResourceRetriever,
071                            @ExecutingClassLoaders ClassLoader... clientClassLoaders)
072                    throws RulesEngineException;
073    
074    }