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


Java WebAppDescriptor类代码示例

本文整理汇总了Java中org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor的典型用法代码示例。如果您正苦于以下问题:Java WebAppDescriptor类的具体用法?Java WebAppDescriptor怎么用?Java WebAppDescriptor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


WebAppDescriptor类属于org.jboss.shrinkwrap.descriptor.api.webapp30包,在下文中一共展示了WebAppDescriptor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startFirst

import org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor; //导入依赖的package包/类
@Deployment(testable = false)
public static WebArchive startFirst() {
  return ShrinkWrap.create(WebArchive.class, "session-cookie-agent.war")
      .addClasses(FirstServlet2x.class, OtherServlet2x.class,
          BaseServlet.class, SomeFilter.class,
          SessionListenerCalled2x.class,
          InvalidateSession2x.class,
          CallCountingSessionListener.class)
      .setWebXML(new StringAsset(Descriptors.create(WebAppDescriptor.class).version("2.5")
      .getOrCreateContextParam().paramName(SessionConfiguration.DEFAULT_SESSION_TIMEOUT).paramValue("2").up()
      .createFilter().filterName("someFilter").filterClass(SomeFilter.class.getName()).up()
      .createServlet().servletName("firstServlet").servletClass(FirstServlet2x.class.getName()).up()
      .createServlet().servletName("secondServlet").servletClass(OtherServlet2x.class.getName()).up()
      .createServlet().servletName("invalidateServlet").servletClass(InvalidateSession2x.class.getName()).up()
      .createServlet().servletName("sessionListenerServlet").servletClass(SessionListenerCalled2x.class.getName()).up()
      .createListener().listenerClass(CallCountingSessionListener.class.getName()).up()
      .createFilterMapping().filterName("someFilter").urlPattern("/*").up()
      .createServletMapping().servletName("firstServlet").urlPattern("/FirstServlet").up()
      .createServletMapping().servletName("secondServlet").urlPattern("/OtherServlet").up()
      .createServletMapping().servletName("invalidateServlet").urlPattern("/InvalidateServlet").up()
      .createServletMapping().servletName("sessionListenerServlet").urlPattern("/SessionListener").up()
      .exportAsString()));
}
 
开发者ID:AmadeusITGroup,项目名称:HttpSessionReplacer,代码行数:24,代码来源:AgentServlet2xITSessionWithCookieSomeFilter.java

示例2: createDeployment

import org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor; //导入依赖的package包/类
@Deployment
public static WebArchive createDeployment() throws Exception {
    final WebArchive web = ShrinkWrap.create(WebArchive.class, WAR_FILE)
            .addClass(TestServlet.class)
            .addClass(TestEjb.class)
            .setWebXML(new StringAsset(Descriptors.create(WebAppDescriptor.class)
                    .createServlet().servletName(SERVLET_NAME).servletClass(TestServlet.class.getName()).up()
                    .createServletMapping().servletName(SERVLET_NAME).urlPattern(URL_PATTERN).up()
                    .exportAsString()));
    ShrinkWrap.create(EnterpriseArchive.class, EAR_FILE).addAsModule(web)
            .setApplicationXML(new StringAsset(Descriptors.create(ApplicationDescriptor.class)
                    .createModule().getOrCreateWeb().contextRoot(CONTEXT_PATH).webUri(WAR_FILE).up().up()
                    .exportAsString()))
            .as(ExplodedExporter.class).exportExploded(new File(TARGET_FOLDER));
    return ShrinkWrap.create(WebArchive.class);
}
 
开发者ID:apache,项目名称:tomee,代码行数:17,代码来源:TomEEContainerEarWithExplodedWarTest.java

示例3: createDeployment

import org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor; //导入依赖的package包/类
@Deployment(testable = false)
public static WebArchive createDeployment() {
    WebAppDescriptor descriptor = Descriptors.create(WebAppDescriptor.class)
            .version(WebAppVersionType._3_0)
            .createServlet()
            .servletName(SERVLET_NAME)
            .servletClass(DataSourceServlet.class.getName()).up()
            .createServletMapping()
            .servletName(SERVLET_NAME)
            .urlPattern("/" + TEST_NAME).up();

    WebArchive archive = ShrinkWrap.create(WebArchive.class, TEST_NAME + ".war")
            .addClass(DataSourceDefinitionTest.class)
            .addClass(DataSourceServlet.class)
            .addClass(DataSourceBean.class)
            .addClass(DataSourcePojo.class)
            .addClass(Runner.class)
            .addAsLibraries(JarLocation.jarLocation(Test.class))
            .addAsWebInfResource(new ClassLoaderAsset(CONTENT_LOCATION_EJB_JAR_XML), RESOURCE_EJB_JAR_XML)
            .setWebXML(new StringAsset(descriptor.exportAsString()));

    return archive;
}
 
开发者ID:apache,项目名称:tomee,代码行数:24,代码来源:DataSourceDefinitionTest.java

示例4: createDeployment

import org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor; //导入依赖的package包/类
public WebArchive createDeployment(Class...archiveClasses) {
    WebAppDescriptor descriptor = Descriptors.create(WebAppDescriptor.class)
            .version("3.0");
    decorateDescriptor(descriptor);

    WebArchive archive = ShrinkWrap.create(WebArchive.class, getTestContextName() + ".war")
            .setWebXML(new StringAsset(descriptor.exportAsString()))
            .addAsLibraries(JarLocation.jarLocation(Test.class))
            .addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"));
    
    if (archiveClasses != null) {
        for (Class c: archiveClasses) {
            archive.addClass(c);
        }
    }
    decorateArchive(archive);

    return archive;
}
 
开发者ID:apache,项目名称:tomee,代码行数:20,代码来源:TestSetup.java

示例5: createDeployment

import org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor; //导入依赖的package包/类
@Deployment(testable = false)
public static WebArchive createDeployment() {
    WebAppDescriptor descriptor = Descriptors.create(WebAppDescriptor.class)
            .version(WebAppVersionType._3_0)
            .createServlet()
            .servletName(SERVLET_NAME)
            .servletClass(IvmContextServlet.class.getName()).up()
            .createServletMapping()
            .servletName(SERVLET_NAME)
            .urlPattern("/" + TEST_NAME).up();

    WebArchive archive = ShrinkWrap.create(WebArchive.class, TEST_NAME + ".war")
            .addClass(IvmContextTest.class)
            .addClass(IvmContextServlet.class)
            .addClass(NamingBean.class)
            .addClass(Runner.class)
            .addAsLibraries(JarLocation.jarLocation(Test.class))
            .addAsWebInfResource(new ClassLoaderAsset(CONTENT_LOCATION_EJB_JAR_XML), RESOURCE_EJB_JAR_XML)
            .setWebXML(new StringAsset(descriptor.exportAsString()));

    return archive;
}
 
开发者ID:apache,项目名称:tomee,代码行数:23,代码来源:IvmContextTest.java

示例6: base

import org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor; //导入依赖的package包/类
public static WebArchive base(final String name) {
    final String webXml = Descriptors.create(WebAppDescriptor.class)
            .version("3.0")
            .createServlet()
                .servletName("jsf")
                .servletClass(FacesServlet.class.getName())
                .loadOnStartup(1)
            .up()
            .createServletMapping()
                .servletName("jsf")
                .urlPattern("*.xhtml") // not the default
            .up()
            .exportAsString();

    return ShrinkWrap.create(WebArchive.class, name)
            .setWebXML(new StringAsset(webXml));
}
 
开发者ID:apache,项目名称:tomee,代码行数:18,代码来源:JSFs.java

示例7: createDeployment

import org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor; //导入依赖的package包/类
@Deployment(testable = false)
public static WebArchive createDeployment() {
    WebAppDescriptor descriptor = Descriptors.create(WebAppDescriptor.class)
            .version(WebAppVersionType._3_0)
            .createServlet()
                .servletName("check").servletClass(MultiplePUServlet.class.getName()).up()
            .createServletMapping()
                .servletName("check").urlPattern("/" + TEST_NAME).up();

    WebArchive archive = ShrinkWrap.create(WebArchive.class, TEST_NAME + ".war")
            .addClass(MultiplePUServlet.class)
            .addClass(Person1.class).addClass(Person2.class)
            .addClass(Runner.class)
            .addAsLibraries(JarLocation.jarLocation(Test.class))
            .addAsResource(new ClassLoaderAsset("org/apache/openejb/arquillian/tests/persistence/multiple/persistence.xml"), "META-INF/persistence.xml")
            .setWebXML(new StringAsset(descriptor.exportAsString()));

    return archive;
}
 
开发者ID:apache,项目名称:tomee,代码行数:20,代码来源:MultiplePersistenceTest.java

示例8: createDeployment

import org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor; //导入依赖的package包/类
@Deployment(testable = false)
public static WebArchive createDeployment() {
    WebAppDescriptor descriptor = Descriptors.create(WebAppDescriptor.class)
            .version(WebAppVersionType._3_0)
            .createServlet()
            .servletName(SERVLET_NAME)
            .servletClass(SessionSynchronizationCallbackServlet.class.getName()).up()
            .createServletMapping()
            .servletName(SERVLET_NAME)
            .urlPattern("/" + TEST_NAME).up();

    WebArchive archive = ShrinkWrap.create(WebArchive.class, TEST_NAME + ".war")
            .addClass(SessionSynchronizationCallbackServlet.class)
            .addClass(StatefulBean.class)
            .addClass(TestEntity.class)
            .addClass(Runner.class)
            .addAsLibraries(JarLocation.jarLocation(Test.class))
            .addAsResource(new ClassLoaderAsset(PERSISTENCE_XML_SOURCE), PERSISTENCE_XML_DESTINATION)
            .setWebXML(new StringAsset(descriptor.exportAsString()));

    return archive;
}
 
开发者ID:apache,项目名称:tomee,代码行数:23,代码来源:SessionSynchronizationCallbackTest.java

示例9: addEnvEntry

import org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor; //导入依赖的package包/类
private static void addEnvEntry(WebAppDescriptor descriptor, String name, String type, String value) {
        Node appNode = ((NodeDescriptor) descriptor).getRootNode();
        appNode.createChild("/env-entry")
                .createChild("env-entry-name").text(name).getParent()
                .createChild("env-entry-type").text(type).getParent()
                .createChild("env-entry-value").text(value)
/*
                .parent()
                .create("injection-target")
                .create("injection-target-class").text("org.apache.openejb.arquillian.ServletPojoInjectionTest$PojoServletContextListener")
                .parent()
                .create("injection-target-name").text(name)
*/
        ;

    }
 
开发者ID:apache,项目名称:tomee,代码行数:17,代码来源:ServletListenerEjbLocalInjectionTest.java

示例10: addEnvEntry

import org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor; //导入依赖的package包/类
private static void addEnvEntry(WebAppDescriptor descriptor, String name, String type, String value) {
        Node appNode = ((NodeDescriptor) descriptor).getRootNode();
        appNode.createChild("/env-entry")
                .createChild("env-entry-name").text(name).getParent()
                .createChild("env-entry-type").text(type).getParent()
                .createChild("env-entry-value").text(value)
/*
                .parent()
                .create("injection-target")
                .create("injection-target-class").text("org.apache.openejb.arquillian.ServletPojoInjectionTest$PojoServletFilter")
                .parent()
                .create("injection-target-name").text(name)
*/
        ;

    }
 
开发者ID:apache,项目名称:tomee,代码行数:17,代码来源:ServletFilterEnvEntryInjectionTest.java

示例11: createDeployment

import org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor; //导入依赖的package包/类
@Deployment(testable = false)
public static WebArchive createDeployment() {
    WebAppDescriptor descriptor = Descriptors.create(WebAppDescriptor.class)
            .version(WebAppVersionType._3_0)
            .createServlet()
                .servletName("check").servletClass(PojoServlet.class.getName()).up()
            .createServletMapping()
                .servletName("check").urlPattern("/" + TEST_NAME).up();

    return ShrinkWrap.create(WebArchive.class, TEST_NAME + ".war")
            .addClass(PojoServlet.class)
            .addClass(CompanyLocal.class)
            .addClass(Company.class)
            .addClass(DefaultCompany.class)
            .addClass(OtherCompany.class)
            .addClass(SuperMarket.class)
            .setWebXML(new StringAsset(descriptor.exportAsString()));
}
 
开发者ID:apache,项目名称:tomee,代码行数:19,代码来源:ServletEjbLocalInjectionTest.java

示例12: createDeployment

import org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor; //导入依赖的package包/类
@Deployment(testable = false)
public static WebArchive createDeployment() {

    final WebAppDescriptor descriptor = Descriptors.create(WebAppDescriptor.class)
            .version(WebAppVersionType._3_0)
            .createServlet().servletName("servlet").servletClass(SimpleServlet.class.getName()).up()
            .createServletMapping().servletName("servlet").urlPattern("/" + TEST_NAME).up();

    WebArchive archive = ShrinkWrap.create(WebArchive.class, TEST_NAME + ".war")
            .addClass(TestRun.class)
            .addClass(SimpleServlet.class)
            .addClass(Car.class)
            .addClass(AssemblyLine.class)
            .setWebXML(new StringAsset(descriptor.exportAsString()))
            .addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"));



    return archive;
}
 
开发者ID:apache,项目名称:tomee,代码行数:21,代码来源:ServletCdiProducerTest.java

示例13: createDeployment

import org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor; //导入依赖的package包/类
@Deployment(testable = false)
public static WebArchive createDeployment() {
    WebAppDescriptor descriptor = Descriptors.create(WebAppDescriptor.class)
            .version(WebAppVersionType._3_0)
            .createServlet()
                .servletName("check").servletClass(RemoteServlet.class.getName()).up()
            .createServletMapping()
                .servletName("check").urlPattern("/" + TEST_NAME).up();

    WebArchive archive = ShrinkWrap.create(WebArchive.class, TEST_NAME + ".war")
            .addClass(RemoteServlet.class)
            .addClass(CompanyRemote.class)
            .addClass(DefaultCompany.class)
            .setWebXML(new StringAsset(descriptor.exportAsString()));



    return archive;
}
 
开发者ID:apache,项目名称:tomee,代码行数:20,代码来源:ServletEjbRemoteTest.java

示例14: createTestArchive

import org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor; //导入依赖的package包/类
@Deployment
public static Archive<?> createTestArchive() {
    return ShrinkWrap.create(WebArchive.class)
        // TODO: understand why this is duplicated in the Archive and fails since Weld 2.2.5.Final
        /* .addAsLibraries(
            Maven.configureResolver()
                .workOffline()
                .loadPomFromFile("pom.xml")
                .resolve("io.astefanutti.metrics.cdi:metrics-cdi", "org.jboss.weld.servlet:weld-servlet")
                .withTransitivity()
                .as(JavaArchive.class)) */
        .addClass(TimedMethodBean.class)
        .addClass(TimedMethodServlet.class)
        .addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"))
        .setWebXML(new StringAsset(Descriptors.create(WebAppDescriptor.class)
            .version("3.1")
            .createServlet()
                .servletClass(TimedMethodServlet.class.getName())
                .servletName("TimedMethod").up()
            .createServletMapping()
                .servletName("TimedMethod")
                .urlPattern("/timedMethod").up()
            .createListener()
                .listenerClass(Listener.class.getName()).up()
            .exportAsString()));
}
 
开发者ID:astefanutti,项目名称:metrics-cdi,代码行数:27,代码来源:TimedMethodBeanTestJava8.java

示例15: getArchive

import org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor; //导入依赖的package包/类
@Deployment(testable = false)
public static WebArchive getArchive() {

    return ShrinkWrap.create(WebArchive.class, "jsf-jms-test.war")
            .addClasses(DummyManagedBean.class)
            .addAsWebResource(new ClassLoaderAsset(
                    JMSInjectionTest.class.getPackage().getName().replace('.', '/').concat("/").concat("dummy.xhtml")), "dummy.xhtml")
            .setWebXML(new StringAsset(Descriptors.create(WebAppDescriptor.class)
                    .version("3.0")
                    .createServlet()
                        .servletName("jsf")
                        .servletClass(FacesServlet.class.getName())
                        .loadOnStartup(1)
                    .up()
                    .createServletMapping()
                        .servletName("jsf")
                        .urlPattern("*.xhtml") // not the default
                    .up()
                    .exportAsString()));
}
 
开发者ID:apache,项目名称:tomee,代码行数:21,代码来源:JMSInjectionTest.java


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