当前位置: 首页>>代码示例>>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;未经允许,请勿转载。