亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? abstractrulesessionimpl.java

?? drools 一個開放源碼的規則引擎
?? JAVA
字號:
package org.drools.jsr94.rules;

/*
 * $Id: AbstractRuleSessionImpl.java,v 1.2 2006/01/16 01:31:22 michaelneale Exp $
 *
 * Copyright 2002-2004 (C) The Werken Company. All Rights Reserved.
 *
 * Redistribution and use of this software and associated documentation
 * ("Software"), with or without modification, are permitted provided that the
 * following conditions are met:
 *
 * 1. Redistributions of source code must retain copyright statements and
 * notices. Redistributions must also contain a copy of this document.
 *
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 * this list of conditions and the following disclaimer in the documentation
 * and/or other materials provided with the distribution.
 *
 * 3. The name "drools" must not be used to endorse or promote products derived
 * from this Software without prior written permission of The Werken Company.
 * For written permission, please contact bob@werken.com.
 *
 * 4. Products derived from this Software may not be called "drools" nor may
 * "drools" appear in their names without prior written permission of The Werken
 * Company. "drools" is a registered trademark of The Werken Company.
 *
 * 5. Due credit should be given to The Werken Company.
 * (http://drools.werken.com/).
 *
 * THIS SOFTWARE IS PROVIDED BY THE WERKEN COMPANY AND CONTRIBUTORS ``AS IS''
 * AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE WERKEN COMPANY OR ITS CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 *
 */

import java.util.Iterator;
import java.util.List;
import java.util.Map;

import javax.rules.InvalidRuleSessionException;
import javax.rules.ObjectFilter;
import javax.rules.RuleExecutionSetMetadata;
import javax.rules.RuleRuntime;
import javax.rules.RuleSession;
import javax.rules.StatefulRuleSession;
import javax.rules.StatelessRuleSession;
import javax.rules.admin.RuleExecutionSet;

import org.drools.WorkingMemory;
import org.drools.jsr94.rules.admin.RuleExecutionSetImpl;
import org.drools.jsr94.rules.admin.RuleExecutionSetRepository;

/**
 * The Drools implementation of the <code>RuleSession</code> interface which is
 * a representation of a client session with a rules engine. A rules engine
 * session serves as an entry point into an underlying rules engine. The
 * <code>RuleSession</code> is bound to a rules engine instance and exposes a
 * vendor-neutral rule processing API for executing <code>Rule</code>s within a
 * bound <code>RuleExecutionSet</code>.
 * <p/>
 * Note: the <code>release</code> method must be called to clean up all
 * resources used by the <code>RuleSession</code>. Calling <code>release</code>
 * may make the <code>RuleSession</code> eligible to be returned to a
 * <code>RuleSession</code> pool.
 *
 * @see RuleSession
 *
 * @author N. Alex Rupp (n_alex <at>codehaus.org)
 * @author <a href="mailto:thomas.diesler@softcon-itec.de">thomas diesler </a>
 */
abstract class AbstractRuleSessionImpl implements RuleSession
{
	private RuleExecutionSetRepository repository;
	
	public AbstractRuleSessionImpl(RuleExecutionSetRepository repository) {
		super();
		this.repository = repository;
	}
	
    /**
     * The Drools <code>WorkingMemory</code> associated
     * with this <code>RuleSession</code>.
     */
    private WorkingMemory workingMemory;

    /**
     * The Drools <code>RuleExecutionSet</code> associated
     * with this <code>RuleSession</code>.
     */
    private RuleExecutionSetImpl ruleExecutionSet;

    /**
     * A <code>Map</code> of <code>String</code>/<code>Object</code> pairs
     * passed as application data to the Drools <code>WorkingMemory</code>.
     */
    private Map properties;

    /**
     * Initialize this <code>RuleSession</code>
     * with a new <code>WorkingMemory</code>.
     *
     * @see #newWorkingMemory()
     */
    protected void initWorkingMemory( )
    {
        this.setWorkingMemory( this.newWorkingMemory( ) );
    }

    /**
     * Creates a new <code>WorkingMemory</code> for this
     * <code>RuleSession</code>. All properties set prior to calling this method
     * are added as application data to the new <code>WorkingMemory</code>.
     * The created <code>WorkingMemory</code> uses the default conflict
     * resolution strategy.
     *
     * @return the new <code>WorkingMemory</code>.
     *
     * @see #setProperties(Map)
     * @see WorkingMemory#setApplicationData(String, Object)
     */
    protected WorkingMemory newWorkingMemory( )
    {
        WorkingMemory newWorkingMemory =
            this.getRuleExecutionSet( ).newWorkingMemory( );

        Map props = this.getProperties( );
        if ( props != null )
        {
            for ( Iterator iterator = props.entrySet( ).iterator( );
                  iterator.hasNext( ); )
            {
                Map.Entry entry = ( Map.Entry ) iterator.next( );
                newWorkingMemory.setApplicationData(
                    ( String ) entry.getKey( ), entry.getValue( ) );
            }
        }

        return newWorkingMemory;
    }

    /**
     * Sets additional properties used to create this <code>RuleSession</code>.
     *
     * @param properties additional properties used to create the
     *        <code>RuleSession</code> implementation.
     */
    protected void setProperties( Map properties )
    {
        this.properties = properties;
    }

    /**
     * Returns the additional properties used to create this
     * <code>RuleSession</code>.
     *
     * @return the additional properties used to create this
     *         <code>RuleSession</code>.
     */
    protected Map getProperties( )
    {
        return this.properties;
    }

    /**
     * Sets the Drools <code>WorkingMemory</code> associated
     * with this <code>RuleSession</code>.
     *
     * @param workingMemory the <code>WorkingMemory</code> to associate
     *        with this <code>RuleSession</code>.
     */
    protected void setWorkingMemory( WorkingMemory workingMemory )
    {
        this.workingMemory = workingMemory;
    }

    /**
     * Returns the Drools <code>WorkingMemory</code> associated
     * with this <code>RuleSession</code>.
     *
     * @return the Drools <code>WorkingMemory</code> to associate
     *         with this <code>RuleSession</code>.
     */
    protected WorkingMemory getWorkingMemory( )
    {
        return this.workingMemory;
    }

    /**
     * Sets the Drools <code>RuleExecutionSet</code> associated
     * with this <code>RuleSession</code>.
     *
     * @param ruleExecutionSet the Drools <code>RuleExecutionSet</code> to associate
     *        with this <code>RuleSession</code>.
     */
    protected void setRuleExecutionSet( RuleExecutionSetImpl ruleExecutionSet )
    {
        this.ruleExecutionSet = ruleExecutionSet;
    }

    /**
     * Returns the Drools <code>RuleExecutionSet</code> associated
     * with this <code>RuleSession</code>.
     *
     * @return the Drools <code>RuleExecutionSet</code> associated
     * with this <code>RuleSession</code>.
     */
    protected RuleExecutionSetImpl getRuleExecutionSet( )
    {
        return this.ruleExecutionSet;
    }

    /**
     * Ensures this <code>RuleSession</code> is not
     * in an illegal rule session state.
     *
     * @throws InvalidRuleSessionException on illegal rule session state.
     */
    protected void checkRuleSessionValidity( )
        throws InvalidRuleSessionException
    {
        if ( this.workingMemory == null )
        {
            throw new InvalidRuleSessionException( "invalid rule session" );
        }
    }

    /**
     * Applies the given <code>ObjectFilter</code> to the <code>List</code> of
     * <code>Object</code>s, removing all <code>Object</code>s from the given
     * <code>List</code> that do not pass the filter.
     *
     * @param objects <code>List</code> of <code>Object</code>s to be filtered
     * @param objectFilter the <code>ObjectFilter</code> to be applied
     */
    protected void applyFilter( List objects, ObjectFilter objectFilter )
    {
        if ( objectFilter != null )
        {
            for ( Iterator objectIter = objects.iterator( );
                  objectIter.hasNext( ); )
            {
                if ( objectFilter.filter( objectIter.next( ) ) == null )
                {
                    objectIter.remove( );
                }
            }
        }
    }

    // JSR94 interface methods start here -------------------------------------

    /**
     * Returns the meta data for the rule execution set bound to this rule
     * session.
     *
     * @return the RuleExecutionSetMetaData bound to this rule session.
     */
    public RuleExecutionSetMetadata getRuleExecutionSetMetadata( )
    {
        String theBindUri = null;
        for ( Iterator i = repository.getRegistrations( ).iterator( );
              i.hasNext( ); )
        {
            String aBindUri = ( String ) i.next( );
            RuleExecutionSet aRuleSet =
                repository.getRuleExecutionSet( aBindUri );
            if ( aRuleSet == this.ruleExecutionSet )
            {
                theBindUri = aBindUri;
                break;
            }
        }

        return new RuleExecutionSetMetadataImpl(
            theBindUri,
            this.ruleExecutionSet.getName( ),
            this.ruleExecutionSet.getDescription( ) );
    }

    /**
     * Returns the type identifier for this <code>RuleSession</code>. The
     * type identifiers are defined in the <code>RuleRuntime</code> interface.
     *
     * @return the type identifier for this <code>RuleSession</code>
     *
     * @throws InvalidRuleSessionException on illegal rule session state.
     *
     * @see RuleRuntime#STATEFUL_SESSION_TYPE
     * @see RuleRuntime#STATELESS_SESSION_TYPE
     */
    public int getType( ) throws InvalidRuleSessionException
    {
        if ( this instanceof StatelessRuleSession )
        {
            return RuleRuntime.STATELESS_SESSION_TYPE;
        }

        if ( this instanceof StatefulRuleSession )
        {
            return RuleRuntime.STATEFUL_SESSION_TYPE;
        }

        throw new InvalidRuleSessionException( "unknown type" );
    }

    /**
     * Releases all resources used by this rule session.
     * This method renders this rule session unusable until
     * it is reacquired through the <code>RuleRuntime</code>.
     */
    public void release( )
    {
        this.setProperties( null );
        this.setWorkingMemory( null );
        this.setRuleExecutionSet( null );
    }

    /**
     * Resets this rule session. Calling this method will bring the rule session
     * state to its initial state for this rule session and will reset any other
     * state associated with this rule session.
     * <p/>
     * A reset will not reset the state on the default object filter for a
     * <code>RuleExecutionSet</code>.
     */
    public void reset( )
    {
        this.initWorkingMemory( );
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品亲子伦对白| 精品一区二区三区av| 日精品一区二区三区| 国产·精品毛片| 欧美男男青年gay1069videost| 国产午夜亚洲精品不卡| 午夜精品久久久久久久99水蜜桃| 国产69精品一区二区亚洲孕妇| 欧美乱熟臀69xxxxxx| 最新国产成人在线观看| 国产精品自在在线| 日韩一区二区免费在线观看| 亚洲精品乱码久久久久久久久| 国产伦精一区二区三区| 欧美一区二区三区成人| 亚洲国产综合人成综合网站| 一本色道久久综合亚洲aⅴ蜜桃| 久久九九久久九九| 精品无码三级在线观看视频| 91精品午夜视频| 亚洲国产日韩综合久久精品| 91农村精品一区二区在线| 中文字幕+乱码+中文字幕一区| 青青草国产精品亚洲专区无| 欧美日韩久久一区二区| 夜夜精品浪潮av一区二区三区| av在线免费不卡| 国产精品你懂的| 不卡欧美aaaaa| 国产精品嫩草影院com| 成人国产精品免费观看动漫| 国产精品久线观看视频| 成人av电影免费在线播放| 国产亚洲成aⅴ人片在线观看| 韩国欧美国产1区| 精品久久久三级丝袜| 国产一区二区三区av电影| 久久在线免费观看| 国产成人亚洲综合a∨婷婷| 国产日韩影视精品| av电影在线观看不卡| 亚洲男人的天堂在线aⅴ视频| 91网站最新网址| 亚洲一区在线视频观看| 欧美老年两性高潮| 久久99久久久久| 国产午夜亚洲精品羞羞网站| av成人老司机| 亚洲一区二区三区视频在线 | 国内精品伊人久久久久av影院| 91麻豆精品91久久久久同性| 老司机午夜精品99久久| 久久九九国产精品| 91啪九色porn原创视频在线观看| 亚洲一区国产视频| 欧美一二三区在线观看| 国产精品白丝av| 亚洲黄色录像片| 欧美成人一区二区三区片免费 | 99精品国产热久久91蜜凸| 一区二区三区小说| 日韩欧美久久久| www.亚洲色图.com| 丝瓜av网站精品一区二区| 精品少妇一区二区三区在线播放| 成人午夜激情片| 天天综合色天天综合色h| 2024国产精品| 在线国产电影不卡| 国产精品一区二区三区四区| 亚洲久本草在线中文字幕| 日韩欧美成人午夜| 91免费观看国产| 久久成人精品无人区| 亚洲免费观看视频| 精品嫩草影院久久| 欧美日韩视频一区二区| 国产乱色国产精品免费视频| 亚洲香蕉伊在人在线观| 久久蜜桃香蕉精品一区二区三区| 91国模大尺度私拍在线视频| 精品亚洲免费视频| 亚洲一区二区三区爽爽爽爽爽| 久久蜜桃一区二区| 91精品国产综合久久久久久久| 成人免费观看视频| 精品制服美女久久| 一区二区三区不卡在线观看| 国产欧美视频一区二区三区| 在线观看91av| 在线免费亚洲电影| 不卡大黄网站免费看| 九一九一国产精品| 五月婷婷激情综合网| 亚洲色图制服诱惑 | 亚洲精品乱码久久久久久日本蜜臀| 日韩免费高清电影| 精品视频一区二区不卡| 99re视频精品| 国产美女精品在线| 午夜电影一区二区| 亚洲精品亚洲人成人网| 国产精品美女久久福利网站| 久久久亚洲高清| 欧美大胆一级视频| 日韩欧美卡一卡二| 日韩欧美在线不卡| 日韩一区二区精品葵司在线| 欧美日韩午夜在线| 欧美女孩性生活视频| 欧美日韩卡一卡二| 欧美精品 国产精品| 欧美日韩一区精品| 在线成人av网站| 91精品国产综合久久精品app| 欧美日韩成人一区二区| 欧美精品久久99| 91精品国产色综合久久| 日韩欧美国产一区在线观看| 日韩一级欧美一级| 椎名由奈av一区二区三区| 国产欧美一区二区在线观看| 欧美激情资源网| 亚洲欧洲性图库| 亚洲制服丝袜av| 日韩精品一区第一页| 免费成人美女在线观看.| 极品瑜伽女神91| 成人免费视频caoporn| 99久久婷婷国产| 欧美中文字幕一区| 日韩精品自拍偷拍| 亚洲国产高清aⅴ视频| 亚洲特黄一级片| 亚洲成人tv网| 国产尤物一区二区| 99re视频精品| 欧美一区二区国产| 国产亚洲成av人在线观看导航| 中文字幕日韩一区| 亚洲aaa精品| 国内精品免费**视频| 99re在线视频这里只有精品| 欧美日韩亚洲另类| 久久这里只有精品首页| 亚洲激情图片qvod| 免费高清在线视频一区·| 岛国一区二区在线观看| 欧美日韩精品欧美日韩精品 | 美女视频网站久久| 粉嫩欧美一区二区三区高清影视| 色婷婷久久综合| 久久一夜天堂av一区二区三区| 国产精品福利一区二区| 日韩国产在线一| 成人sese在线| 555www色欧美视频| 亚洲视频你懂的| 久久精品国产77777蜜臀| 91视频一区二区三区| 精品久久免费看| 亚洲成人一区在线| bt欧美亚洲午夜电影天堂| 日韩午夜激情电影| 亚洲激情网站免费观看| 国产激情视频一区二区在线观看| 欧美亚洲动漫精品| 国产精品久久一级| 蜜桃av噜噜一区| 欧美羞羞免费网站| 国产精品国产三级国产aⅴ中文| 全国精品久久少妇| 一本久久a久久精品亚洲| 久久久亚洲午夜电影| 视频一区国产视频| 日本韩国一区二区| 国产精品久久久久久久裸模 | 亚洲一区二区三区四区在线| 成人一级视频在线观看| 精品剧情在线观看| 日本视频一区二区| 欧美三级乱人伦电影| 亚洲欧美日韩国产综合在线| 国产成a人亚洲精品| 精品国产亚洲在线| 日本不卡一二三| 6080日韩午夜伦伦午夜伦| 亚洲综合av网| 91国产丝袜在线播放| 亚洲免费观看高清完整版在线| 成人久久久精品乱码一区二区三区 | 欧美一卡二卡在线观看| 亚洲国产精品久久久久婷婷884| 不卡一卡二卡三乱码免费网站| 久久九九久精品国产免费直播| 极品美女销魂一区二区三区| 日韩欧美激情四射| 狠狠网亚洲精品| 日本一区二区免费在线| 国产不卡视频一区二区三区|