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

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

?? modulemanager.java

?? OSGI 的 源碼實現,采用JAVA書寫
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* * ModuleLoader - A generic, policy-driven class loader. * Copyright (c) 2004, Richard S. Hall * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * *   * Redistributions of source code must retain the above copyright *     notice, this list of conditions and the following disclaimer. *   * 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. *   * Neither the name of the ungoverned.org nor the names of its *     contributors may be used to endorse or promote products derived *     from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS 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 COPYRIGHT * OWNER OR 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. * * Contact: Richard S. Hall (heavy@ungoverned.org) * Contributor(s): ***/package org.ungoverned.moduleloader;import java.util.*;/** * <p> * The <tt>ModuleManager</tt> class is the core facility for defining a * re-usable, policy-driven class loader for applications that require * flexible class loading mechanisms. The <tt>ModuleManager</tt> is not * class loader itself, but it supports the concept of a * <a href="Module.html"><tt>Module</tt></a>, * which is a unit of organization for application classes and resources. * The <tt>ModuleManager</tt> has only a handful of methods that allow * an application to add, remove, reset, and query modules; the intent * is to place as few assumptions in the <tt>ModuleManager</tt> as possible. * </p> * <p> * The idea is simple, allow the application to map itself into modules * however it sees fit and let the <tt>ModuleManager</tt> assume the * responsibility of managing the modules and loading classes and resources * from them as necessary via <a href="ModuleClassLoader.html"><tt>ModuleClassLoader</tt></a>s * that are associated with each module. In order to achieve this goal, though, the * <tt>ModuleManager</tt> must make at least one assumption on behalf of * the application. This assumption is that the loading of classes and resources * from the available modules must happen using a search algorithm * that is particular to the application itself. As a result of this assumption, * the <tt>ModuleManager</tt> requires that the application provide a concrete * implementation of the <a href="SearchPolicy.html"><tt>SearchPolicy</tt></a> * interface. * </p> * <p> * The search policy allows the <tt>ModuleLoader</tt> to let applications inject * their own particular class loading policies, without dictating strict or * constraining base assumptions. Of course, it is likely that many applications * will use the same or very similar search policies. Because of this, another * goal of the <tt>ModuleLoader</tt> approach is to foster a common library of * search policies that applications are free to use or customize as they see * fit. These common search policies are analagous to patterns, where each search * policy is viewable as a <i>class loading pattern</i>. Some initial search * policies included with the <tt>ModuleLoader</tt> are * <a href="search/ExhaustiveSearchPolicy.html"><tt>ExhaustiveSearchPolicy</tt></a>, * <a href="search/SelfContainedSearchPolicy.html"><tt>SelfContainedSearchPolicy</tt></a>, and * <a href="search/ImportSearchPolicy.html"><tt>ImportSearchPolicy</tt></a>. * </p> * <p> * Due to the fact that class loaders are tied to security and resource loading, * the search policy alone is not sufficient for the <tt>ModuleLoader</tt> to * perform its function. To fulfill these other purposes, the <tt>ModuleLoader</tt> * introduces another policy interface, called the <a href="URLPolicy.html"><tt>URLPolicy</tt></a>. * The <tt>URLPolicy</tt> allows the application to inject its particular policy * for to purposes: * </p> * <ol> *   <li>Creating the <tt>URL</tt> associated with loading a resource, such as *       the <tt>URL</tt> returned from a call to <tt>Class.getResource()</tt>. *   </li> *   <li>Creating the <tt>URL</tt> that will be associated with a class's *       <tt>CodeSource</tt> when defining the class for purposes of security *       and assigning permissions. *   </li> * </ol> * <p> * The <tt>ModuleLoader</tt> defines a default <tt>URLPolicy</tt>, called * <a href="DefaultURLPolicy.html"><tt>DefaultURLPolicy</tt></a>, that provides * a simple <tt>URLStreamHandler</tt> for accessing resources inside of modules * and that returns <tt>null</tt> for the <tt>CodeSource</tt> <tt>URL</tt>. * Applications only need to supply their own <tt>URLPolicy</tt> if the default * one does not provide the appropriate behavior. * </p> * <p> * It is possible for an application to create multiple instances of the * <tt>ModuleManager</tt> within a single JVM, but it is not possible to * share modules across multiple <tt>ModuleManager</tt>s. A given <tt>ModuleManager</tt> * can only have one <tt>SelectionPolicy</tt> and one <tt>URLPolicy</tt>. * </p> * @see org.ungoverned.moduleloader.Module * @see org.ungoverned.moduleloader.ModuleClassLoader * @see org.ungoverned.moduleloader.SearchPolicy * @see org.ungoverned.moduleloader.URLPolicy * @see org.ungoverned.moduleloader.DefaultURLPolicy**/public class ModuleManager{    private List m_moduleList = new ArrayList();    private Map m_moduleMap = new HashMap();    private SearchPolicy m_searchPolicy = null;    private URLPolicy m_urlPolicy = null;    private ModuleListener[] m_listeners = null;    private static final ModuleListener[] m_noListeners = new ModuleListener[0];    /**     * <p>     * Constructs a <tt>ModuleManager</tt> instance using the specified     * search policy and the default <tt>URL</tt> policy.     * </p>     * @param searchPolicy the search policy that the instance should use.     * @see org.ungoverned.moduleloader.SearchPolicy    **/    public ModuleManager(SearchPolicy searchPolicy)    {        this(searchPolicy, null);    }    /**     * <p>     * Constructs a <tt>ModuleManager</tt> instance using the specified     * search policy and the specified <tt>URL</tt> policy.     * </p>     * @param searchPolicy the search policy that the instance should use.     * @param urlPolicy the <tt>URL</tt> policy that the instance should use.     * @see org.ungoverned.moduleloader.SearchPolicy     * @see org.ungoverned.moduleloader.URLPolicy    **/    public ModuleManager(SearchPolicy searchPolicy, URLPolicy urlPolicy)    {        m_listeners = m_noListeners;        m_searchPolicy = searchPolicy;        m_searchPolicy.setModuleManager(this);        if (urlPolicy == null)        {            m_urlPolicy = new DefaultURLPolicy();        }        else        {            m_urlPolicy = urlPolicy;        }    }    /**     * <p>     * Returns the <tt>URL</tt> policy used by this instance.     * </p>     * @return the <tt>URL</tt> policy used by this instance.     * @see org.ungoverned.moduleloader.URLPolicy    **/    public URLPolicy getURLPolicy()    {        return m_urlPolicy;    }    /**     * <p>     * Returns the search policy used by this instance.     * </p>     * @return the search policy used by this instance.     * @see org.ungoverned.moduleloader.SearchPolicy    **/    public SearchPolicy getSearchPolicy()    {        return m_searchPolicy;    }    /**     * <p>     * Returns an array of all modules being managed by the     * <tt>ModuleManager</tt> instance. The array contains a snapshot of     * all modules in the <tt>ModuleManager</tt> at the time when this     * method was called.     * </p>     * @return an array of all modules being managed by the <tt>ModuleManager</tt>     *         instance.     * @see org.ungoverned.moduleloader.Module    **/    public synchronized Module[] getModules()    {        Module[] modules = new Module[m_moduleList.size()];        return (Module[]) m_moduleList.toArray(modules);    }    /**     * <p>     * Returns a module associated with the specified identifier.     * </p>     * @param id the identifier for the module to be retrieved.     * @return the module associated with the identifier or <tt>null</tt>.     * @see org.ungoverned.moduleloader.Module    **/    public synchronized Module getModule(String id)    {        return (Module) m_moduleMap.get(id);    }    /**     * <p>     * Adds a module to the module manager. The module will have the specified     * unique identifier, with the associated attributes, resource sources, and     * library sources. If the identifier is not unique, then an exception is     * thrown.     * </p>     * @param id the unique identifier of the new module.     * @param attributes an array of key-value attribute pairs to     *        associate with the module.     * @param resSources an array of <tt>ResourceSource</tt>s to associate     *        with the module.     * @param libSources an array of <tt>LibrarySource</tt>s to associate     *        with the module.     * @return the newly created module.     * @throws java.lang.IllegalArgumentException if the module identifier     *         is not unique.     * @see org.ungoverned.moduleloader.Module     * @see org.ungoverned.moduleloader.ResourceSource     * @see org.ungoverned.moduleloader.LibrarySource    **/    public Module addModule(String id, Object[][] attributes,        ResourceSource[] resSources, LibrarySource[] libSources)    {        Module module = null;        // Use a synchronized block instead of synchronizing the        // method, so we can fire our event outside of the block.        synchronized (this)        {            if (m_moduleMap.get(id) == null)            {                module = new Module(this, id, attributes, resSources, libSources);                m_moduleList.add(module);                m_moduleMap.put(id, module);            }            else            {                throw new IllegalArgumentException("Module ID must be unique.");            }        }        // Fire event here instead of inside synchronized block.        fireModuleAdded(module);        return module;    }    /**     * <p>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产成人tv| 国产欧美日韩精品a在线观看| 亚洲一二三专区| 欧美日韩国产综合一区二区| 亚洲一区免费视频| 欧美日韩另类国产亚洲欧美一级| 亚洲成人一二三| 这里只有精品电影| 国产又黄又大久久| 国产精品免费av| 亚洲成人精品一区二区| 东方aⅴ免费观看久久av| 日韩欧美资源站| 国产高清视频一区| 国产精品理伦片| 欧美怡红院视频| 日韩电影在线看| 国产三级欧美三级| av成人动漫在线观看| 亚洲国产精品久久久男人的天堂| 欧美一区二区二区| 国产电影精品久久禁18| 亚洲欧美成人一区二区三区| 欧美三级日本三级少妇99| 裸体一区二区三区| 国产精品免费观看视频| 欧美性色综合网| 精品无人区卡一卡二卡三乱码免费卡 | 久久精工是国产品牌吗| 久久精品视频一区| 欧美日免费三级在线| 麻豆91精品视频| 中文字幕亚洲视频| 911国产精品| 成人自拍视频在线| 亚洲观看高清完整版在线观看| 26uuu另类欧美| 91视频免费播放| 美国三级日本三级久久99| 国产欧美视频一区二区| 欧美日韩在线直播| 国产91露脸合集magnet| 亚洲综合无码一区二区| 精品捆绑美女sm三区| 成人黄色大片在线观看| 日韩一区精品视频| 最好看的中文字幕久久| 日韩欧美高清在线| 色偷偷成人一区二区三区91| 久草在线在线精品观看| 亚洲激情在线激情| 久久理论电影网| 欧美日韩国产首页| av亚洲精华国产精华| 蜜臀久久久久久久| 一区二区三区四区乱视频| www欧美成人18+| 欧美日韩免费电影| 91亚洲国产成人精品一区二区三| 国产在线精品一区二区三区不卡| 一区二区三区中文在线| 国产亚洲综合性久久久影院| 欧美日韩国产成人在线免费| 成人av资源站| 国产精品一卡二| 日韩高清在线观看| 亚洲综合精品自拍| 国产精品色哟哟网站| 日韩一级二级三级| 欧美在线免费播放| 成人激情文学综合网| 久久精品av麻豆的观看方式| 一卡二卡欧美日韩| 中文字幕在线一区免费| 精品久久国产字幕高潮| 欧美蜜桃一区二区三区| 一本一道久久a久久精品综合蜜臀| 国产一区二区三区精品视频| 日韩精品一区第一页| 亚洲综合一区二区三区| 中文字幕色av一区二区三区| 精品国产乱子伦一区| 日韩一级精品视频在线观看| 欧美日韩另类一区| 在线日韩国产精品| 93久久精品日日躁夜夜躁欧美| 国产精品一二三区| 麻豆国产91在线播放| 三级一区在线视频先锋| 一区二区国产盗摄色噜噜| 国产精品毛片大码女人| 国产人伦精品一区二区| 日韩久久精品一区| 91精品国产91久久综合桃花| 欧美日韩一区二区三区在线看| a美女胸又www黄视频久久| 国产成人综合亚洲91猫咪| 精品一区二区三区的国产在线播放| 日韩一区欧美二区| 爽爽淫人综合网网站| 亚洲国产精品一区二区www| 亚洲综合偷拍欧美一区色| 亚洲精品乱码久久久久| ...av二区三区久久精品| 国产精品久久毛片av大全日韩| 久久精品亚洲一区二区三区浴池| 精品福利一二区| 日韩免费高清视频| 26uuu亚洲婷婷狠狠天堂| 欧美在线观看你懂的| 国内精品久久久久影院色| 国产精品天天看| 99精品视频一区| 夜夜精品视频一区二区| 日韩一级免费一区| 激情欧美一区二区| 亚洲免费电影在线| 2020国产精品自拍| 99久久国产综合色|国产精品| 夜夜夜精品看看| 亚洲美腿欧美偷拍| 波多野结衣91| a级高清视频欧美日韩| 99久久精品一区二区| 99久久国产综合精品麻豆| 91麻豆成人久久精品二区三区| 91香蕉视频mp4| 欧洲av在线精品| 69堂亚洲精品首页| 日韩欧美视频在线| 久久久久久久综合日本| 中文字幕av不卡| 亚洲品质自拍视频网站| 亚洲成人在线观看视频| 六月丁香综合在线视频| 国产成人啪免费观看软件| 99久久精品99国产精品| 欧美日韩激情一区二区三区| 精品精品欲导航| 中文字幕av免费专区久久| 一区二区三区小说| 青青草成人在线观看| 国产精品自拍av| 99综合电影在线视频| 欧美日韩精品一区二区三区蜜桃 | 7777精品伊人久久久大香线蕉 | 一区二区三区国产| 天天av天天翘天天综合网色鬼国产| 男男成人高潮片免费网站| 国产毛片精品视频| 一本大道久久a久久精品综合| 6080国产精品一区二区| 久久久亚洲欧洲日产国码αv| 成人免费小视频| 日韩不卡一区二区三区| 国产成人超碰人人澡人人澡| 在线一区二区三区四区| 日韩视频中午一区| 中文字幕亚洲在| 奇米影视7777精品一区二区| 成人免费视频国产在线观看| 欧美色精品在线视频| 久久久久久综合| 亚洲在线一区二区三区| 国产在线不卡一区| 在线亚洲+欧美+日本专区| 欧美精品一区二区三区在线播放| 国产精品久久久久精k8 | 欧美撒尿777hd撒尿| 久久综合九色综合久久久精品综合| 1024成人网| 美国毛片一区二区三区| 99久久99精品久久久久久| 91精品午夜视频| 亚洲欧洲av色图| 久久99精品一区二区三区三区| 色综合天天综合狠狠| 欧美大胆一级视频| 亚洲精品高清视频在线观看| 国产精品中文字幕一区二区三区| 在线精品视频一区二区三四| 久久精品视频网| 日本一区中文字幕| 色综合天天性综合| 久久麻豆一区二区| 日韩avvvv在线播放| 91看片淫黄大片一级| 久久精品视频在线免费观看| 日韩黄色免费网站| 色哟哟在线观看一区二区三区| 久久久久国产免费免费| 日本怡春院一区二区| 在线观看视频一区二区| 中文字幕精品一区二区精品绿巨人 | 日韩精品乱码av一区二区| 99r精品视频| 国产拍欧美日韩视频二区| 麻豆精品蜜桃视频网站| 欧美视频在线播放| √…a在线天堂一区|