001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
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    }