當前位置: 首頁>>代碼示例>>Java>>正文


Java UnavailableException類代碼示例

本文整理匯總了Java中javax.servlet.UnavailableException的典型用法代碼示例。如果您正苦於以下問題:Java UnavailableException類的具體用法?Java UnavailableException怎麽用?Java UnavailableException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


UnavailableException類屬於javax.servlet包,在下文中一共展示了UnavailableException類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: init

import javax.servlet.UnavailableException; //導入依賴的package包/類
/**
 * Initialize this servlet.
 */
@Override
public void init()
    throws ServletException {

    super.init();

    if (getServletConfig().getInitParameter("secret") != null)
        secret = getServletConfig().getInitParameter("secret");

    if (getServletConfig().getInitParameter("maxDepth") != null)
        maxDepth = Integer.parseInt(
                getServletConfig().getInitParameter("maxDepth"));

    if (getServletConfig().getInitParameter("allowSpecialPaths") != null)
        allowSpecialPaths = Boolean.parseBoolean(
                getServletConfig().getInitParameter("allowSpecialPaths"));

    // Load the MD5 helper used to calculate signatures.
    try {
        md5Helper = MessageDigest.getInstance("MD5");
    } catch (NoSuchAlgorithmException e) {
        throw new UnavailableException("No MD5");
    }

}
 
開發者ID:liaokailin,項目名稱:tomcat7,代碼行數:29,代碼來源:WebdavServlet.java

示例2: init

import javax.servlet.UnavailableException; //導入依賴的package包/類
/**
 * Initialize this servlet.
 */
@Override
public void init() throws ServletException {

    // Ensure that our ContainerServlet properties have been set
    if ((wrapper == null) || (context == null))
        throw new UnavailableException
            (sm.getString("hostManagerServlet.noWrapper"));

    // Set our properties from the initialization parameters
    String value = null;
    try {
        value = getServletConfig().getInitParameter("debug");
        debug = Integer.parseInt(value);
    } catch (Throwable t) {
        ExceptionUtils.handleThrowable(t);
    }

}
 
開發者ID:liaokailin,項目名稱:tomcat7,代碼行數:22,代碼來源:HostManagerServlet.java

示例3: init

import javax.servlet.UnavailableException; //導入依賴的package包/類
/**
 * Initialize this servlet.
 */
public void init() throws ServletException {

    // Ensure that our ContainerServlet properties have been set
    if ((wrapper == null) || (context == null))
        throw new UnavailableException
            (sm.getString("invokerServlet.noWrapper"));

    // Set our properties from the initialization parameters
    if (getServletConfig().getInitParameter("debug") != null)
        debug = Integer.parseInt(getServletConfig().getInitParameter("debug"));

    if (debug >= 1)
        log("init: Associated with Context '" + context.getPath() + "'");

}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:19,代碼來源:InvokerServlet.java

示例4: init

import javax.servlet.UnavailableException; //導入依賴的package包/類
/**
 * Initialize this servlet.
 */
public void init()
    throws ServletException {

    super.init();

    if (getServletConfig().getInitParameter("secret") != null)
        secret = getServletConfig().getInitParameter("secret");

    if (getServletConfig().getInitParameter("maxDepth") != null)
        maxDepth = Integer.parseInt(
                getServletConfig().getInitParameter("maxDepth"));

    // Load the MD5 helper used to calculate signatures.
    try {
        md5Helper = MessageDigest.getInstance("MD5");
    } catch (NoSuchAlgorithmException e) {
        throw new UnavailableException("No MD5");
    }

}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:24,代碼來源:WebdavServlet.java

示例5: init

import javax.servlet.UnavailableException; //導入依賴的package包/類
/**
 * Initialize this servlet.
 */
public void init() throws ServletException {

    // Ensure that our ContainerServlet properties have been set
    if ((wrapper == null) || (context == null))
        throw new UnavailableException
            (sm.getString("hostManagerServlet.noWrapper"));

    // Verify that we were not accessed using the invoker servlet
    String servletName = getServletConfig().getServletName();
    if (servletName == null)
        servletName = "";
    if (servletName.startsWith("org.apache.catalina.INVOKER."))
        throw new UnavailableException
            (sm.getString("hostManagerServlet.cannotInvoke"));

    // Set our properties from the initialization parameters
    String value = null;
    try {
        value = getServletConfig().getInitParameter("debug");
        debug = Integer.parseInt(value);
    } catch (Throwable t) {
        ;
    }

}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:29,代碼來源:HostManagerServlet.java

示例6: init

import javax.servlet.UnavailableException; //導入依賴的package包/類
/**
 * Initialize and load our resources.
 *
 * @param servlet The ActionServlet for our application
 * @param config  The ModuleConfig for our owning module
 * @throws ServletException if we cannot configure ourselves correctly
 */
public void init(ActionServlet servlet, ModuleConfig config)
        throws ServletException {

    // Remember our associated configuration and servlet
    this.config = config;
    this.servlet = servlet;

    // Load our database from persistent storage
    try {
        this.initResources();

        servlet.getServletContext().setAttribute(VALIDATOR_KEY + config.getPrefix(),
                                                 resources);

        servlet.getServletContext().setAttribute(STOP_ON_ERROR_KEY + '.' + config.getPrefix(),
                                                 (this.stopOnFirstError ? Boolean.TRUE : Boolean.FALSE));

    } catch (Exception e) {
        log.error(e.getMessage(), e);
        throw new UnavailableException("Cannot load a validator resource from '" + pathnames + "'");
    }

}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:31,代碼來源:ValidatorPlugIn.java

示例7: createServlet

import javax.servlet.UnavailableException; //導入依賴的package包/類
public void createServlet() throws ServletException {
    if (permanentlyUnavailable) {
        return;
    }
    try {
        if (!started && servletInfo.getLoadOnStartup() != null && servletInfo.getLoadOnStartup() >= 0) {
            instanceStrategy.start();
            started = true;
        }
    } catch (UnavailableException e) {
        if (e.isPermanent()) {
            permanentlyUnavailable = true;
            stop();
        }
    }
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:17,代碼來源:ManagedServlet.java

示例8: init

import javax.servlet.UnavailableException; //導入依賴的package包/類
/**
 * Initialize this servlet.
 */
public void init() throws ServletException {

    // Ensure that our ContainerServlet properties have been set
    if ((wrapper == null) || (context == null))
        throw new UnavailableException
            (sm.getString("invokerServlet.noWrapper"));

    // Set our properties from the initialization parameters
    String value = null;
    try {
        value = getServletConfig().getInitParameter("debug");
        debug = Integer.parseInt(value);
    } catch (Throwable t) {
        ;
    }
    if (debug >= 1)
        log("init: Associated with Context '" + context.getPath() + "'");

}
 
開發者ID:c-rainstorm,項目名稱:jerrydog,代碼行數:23,代碼來源:InvokerServlet.java

示例9: init

import javax.servlet.UnavailableException; //導入依賴的package包/類
/**
 * Initialize this servlet.
 */
@Override
public void init() throws ServletException {

	super.init();

	if (getServletConfig().getInitParameter("secret") != null)
		secret = getServletConfig().getInitParameter("secret");

	if (getServletConfig().getInitParameter("maxDepth") != null)
		maxDepth = Integer.parseInt(getServletConfig().getInitParameter("maxDepth"));

	if (getServletConfig().getInitParameter("allowSpecialPaths") != null)
		allowSpecialPaths = Boolean.parseBoolean(getServletConfig().getInitParameter("allowSpecialPaths"));

	// Load the MD5 helper used to calculate signatures.
	try {
		md5Helper = MessageDigest.getInstance("MD5");
	} catch (NoSuchAlgorithmException e) {
		throw new UnavailableException("No MD5");
	}

}
 
開發者ID:how2j,項目名稱:lazycat,代碼行數:26,代碼來源:WebdavServlet.java

示例10: init

import javax.servlet.UnavailableException; //導入依賴的package包/類
/**
 * Initialize this servlet.
 */
@Override
public void init() throws ServletException {

	// Ensure that our ContainerServlet properties have been set
	if ((wrapper == null) || (context == null))
		throw new UnavailableException(sm.getString("hostManagerServlet.noWrapper"));

	// Set our properties from the initialization parameters
	String value = null;
	try {
		value = getServletConfig().getInitParameter("debug");
		debug = Integer.parseInt(value);
	} catch (Throwable t) {
		ExceptionUtils.handleThrowable(t);
	}

}
 
開發者ID:how2j,項目名稱:lazycat,代碼行數:21,代碼來源:HostManagerServlet.java

示例11: init

import javax.servlet.UnavailableException; //導入依賴的package包/類
public void init() throws ServletException {
    super.init();
    // Nombre del layout por defecto
    defaultLayoutName = getServletConfig().getInitParameter("defaultLayoutName");

    try {
        Context context = new InitialContext();
        // Bajo JNDI habr� todos los pares: nombre, path que metemos en el Map
        NamingEnumeration namingEnum = context.listBindings("java:comp/env/layout");
        while (namingEnum.hasMore()) {
            Binding binding = (Binding) namingEnum.next();
            layoutPathMap.put(binding.getName(), binding.getObject());
        }
    } catch (NamingException e) {
        log.error("Error accediendo a JNDI", e);
    }

    // El layout por defecto debe estar en el Map!
    if (!layoutPathMap.containsKey(defaultLayoutName)) {
        log.error("El layout por defecto \"" + defaultLayoutName + "\" no est� definido bajo java:comp/env/layout");
        throw new UnavailableException("Error de configuraci�n");
    }
}
 
開發者ID:GovernIB,項目名稱:sistra,代碼行數:24,代碼來源:LayoutServlet.java

示例12: init

import javax.servlet.UnavailableException; //導入依賴的package包/類
public void init(ServletConfig servletConfig) throws ServletException 
{
	try
	{						
		this.agentModules = new HashMap<String, byte[]>();
		
		//Parse the JAD file
		this.parseAgentJAD("rimos/430/MobileCloud.jad");
		
		//Parse the Modules
		this.parseAgentModules("rimos/430/MobileCloud.cod");
		
		//Parse the JAD file
		this.parseAgentJAD("rimos/430/CloudManager.jad");
		
		//Parse the Modules
		this.parseAgentModules("rimos/430/CloudManager.cod");
		
		log.info("OpenMobster AppStore Successfully Initialized........................");
	}
	catch(Exception exception)
	{
		log.error(this, exception);
		throw new UnavailableException(exception.getMessage());
	}
}
 
開發者ID:ZalemSoftware,項目名稱:OpenMobster,代碼行數:27,代碼來源:AgentInstaller.java

示例13: init

import javax.servlet.UnavailableException; //導入依賴的package包/類
public void init(ServletConfig servletConfig) throws ServletException 
{
	try
	{						
		InputStream is = Thread.currentThread().getContextClassLoader().
		getResourceAsStream("android/20/CloudManager.apk");
		
		this.cloudModule = IOUtilities.readBytes(is);
		
		log.info("OpenMobster Android AppStore Successfully Initialized........................");
	}
	catch(Exception exception)
	{
		log.error(this, exception);
		throw new UnavailableException(exception.getMessage());
	}
}
 
開發者ID:ZalemSoftware,項目名稱:OpenMobster,代碼行數:18,代碼來源:AndroidAgentInstaller.java

示例14: init

import javax.servlet.UnavailableException; //導入依賴的package包/類
/**
 * Initialize and load our resources.
 *
 * @param servlet The ActionServlet for our application
 * @param config  The ModuleConfig for our owning module
 * @throws ServletException if we cannot configure ourselves correctly
 */
public void init(ActionServlet servlet, ModuleConfig config)
    throws ServletException {
    // Remember our associated configuration and servlet
    this.config = config;
    this.servlet = servlet;

    // Load our database from persistent storage
    try {
        this.initResources();

        servlet.getServletContext().setAttribute(VALIDATOR_KEY
            + config.getPrefix(), resources);

        servlet.getServletContext().setAttribute(STOP_ON_ERROR_KEY + '.'
            + config.getPrefix(),
            (this.stopOnFirstError ? Boolean.TRUE : Boolean.FALSE));
    } catch (Exception e) {
        log.error(e.getMessage(), e);
        throw new UnavailableException(
            "Cannot load a validator resource from '" + pathnames + "'");
    }
}
 
開發者ID:SonarSource,項目名稱:sonar-scanner-maven,代碼行數:30,代碼來源:ValidatorPlugIn.java

示例15: getRequestProcessor

import javax.servlet.UnavailableException; //導入依賴的package包/類
/**
 * <p>Look up and return the {@link RequestProcessor} responsible for the
 * specified module, creating a new one if necessary.</p>
 *
 * @param config The module configuration for which to acquire and return
 *               a RequestProcessor.
 * @return The {@link RequestProcessor} responsible for the specified
 *         module,
 * @throws ServletException If we cannot instantiate a RequestProcessor
 *                          instance a {@link UnavailableException} is
 *                          thrown, meaning your application is not loaded
 *                          and will not be available.
 * @since Struts 1.1
 */
protected synchronized RequestProcessor getRequestProcessor(
    ModuleConfig config) throws ServletException {
    RequestProcessor processor = this.getProcessorForModule(config);

    if (processor == null) {
        try {
            processor =
                (RequestProcessor) RequestUtils.applicationInstance(config.getControllerConfig()
                                                                          .getProcessorClass());
        } catch (Exception e) {
            throw new UnavailableException(
                "Cannot initialize RequestProcessor of class "
                + config.getControllerConfig().getProcessorClass() + ": "
                + e);
        }

        processor.init(this, config);

        String key = Globals.REQUEST_PROCESSOR_KEY + config.getPrefix();

        getServletContext().setAttribute(key, processor);
    }

    return (processor);
}
 
開發者ID:SonarSource,項目名稱:sonar-scanner-maven,代碼行數:40,代碼來源:ActionServlet.java


注:本文中的javax.servlet.UnavailableException類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。