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

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

?? httpmessagereceiver.java

?? jxta平臺的開發包
?? JAVA
字號:
/* * * $Id: HttpMessageReceiver.java,v 1.25 2006/04/06 00:02:25 bondolo Exp $ * * Copyright (c) 2001 Sun Microsystems, Inc.  All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. * * 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 end-user documentation included with the redistribution, *    if any, must include the following acknowledgment: *       "This product includes software developed by the *       Sun Microsystems, Inc. for Project JXTA." *    Alternately, this acknowledgment may appear in the software itself, *    if and wherever such third-party acknowledgments normally appear. * * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" *    must not be used to endorse or promote products derived from this *    software without prior written permission. For written *    permission, please contact Project JXTA at http://www.jxta.org. * * 5. Products derived from this software may not be called "JXTA", *    nor may "JXTA" appear in their name, without prior written *    permission of Sun. * * THIS SOFTWARE IS PROVIDED ``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 SUN MICROSYSTEMS 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. * * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of Project JXTA.  For more * information on Project JXTA, please see * <http://www.jxta.org/>. * * This license is based on the BSD license adopted by the Apache Foundation. */package net.jxta.impl.endpoint.servlethttp;import java.io.File;import java.io.FileInputStream;import java.io.InputStream;import java.net.InetAddress;import java.util.Collections;import java.util.Iterator;import java.util.List;import java.util.Properties;import java.io.IOException;import java.io.FileNotFoundException;import org.apache.log4j.Level;import org.apache.log4j.Logger;import org.mortbay.http.HttpContext;import org.mortbay.http.HttpServer;import org.mortbay.http.SocketListener;import org.mortbay.http.handler.ResourceHandler;import org.mortbay.jetty.servlet.ServletHandler;import org.mortbay.util.InetAddrPort;import org.mortbay.util.Log;import net.jxta.endpoint.EndpointAddress;import net.jxta.endpoint.EndpointService;import net.jxta.endpoint.MessageReceiver;import net.jxta.endpoint.MessengerEvent;import net.jxta.endpoint.MessengerEventListener;import net.jxta.exception.PeerGroupException;import net.jxta.impl.util.TimeUtils;/** * Simple Message Receiver for server side. **/class HttpMessageReceiver implements MessageReceiver {    /**     *  Log4j logger     **/    private final static transient Logger LOG = Logger.getLogger(HttpMessageReceiver.class.getName());    /**     * the relative URI of where the message receiver servlet will be mounted.     */    private final static String MSG_RECEIVER_RELATIVE_URI = "/*";    /**     * The ServletHttpTransport that created this MessageReceiver.     **/    final ServletHttpTransport servletHttpTransport;    /**     * The public addresses for the this transport.     **/    private final List publicAddresses;    /**     *  The min threads that the HTTP server will use for handling requests.     **/    private static int MIN_LISTENER_THREADS = 10;        /**     *  The max threads that the HTTP server will use for handling requests.     **/    private static int MAX_LISTENER_THREADS = 200;        /**     *  How long a thread can remain idle until the worker thread is let go.     **/    private static long MAX_THREAD_IDLE_DURATION = 30 * TimeUtils.ASECOND;        /**     *  The Jetty HTTP Server instance.     **/    private final HttpServer server;    private final ServletHandler handler;    private final SocketListener listener;    /**     * The listener to invoke when making an incoming messenger.     **/    private MessengerEventListener messengerEventListener;    public HttpMessageReceiver(ServletHttpTransport servletHttpTransport,            List publicAddresses,            InetAddress useInterface, int port) throws PeerGroupException {        this.servletHttpTransport = servletHttpTransport;        this.publicAddresses = publicAddresses;               // read settings from the properties file        Properties prop = getJxtaProperties( new File( new File(servletHttpTransport.getEndpointService().getGroup().getStoreHome()), "jxta.properties") );                initFromProperties(prop);        if (LOG.isEnabledFor(Level.INFO)) {            StringBuffer configInfo = new StringBuffer("Configuring HTTP Servlet Message Transport : " + servletHttpTransport.assignedID );                        configInfo.append( "\n\tMin threads=" + MIN_LISTENER_THREADS );            configInfo.append( "\n\tMax threads=" + MAX_LISTENER_THREADS );            configInfo.append( "\n\tMax thread idle time=" + MAX_THREAD_IDLE_DURATION + "ms" );            LOG.info(configInfo);        }                // Disable Jetty Logging        if ( !LOG.isEnabledFor(Level.DEBUG)) {            Log.instance().disableLog();            org.mortbay.util.Code.setSuppressWarnings(true);            org.mortbay.util.Code.setDebug(false);        } else {            org.mortbay.util.Code.setSuppressWarnings(false);            org.mortbay.util.Code.setDebug(true);        }                org.mortbay.util.Code.setSuppressStack(!LOG.isEnabledFor(Level.TRACE));        // Initialize the Jetty HttpServer        server = new HttpServer();        // Create the listener and attach it to server.        InetAddrPort addrPort = new InetAddrPort(useInterface, port);        listener = new SocketListener(addrPort);        listener.setMinThreads(MIN_LISTENER_THREADS);        listener.setMaxThreads(MAX_LISTENER_THREADS);        listener.setMaxIdleTimeMs((int) MAX_THREAD_IDLE_DURATION);        server.addListener(listener);        // Create a context for the handlers at the root, then add servlet        // handler for the specified servlet class and add it to the context        HttpContext handlerContext = server.getContext("/");        handler = new ServletHandler();        handler.setUsingCookies(false);        handler.initialize(handlerContext);        // Use peer group class loader (useful for HttpMessageServlet)        handlerContext.setClassLoader(servletHttpTransport.getEndpointService().getGroup().getLoader());        handlerContext.addHandler(handler);        // Set up support for downloading midlets.        if (System.getProperty("net.jxta.http.allowdownload") != null) {            HttpContext context = server.addContext("/midlets/*");            context.setResourceBase("./midlets/");            // context.setDirAllowed(false);            // context.setServingResources(true);            // String methods[] = {"GET"};            ResourceHandler resHandler = new ResourceHandler();            // resHandler.setAllowedMethods(methods);            context.addHandler(resHandler);        }        handler.addServlet(MSG_RECEIVER_RELATIVE_URI, HttpMessageServlet.class.getName());    }        synchronized void start() throws PeerGroupException {        try {            server.start();            handler.getServletContext().setAttribute("HttpMessageReceiver", this);        } catch (Exception e) {            if (LOG.isEnabledFor(Level.ERROR)) {                LOG.error("Could not start server", e);            }            PeerGroupException failure = new PeerGroupException("Could not start server");            failure.initCause(e);            throw failure;        }        messengerEventListener = servletHttpTransport.getEndpointService().addMessageTransport(this);        if (messengerEventListener == null) {            throw new PeerGroupException("Transport registration refused");        }                if (LOG.isEnabledFor(Level.INFO)) {            LOG.info( "HTTP Servlet Transport started.");        }    }        synchronized void stop() {        servletHttpTransport.getEndpointService().removeMessageTransport(this);        messengerEventListener = null;                try {            server.stop();        } catch (InterruptedException e) {            if (LOG.isEnabledFor(Level.ERROR)) {                LOG.error("Interrupted during stop()", e);            }        }                if (LOG.isEnabledFor(Level.INFO)) {            LOG.info( "HTTP Servlet Transport stopped.");        }    }    /**     * {@inheritDoc}     **/    boolean messengerReadyEvent(HttpServletMessenger newMessenger, EndpointAddress connAddr) {        MessengerEventListener temp = messengerEventListener;                if( null != temp ) {            return temp.messengerReady(new MessengerEvent(this, newMessenger, connAddr));        } else {            return false;        }    }    /**     * {@inheritDoc}     **/    public Iterator getPublicAddresses() {        return Collections.unmodifiableList(publicAddresses).iterator();    }    /**     * {@inheritDoc}     **/    public String getProtocolName() {        return servletHttpTransport.HTTP_PROTOCOL_NAME;    }    /**     * {@inheritDoc}     **/    public EndpointService getEndpointService() {        return servletHttpTransport.getEndpointService();    }        /**     * {@inheritDoc}     **/    public Object transportControl(Object operation, Object Value) {        return null;    }    ServletHttpTransport getServletHttpTransport() {        return servletHttpTransport;    }    /**     * Returns a Properties instance for jxta.properties if the file exists;     * otherwise, returns null.     **/    private static Properties getJxtaProperties( File fromFile ) {        Properties prop = new Properties();        InputStream in = null;                try {            in = new FileInputStream(fromFile);            if (LOG.isEnabledFor(Level.DEBUG)) {                LOG.debug("Read properties from " + fromFile.getPath() );            }        } catch (FileNotFoundException e) {            if (LOG.isEnabledFor(Level.WARN)) {                LOG.warn("no properties in " + fromFile.getPath() );            }        }                if (in != null) {            try {                prop.load(in);            } catch (IOException e) {                if (LOG.isEnabledFor(Level.ERROR)) {                    LOG.error("Error reading " + fromFile.getPath(), e);                }            }            finally {                try {                    in.close();                } catch (IOException ignored) {                    ;                }                in = null;            }        } else {            if (LOG.isEnabledFor(Level.WARN)) {                LOG.warn( fromFile.getPath() + " cannot be found");            }        }                return prop;    }        /**     * Reads the properties from the jxta.properties file     **/    private void initFromProperties(Properties prop) {                if (prop != null) {            if (LOG.isEnabledFor(Level.DEBUG)) {                LOG.debug("Using jxta.properties to configure HTTP server");            }                        String minThreadsStr = prop.getProperty("HttpServer.MinThreads");            String maxThreadsStr = prop.getProperty("HttpServer.MaxThreads");            String maxThreadIdleTimeStr = prop.getProperty("HttpServer.MaxThreadIdleTime");                        try {                if (minThreadsStr != null) {                    MIN_LISTENER_THREADS = Integer.parseInt(minThreadsStr);                }            } catch (NumberFormatException e) {                if (LOG.isEnabledFor(Level.WARN)) {                    LOG.warn("Invalid HttpServer.MinThreads value; using default");                }            }                        try {                if (maxThreadsStr != null) {                    MAX_LISTENER_THREADS = Integer.parseInt(maxThreadsStr);                }            } catch (NumberFormatException e) {                if (LOG.isEnabledFor(Level.WARN)) {                    LOG.warn("Invalid HttpServer.MaxThreads value; using default");                }            }                        try {                if (maxThreadIdleTimeStr != null) {                    MAX_THREAD_IDLE_DURATION = Integer.parseInt(maxThreadIdleTimeStr);                }            } catch (NumberFormatException e) {                if (LOG.isEnabledFor(Level.WARN)) {                    LOG.warn("Invalid HttpServer.MaxThreadIdleTime value; using default");                }            }        } else {            if (LOG.isEnabledFor(Level.DEBUG)) {                LOG.debug("jxta.properties not found: using default values");            }        }    }    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品国产精品| 国产成人午夜99999| 欧美色成人综合| 亚洲精品综合在线| 成人av高清在线| 一区精品在线播放| 成人av网站在线观看| 亚洲欧美激情一区二区| 99re6这里只有精品视频在线观看| 国产视频一区在线观看| 91污片在线观看| 日韩美女视频一区| 欧美三级日韩三级国产三级| 亚洲成av人影院| 欧美一区二区精品在线| 国产成人自拍高清视频在线免费播放| 26uuu亚洲综合色| 成人av资源网站| 一区二区三区国产精品| 久久99国产精品尤物| 亚洲国产精品传媒在线观看| 91原创在线视频| 亚洲永久免费av| 日韩美一区二区三区| 国产在线不卡一区| 国产精品初高中害羞小美女文| 色综合久久天天综合网| 午夜精品成人在线视频| 日韩欧美不卡一区| 国产精品99久久久久久似苏梦涵| 亚洲欧美日韩国产手机在线| 欧美日韩不卡一区| 国产成人亚洲精品狼色在线| 亚洲色图一区二区| 欧美日韩国产成人在线免费| 国产一区91精品张津瑜| 国产精品久久777777| 在线影视一区二区三区| 久久激情五月婷婷| 一区二区三区在线观看动漫| 日韩一区二区在线观看视频播放| 成人av在线影院| 日韩激情av在线| 国产欧美一区二区精品婷婷| 7777精品伊人久久久大香线蕉经典版下载 | 欧美日韩视频专区在线播放| 高清国产一区二区三区| 一个色在线综合| 国产三级一区二区| 欧美日韩视频不卡| 成人av网在线| 国产91丝袜在线播放0| 亚洲国产欧美在线| 亚洲天堂免费看| 国产午夜精品一区二区三区嫩草| 制服丝袜国产精品| 99视频精品全部免费在线| 丝袜脚交一区二区| 一片黄亚洲嫩模| 国产欧美一区二区三区网站| 久久综合中文字幕| 欧美色国产精品| 欧美性xxxxxxxx| 成人黄色av电影| 狠狠v欧美v日韩v亚洲ⅴ| 亚洲午夜激情网站| 欧美激情综合在线| 国产亚洲自拍一区| 欧美一区二区三区视频免费| 欧美色图一区二区三区| 成人性视频免费网站| 亚洲一区二区欧美激情| 亚洲免费av网站| 中文欧美字幕免费| 国产欧美日韩精品在线| 日韩一级免费观看| 欧美一区二区三区免费在线看| 欧美伊人精品成人久久综合97| 国产精品18久久久久久久久 | 一本久道中文字幕精品亚洲嫩| 国产综合色产在线精品| 久久丁香综合五月国产三级网站| 午夜精品福利在线| 午夜欧美视频在线观看| 日韩精品亚洲专区| 天天综合色天天综合色h| 日韩国产一二三区| 亚洲国产裸拍裸体视频在线观看乱了| 亚洲二区在线视频| 亚洲午夜视频在线| 国产精品丝袜一区| 国产精品毛片a∨一区二区三区| 国产三区在线成人av| 国产欧美日韩精品一区| 日韩欧美在线1卡| 欧美一级电影网站| 欧美一级爆毛片| 国产日韩av一区二区| 国产清纯在线一区二区www| 亚洲视频免费观看| 亚洲日本va午夜在线电影| 亚洲免费观看高清完整版在线| 中文字幕一区二区三| 日本一区二区三级电影在线观看| 1024亚洲合集| 亚洲福利一区二区| 久久99国产精品免费网站| 国产精品一区二区三区网站| 99久久久国产精品免费蜜臀| 一本大道久久a久久综合婷婷| 欧美日韩国产综合视频在线观看| 91麻豆精品国产91久久久更新时间| 欧美日韩一区二区三区高清| 久久久九九九九| 国产精品久久久久久久久果冻传媒| 亚洲天堂福利av| 亚洲人成亚洲人成在线观看图片| 亚洲人成小说网站色在线| 夜夜嗨av一区二区三区四季av| 亚洲成人动漫一区| 国产尤物一区二区在线| 久久99国产精品麻豆| 99久久精品国产观看| 欧美精品色综合| 国产精品欧美一级免费| 亚洲自拍偷拍欧美| 国产黄色精品网站| 色噜噜久久综合| 久久久久久影视| 亚洲精品国产高清久久伦理二区| 亚洲精品一区二区三区在线观看| 亚洲另类在线制服丝袜| 免费欧美高清视频| 色屁屁一区二区| 精品国产1区二区| 夜夜精品浪潮av一区二区三区| 久久99九九99精品| 欧美丰满高潮xxxx喷水动漫 | 7777精品伊人久久久大香线蕉| 精品国产sm最大网站免费看| 亚洲国产精品国自产拍av| 美女精品自拍一二三四| 99精品视频在线播放观看| xfplay精品久久| 一区二区高清在线| 91蝌蚪porny| 精品成人在线观看| 夜夜精品视频一区二区 | 欧美视频一区二区在线观看| 久久这里都是精品| 亚洲免费电影在线| 国产成人免费9x9x人网站视频| 琪琪一区二区三区| 这里只有精品免费| 亚洲婷婷在线视频| 99精品国产热久久91蜜凸| 欧美精品黑人性xxxx| 亚洲一卡二卡三卡四卡五卡| 99久久精品免费精品国产| 精品免费视频.| 亚洲图片自拍偷拍| 波多野结衣的一区二区三区| 日韩欧美国产综合在线一区二区三区 | 樱桃国产成人精品视频| 狠狠色狠狠色综合系列| 在线成人高清不卡| 国产精品美女久久久久久久| 成人午夜av在线| 久久综合五月天婷婷伊人| 国产在线精品不卡| 欧美变态凌虐bdsm| 麻豆视频观看网址久久| 欧美老女人在线| 三级欧美韩日大片在线看| 91久久精品网| 天堂久久一区二区三区| 欧美午夜精品久久久久久孕妇| 午夜电影一区二区| 欧洲色大大久久| 午夜精品免费在线| 欧美视频一区二区三区四区| 日韩国产欧美三级| 91精品国产色综合久久不卡蜜臀 | 欧美日韩在线免费视频| 亚洲激情图片小说视频| 欧美视频一二三区| 午夜婷婷国产麻豆精品| 欧美系列在线观看| 欧美精品亚洲二区| 4438x亚洲最大成人网| 色琪琪一区二区三区亚洲区| 韩国三级中文字幕hd久久精品| 欧美国产精品久久| 国产精品无遮挡| 国产精品毛片a∨一区二区三区| 日韩精品中午字幕| 欧美在线你懂的| 99久久久免费精品国产一区二区 | 在线观看网站黄不卡| 国产一区不卡精品|