当前位置: 首页>>代码示例>>Java>>正文


Java StandardHost.setAppBase方法代码示例

本文整理汇总了Java中org.apache.catalina.core.StandardHost.setAppBase方法的典型用法代码示例。如果您正苦于以下问题:Java StandardHost.setAppBase方法的具体用法?Java StandardHost.setAppBase怎么用?Java StandardHost.setAppBase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.catalina.core.StandardHost的用法示例。


在下文中一共展示了StandardHost.setAppBase方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: prepareCatalinaComponents

import org.apache.catalina.core.StandardHost; //导入方法依赖的package包/类
private void prepareCatalinaComponents() {
    engine = new StandardEngine();
    host = new StandardHost();
    fooContext = new StandardContext();
    barContext = new StandardContext();

    Connector connector = new Connector();
    connector.setProtocol(TestConstants.SSL_PROTOCOL);
    connector.setPort(TestConstants.SSL_PORT);
    connector.setScheme(TestConstants.SSL_PROTOCOL);

    Service service = new StandardService();
    engine.setService(service);
    engine.getService().addConnector(connector);

    host.setAppBase(TestConstants.WEB_APP_BASE);
    host.setName(TestConstants.DEFAULT_TOMCAT_HOST);
    host.setParent(engine);

    fooContext.setParent(host);
    fooContext.setDocBase(TestConstants.FOO_CONTEXT);
    barContext.setParent(host);
    barContext.setDocBase(TestConstants.BAR_CONTEXT);
}
 
开发者ID:wso2-extensions,项目名称:tomcat-extension-samlsso,代码行数:25,代码来源:SAML2SSOManagerTest.java

示例2: addHostToEngine

import org.apache.catalina.core.StandardHost; //导入方法依赖的package包/类
/**
 * add host to engine.
 * 
 * @param hostName
 *            name of the host
 * @return will return the added host of Engine
 */
public static Host addHostToEngine(String hostName) {
	String hostBaseDir = CarbonUtils.getCarbonRepository() + "/"
			+ UrlMapperConstants.HostProperties.WEB_APPS + "/";
	CarbonTomcatService carbonTomcatService = DataHolder.getInstance().getCarbonTomcatService();
	// adding virtual host to tomcat engine
	Engine engine = carbonTomcatService.getTomcat().getEngine();
	StandardHost host = new StandardHost();
	host.setAppBase(hostBaseDir);
	host.setName(hostName);
	host.setUnpackWARs(false);
	host.addValve(new CarbonContextCreatorValve());
	host.addValve(new CompositeValve());
	engine.addChild(host);
	log.info("host added to the tomcat: " + host);
	return host;
}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:24,代码来源:HostUtil.java

示例3: createStandardHost

import org.apache.catalina.core.StandardHost; //导入方法依赖的package包/类
/**
 * Create a new StandardHost.
 *
 * @param parent MBean Name of the associated parent component
 * @param name Unique name of this Host
 * @param appBase Application base directory name
 * @param autoDeploy Should we auto deploy?
 * @param deployOnStartup Deploy on server startup?
 * @param deployXML Should we deploy Context XML config files property?
 * @param unpackWARs Should we unpack WARs when auto deploying?
 *
 * @exception Exception if an MBean cannot be created or registered
 */
public String createStandardHost(String parent, String name,
                                 String appBase,
                                 boolean autoDeploy,
                                 boolean deployOnStartup,
                                 boolean deployXML,                                       
                                 boolean unpackWARs)
    throws Exception {

    // Create a new StandardHost instance
    StandardHost host = new StandardHost();
    host.setName(name);
    host.setAppBase(appBase);
    host.setAutoDeploy(autoDeploy);
    host.setDeployOnStartup(deployOnStartup);
    host.setDeployXML(deployXML);
    host.setUnpackWARs(unpackWARs);

    // add HostConfig for active reloading
    HostConfig hostConfig = new HostConfig();
    host.addLifecycleListener(hostConfig);

    // Add the new instance to its parent component
    ObjectName pname = new ObjectName(parent);
    Service service = getService(pname);
    Engine engine = (Engine) service.getContainer();
    engine.addChild(host);

    // Return the corresponding MBean name
    return (host.getObjectName().toString());

}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:45,代码来源:MBeanFactory.java

示例4: createStandardHost

import org.apache.catalina.core.StandardHost; //导入方法依赖的package包/类
/**
 * Create a new StandardHost.
 *
 * @param parent MBean Name of the associated parent component
 * @param name Unique name of this Host
 * @param appBase Application base directory name
 * @param autoDeploy Should we auto deploy?
 * @param deployOnStartup Deploy on server startup?
 * @param deployXML Should we deploy Context XML config files property?
 * @param unpackWARs Should we unpack WARs when auto deploying?
 * @param xmlNamespaceAware Should we turn on/off XML namespace awareness?
 * @param xmlValidation Should we turn on/off XML validation?        
 *
 * @exception Exception if an MBean cannot be created or registered
 */
public String createStandardHost(String parent, String name,
                                 String appBase,
                                 boolean autoDeploy,
                                 boolean deployOnStartup,
                                 boolean deployXML,                                       
                                 boolean unpackWARs,
                                 boolean xmlNamespaceAware,
                                 boolean xmlValidation)
    throws Exception {

    // Create a new StandardHost instance
    StandardHost host = new StandardHost();
    host.setName(name);
    host.setAppBase(appBase);
    host.setAutoDeploy(autoDeploy);
    host.setDeployOnStartup(deployOnStartup);
    host.setDeployXML(deployXML);
    host.setUnpackWARs(unpackWARs);
    host.setXmlNamespaceAware(xmlNamespaceAware);
    host.setXmlValidation(xmlValidation);
	
    // add HostConfig for active reloading
    HostConfig hostConfig = new HostConfig();
    host.addLifecycleListener(hostConfig);

    // Add the new instance to its parent component
    ObjectName pname = new ObjectName(parent);
    Service service = getService(pname);
    Engine engine = (Engine) service.getContainer();
    engine.addChild(host);

    // Return the corresponding MBean name
    return (host.getObjectName().toString());

}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:51,代码来源:MBeanFactory.java

示例5: createStandardHost

import org.apache.catalina.core.StandardHost; //导入方法依赖的package包/类
/**
 * Create a new StandardHost.
 *
 * @param parent MBean Name of the associated parent component
 * @param name Unique name of this Host
 * @param appBase Application base directory name
 * @param autoDeploy Should we auto deploy?
 * @param deployXML Should we deploy Context XML config files property?
 * @param liveDeploy Should we live deploy?
 * @param unpackWARs Should we unpack WARs when auto deploying?
 *
 * @exception Exception if an MBean cannot be created or registered
 */
public String createStandardHost(String parent, String name,
                                 String appBase, boolean autoDeploy,
                                 boolean deployXML, boolean liveDeploy,
                                 boolean unpackWARs)
    throws Exception {

    // Create a new StandardHost instance
    StandardHost host = new StandardHost();
    host.setName(name);
    host.setAppBase(appBase);
    host.setAutoDeploy(autoDeploy);
    host.setDeployXML(deployXML);
    host.setLiveDeploy(liveDeploy);
    host.setUnpackWARs(unpackWARs);

    // Add the new instance to its parent component
    ObjectName pname = new ObjectName(parent);
    Server server = ServerFactory.getServer();
    Service service = server.findService(pname.getKeyProperty("service"));
    Engine engine = (Engine) service.getContainer();
    engine.addChild(host);

    // Return the corresponding MBean name
    ManagedBean managed = registry.findManagedBean("StandardHost");
    ObjectName oname =
        MBeanUtils.createObjectName(managed.getDomain(), host);
    return (oname.toString());

}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:43,代码来源:MBeanFactory.java

示例6: createStandardHost

import org.apache.catalina.core.StandardHost; //导入方法依赖的package包/类
/**
 * Create a new StandardHost.
 *
 * @param parent
 *            MBean Name of the associated parent component
 * @param name
 *            Unique name of this Host
 * @param appBase
 *            Application base directory name
 * @param autoDeploy
 *            Should we auto deploy?
 * @param deployOnStartup
 *            Deploy on server startup?
 * @param deployXML
 *            Should we deploy Context XML config files property?
 * @param unpackWARs
 *            Should we unpack WARs when auto deploying?
 *
 * @exception Exception
 *                if an MBean cannot be created or registered
 */
public String createStandardHost(String parent, String name, String appBase, boolean autoDeploy,
		boolean deployOnStartup, boolean deployXML, boolean unpackWARs) throws Exception {

	// Create a new StandardHost instance
	StandardHost host = new StandardHost();
	host.setName(name);
	host.setAppBase(appBase);
	host.setAutoDeploy(autoDeploy);
	host.setDeployOnStartup(deployOnStartup);
	host.setDeployXML(deployXML);
	host.setUnpackWARs(unpackWARs);

	// add HostConfig for active reloading
	HostConfig hostConfig = new HostConfig();
	host.addLifecycleListener(hostConfig);

	// Add the new instance to its parent component
	ObjectName pname = new ObjectName(parent);
	Service service = getService(pname);
	Engine engine = (Engine) service.getContainer();
	engine.addChild(host);

	// Return the corresponding MBean name
	return (host.getObjectName().toString());

}
 
开发者ID:how2j,项目名称:lazycat,代码行数:48,代码来源:MBeanFactory.java

示例7: addHostToEngine

import org.apache.catalina.core.StandardHost; //导入方法依赖的package包/类
public static Host addHostToEngine(String hostName) {
    String hostBaseDir = CarbonUtils.getCarbonRepository() + "/webapps/";
    CarbonTomcatService carbonTomcatService = DataHolder.getInstance().getCarbonTomcatService();
    // adding virtual host to tomcat engine
    Engine engine = carbonTomcatService.getTomcat().getEngine();
    StandardHost host = new StandardHost();
    host.setAppBase(hostBaseDir);
    host.setName(hostName);
    host.setUnpackWARs(false);
    host.addValve(new CarbonContextCreatorValve());
    host.addValve(new CompositeValve());
    engine.addChild(host);
    log.info("host added to the tomcat: " + host);
    return host;
}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:16,代码来源:VirtualHostClusterUtil.java

示例8: createHost

import org.apache.catalina.core.StandardHost; //导入方法依赖的package包/类
/**
 * Create, configure, and return a Host that will process all
 * HTTP requests received from one of the associated Connectors,
 * and directed to the specified virtual host.
 * <p>
 * After you have customized the properties, listeners, and Valves
 * for this Host, you must attach it to the corresponding Engine
 * by calling:
 * <pre>
 *   engine.addChild(host);
 * </pre>
 * which will also cause the Host to be started if the Engine has
 * already been started.  If this is the default (or only) Host you
 * will be defining, you may also tell the Engine to pass all requests
 * not assigned to another virtual host to this one:
 * <pre>
 *   engine.setDefaultHost(host.getName());
 * </pre>
 *
 * @param name Canonical name of this virtual host
 * @param appBase Absolute pathname to the application base directory
 *  for this virtual host
 *
 * @exception IllegalArgumentException if an invalid parameter
 *  is specified
 */
public Host createHost(String name, String appBase) {

    if (debug >= 1)
        logger.log("Creating host '" + name + "' with appBase '" +
                   appBase + "'");

    StandardHost host = new StandardHost();

    host.setAppBase(appBase);
    host.setDebug(debug);
    host.setName(name);

    return (host);

}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:42,代码来源:Embedded.java

示例9: createHost

import org.apache.catalina.core.StandardHost; //导入方法依赖的package包/类
/**
 * Create, configure, and return a Host that will process all
 * HTTP requests received from one of the associated Connectors,
 * and directed to the specified virtual host.
 * <p>
 * After you have customized the properties, listeners, and Valves
 * for this Host, you must attach it to the corresponding Engine
 * by calling:
 * <pre>
 *   engine.addChild(host);
 * </pre>
 * which will also cause the Host to be started if the Engine has
 * already been started.  If this is the default (or only) Host you
 * will be defining, you may also tell the Engine to pass all requests
 * not assigned to another virtual host to this one:
 * <pre>
 *   engine.setDefaultHost(host.getName());
 * </pre>
 *
 * @param name Canonical name of this virtual host
 * @param appBase Absolute pathname to the application base directory
 *  for this virtual host
 *
 * @exception IllegalArgumentException if an invalid parameter
 *  is specified
 */
public Host createHost(String name, String appBase) {

    if( log.isDebugEnabled() )
        log.debug("Creating host '" + name + "' with appBase '" +
                   appBase + "'");

    StandardHost host = new StandardHost();

    host.setAppBase(appBase);
    host.setName(name);

    return (host);

}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:41,代码来源:Embedded.java

示例10: createHost

import org.apache.catalina.core.StandardHost; //导入方法依赖的package包/类
/**
 * Create, configure, and return a Host that will process all HTTP requests
 * received from one of the associated Connectors, and directed to the
 * specified virtual host.
 * <p>
 * After you have customized the properties, listeners, and Valves for this
 * Host, you must attach it to the corresponding Engine by calling:
 * 
 * <pre>
 * engine.addChild(host);
 * </pre>
 * 
 * which will also cause the Host to be started if the Engine has already
 * been started. If this is the default (or only) Host you will be defining,
 * you may also tell the Engine to pass all requests not assigned to another
 * virtual host to this one:
 * 
 * <pre>
 * engine.setDefaultHost(host.getName());
 * </pre>
 *
 * @param name
 *            Canonical name of this virtual host
 * @param appBase
 *            Absolute pathname to the application base directory for this
 *            virtual host
 *
 * @exception IllegalArgumentException
 *                if an invalid parameter is specified
 */
public Host createHost(String name, String appBase) {

	if (log.isDebugEnabled())
		log.debug("Creating host '" + name + "' with appBase '" + appBase + "'");

	StandardHost host = new StandardHost();

	host.setAppBase(appBase);
	host.setName(name);

	return (host);

}
 
开发者ID:how2j,项目名称:lazycat,代码行数:44,代码来源:Embedded.java


注:本文中的org.apache.catalina.core.StandardHost.setAppBase方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。