• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java JAXRSArchive类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: main

import org.wildfly.swarm.jaxrs.JAXRSArchive; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
	Swarm container = new Swarm();

    System.out.println("\tBuilding kie server deployable...");
    JAXRSArchive deployment = createDeployment(container);

    container.fraction(
        new LoggingFraction()
            .consoleHandler("CONSOLE", c -> {
                c.level(Level.INFO);
                c.formatter("%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n");
            })
            .rootLogger(Level.INFO, "CONSOLE")
    );
    
    System.out.println("\tStaring Wildfly Swarm....");
    container.start();    
    
    System.out.println("\tConfiguring kjars to be auto deployed to server " + Arrays.toString(args));
    installKJars(args);
    
    System.out.println("\tDeploying kie server ....");
    container.deploy(deployment);
}
 
开发者ID:jesuino,项目名称:kie-ml,代码行数:25,代码来源:KieServerMain.java


示例2: createDeployment

import org.wildfly.swarm.jaxrs.JAXRSArchive; //导入依赖的package包/类
protected static JAXRSArchive createDeployment(Swarm container) throws Exception {
    System.out.println("\tConfiguration folder is " + configFolder);
    
    LoginModule<?> loginModule = new LoginModule<>("UsersRoles");
    loginModule.flag(Flag.REQUIRED)
    .code("UsersRoles")
    .moduleOption("usersProperties", configFolder + "/security/application-users.properties")
    .moduleOption("rolesProperties", configFolder + "/security/application-roles.properties");
    
    SecurityDomain<?> security = new SecurityDomain<>("other")
            .classicAuthentication(new ClassicAuthentication<>()
                    .loginModule(loginModule)); 
    container.fraction(new SecurityFraction().securityDomain(security));

    JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class, "kie-server.war");
    deployment.staticContent();
    deployment.addAllDependencies();
    deployment.addAsWebInfResource(new File(configFolder + "/web/web.xml"), "web.xml");
    deployment.addAsWebInfResource(new File(configFolder + "/web/jboss-web.xml"), "jboss-web.xml");
    
            
    return deployment;
    
}
 
开发者ID:jesuino,项目名称:kie-ml,代码行数:25,代码来源:AbstractKieServerMain.java


示例3: testFractionMatching

import org.wildfly.swarm.jaxrs.JAXRSArchive; //导入依赖的package包/类
@Test
public void testFractionMatching() throws Exception {
    JAXRSArchive archive = ShrinkWrap.create(JAXRSArchive.class);
    archive.addClass(MyResource.class);
    FractionUsageAnalyzer analyzer = new FractionUsageAnalyzer();

    final File out = Files.createTempFile(archive.getName(), ".war").toFile();
    archive.as(ZipExporter.class).exportTo(out, true);
    out.deleteOnExit();

    analyzer.source(out);
    assertThat(analyzer.detectNeededFractions()
                       .stream()
                       .filter(fd -> fd.getArtifactId().equals("jaxrs"))
                       .count())
            .isEqualTo(1);
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:18,代码来源:FractionUsageAnalyzerTest.java


示例4: testExplodedFractionMatching

import org.wildfly.swarm.jaxrs.JAXRSArchive; //导入依赖的package包/类
@Test
public void testExplodedFractionMatching() throws Exception {
    JAXRSArchive archive = ShrinkWrap.create(JAXRSArchive.class);
    archive.addClass(MyResource.class);
    FractionUsageAnalyzer analyzer = new FractionUsageAnalyzer();

    File dirFile = TempFileManager.INSTANCE.newTempDirectory("fractionusagetest", null);
    archive.as(ExplodedExporter.class).exportExplodedInto(dirFile);

    analyzer.source(dirFile);
    assertThat(analyzer.detectNeededFractions()
                       .stream()
                       .filter(fd -> fd.getArtifactId().equals("jaxrs"))
                       .count())
            .isEqualTo(1);
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:17,代码来源:FractionUsageAnalyzerTest.java


示例5: process

import org.wildfly.swarm.jaxrs.JAXRSArchive; //导入依赖的package包/类
@Override
public void process() throws Exception {
    if (this.deploymentContext != null && this.deploymentContext.isImplicit()) {
        return;
    }

    if (!archive.getName().endsWith(".war")) {
        return;
    }

    if (hasApplicationPathOrServletMapping(archive)) {
        return;
    }

    addGeneratedApplication(archive.as(JAXRSArchive.class));
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:17,代码来源:DefaultApplicationDeploymentProcessor.java


示例6: testApplicationPathAnnotation_None_And_ChangeThePath

import org.wildfly.swarm.jaxrs.JAXRSArchive; //导入依赖的package包/类
@Test
public void testApplicationPathAnnotation_None_And_ChangeThePath() throws Exception {
    String applicationPath = "/api";

    JAXRSArchive archive = ShrinkWrap.create(JAXRSArchive.class);
    DefaultApplicationDeploymentProcessor processor = new DefaultApplicationDeploymentProcessor(archive);
    processor.applicationPath.set(applicationPath);

    processor.process();

    try (InputStream in = archive.get(PATH).getAsset().openStream()) {
        ClassReader reader = new ClassReader(in);
        ClassNode node = new ClassNode();

        reader.accept(node, 0);
        List<AnnotationNode> visibleAnnotations = node.visibleAnnotations;

        assertThat(visibleAnnotations.size()).isEqualTo(1);
        assertThat(visibleAnnotations.get(0).values).contains(applicationPath);
    } catch (IOException ignored) {
    }
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:23,代码来源:DefaultApplicationDeploymentProcessorTest.java


示例7: droolsWar

import org.wildfly.swarm.jaxrs.JAXRSArchive; //导入依赖的package包/类
@Produces
public Archive droolsWar() throws Exception {
    if (System.getProperty("org.drools.server.swarm.web.conf") == null) {
        //Path dir = Files.createTempDirectory("swarm-keycloak-config");
        File dir = TempFileManager.INSTANCE.newTempDirectory("swarm-drools-web-config", ".d");
        System.setProperty("org.drools.server.swarm.conf", dir.getAbsolutePath());
        Files.copy(getClass().getClassLoader().getResourceAsStream("config/web/web.xml"),
                dir.toPath().resolve("web.xml"),
                StandardCopyOption.REPLACE_EXISTING);
        Files.copy(getClass().getClassLoader().getResourceAsStream("config/web/jboss-web.xml"),
                dir.toPath().resolve("jboss-web.xml"),
                StandardCopyOption.REPLACE_EXISTING);
        configFolder = dir.toPath().toString();
    }

    DroolsMessages.MESSAGES.configurationDirectory(configFolder);

    JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class, "drools-server.war");
    deployment.addAllDependencies();

    deployment.addAsWebInfResource(new File(configFolder + "/web.xml"), "web.xml");
    deployment.addAsWebInfResource(new File(configFolder + "/jboss-web.xml"), "jboss-web.xml");

    return deployment;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:26,代码来源:DroolsDeploymentProducer.java


示例8: main

import org.wildfly.swarm.jaxrs.JAXRSArchive; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
    Container container = new Container();

    JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class);
    deployment.as(TopologyArchive.class).advertise("restaurantService");
    deployment.setContextRoot("/api");
    deployment.addPackages(true, "org.jboss.shrinkwrap.api");
    deployment.addAsLibrary(container.createDefaultDeployment());
    deployment.addAllDependencies();
    container.start();
    container.deploy(deployment);

    Topology lookup = Topology.lookup();
    lookup.addListener(new TopologyListener() {
        @Override
        public void onChange(Topology tplg) {
            System.out.println(">>> Delivery Service: The Topology Has Changed!");
            printTopology(lookup);
        }
    });
    
    printTopology(lookup);

}
 
开发者ID:Salaboy,项目名称:drools-workshop,代码行数:25,代码来源:App.java


示例9: main

import org.wildfly.swarm.jaxrs.JAXRSArchive; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
    Container container = new Container();

    JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class);
    deployment.as(TopologyArchive.class).advertise("deliveryService");
    deployment.setContextRoot("/api");
    deployment.addPackages(true, "org.jboss.shrinkwrap.api");
    deployment.addAsLibrary(container.createDefaultDeployment());
    deployment.addAllDependencies();
    container.start();
    container.deploy(deployment);
    
    Topology lookup = Topology.lookup();
    lookup.addListener(new TopologyListener() {
        @Override
        public void onChange(Topology tplg) {
            System.out.println(">>> Delivery Service: The Topology Has Changed!");
            printTopology(lookup);
        }
    });
    
    printTopology(lookup);
    
}
 
开发者ID:Salaboy,项目名称:drools-workshop,代码行数:25,代码来源:App.java


示例10: main

import org.wildfly.swarm.jaxrs.JAXRSArchive; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
    Container container = new Container();

    JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class);
    deployment.as(TopologyArchive.class).advertise("foodService");
    deployment.setContextRoot("/api");
    deployment.addPackages(true, "org.jboss.shrinkwrap.api");
    deployment.addAsLibrary(container.createDefaultDeployment());
    deployment.addAllDependencies();
    container.start();
    container.deploy(deployment);
    
    Topology lookup = Topology.lookup();
    lookup.addListener(new TopologyListener() {
        @Override
        public void onChange(Topology tplg) {
            System.out.println(">>> Delivery Service: The Topology Has Changed!");
            printTopology(lookup);
        }
    });
    
    printTopology(lookup);
    
}
 
开发者ID:Salaboy,项目名称:drools-workshop,代码行数:25,代码来源:App.java


示例11: main

import org.wildfly.swarm.jaxrs.JAXRSArchive; //导入依赖的package包/类
public static void main( String[] args ) throws Exception {
    Container container = new Swarm();

    container.start();

    JAXRSArchive deployment = ShrinkWrap.create( JAXRSArchive.class );

    deployment.setContextRoot( "/api" );
    deployment.addClass( GameService.class );
    deployment.addClass( GameServiceImpl.class );
    deployment.addClass( GameSessionInfo.class );
    deployment.addAllDependencies();

    container.deploy( deployment );
}
 
开发者ID:Salaboy,项目名称:drools-game-engine,代码行数:16,代码来源:App.java


示例12: createDeployment

import org.wildfly.swarm.jaxrs.JAXRSArchive; //导入依赖的package包/类
@Deployment
public static Archive createDeployment() throws IllegalArgumentException, Exception {
    JAXRSArchive deployment = ShrinkWrap.create( JAXRSArchive.class );
    deployment.addPackages( true, "com.google.common" );
    deployment.addClass( GameService.class );
    deployment.addClass( GameServiceImpl.class );
    deployment.addClass( GameSessionInfo.class );
    
    deployment.addAllDependencies()
            .addAsManifestResource( EmptyAsset.INSTANCE, "beans.xml" );
    
    return deployment;
}
 
开发者ID:Salaboy,项目名称:drools-game-engine,代码行数:14,代码来源:GameServiceTest.java


示例13: main

import org.wildfly.swarm.jaxrs.JAXRSArchive; //导入依赖的package包/类
public static void main(String... args) throws Exception {
    swarm = new Swarm(args);
    swarm.start();
    JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class, "myapp.war");
    deployment.addClass(MyResource.class);
    deployment.setContextRoot("rest");
    deployment.addAllDependencies();
    swarm.deploy(deployment);
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:10,代码来源:Main.java


示例14: createDeployment

import org.wildfly.swarm.jaxrs.JAXRSArchive; //导入依赖的package包/类
@Deployment(testable = false)
public static Archive<?> createDeployment() throws Exception {
    JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class);
    deployment.addClass(TaggedAdvertiser.class);
    deployment.addClass(UntaggedAdvertiser.class);
    deployment.addAllDependencies();

    return deployment;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:10,代码来源:AdvertiseAndTagByAnnotationTest.java


示例15: createDeployment

import org.wildfly.swarm.jaxrs.JAXRSArchive; //导入依赖的package包/类
@Deployment(testable = false)
public static Archive<?> createDeployment() throws Exception {
    JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class);
    deployment.add(EmptyAsset.INSTANCE, "nothing");
    deployment.as(TopologyArchive.class).advertise(serviceName, asList(tag1, tag2));
    deployment.addAllDependencies();

    return deployment;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:10,代码来源:AdvertiseAndTagByMainTest.java


示例16: createDeployment

import org.wildfly.swarm.jaxrs.JAXRSArchive; //导入依赖的package包/类
@Deployment
public static Archive createDeployment() {
    JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class);
    deployment.addClass(MyApplication.class);
    deployment.addClass(MyResource.class);
    return deployment;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:8,代码来源:TopologyArquillianTest.java


示例17: createDeployment

import org.wildfly.swarm.jaxrs.JAXRSArchive; //导入依赖的package包/类
@Deployment(testable = true)
public static Archive createDeployment() throws Exception {
    JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class, "swarm_513.war");
    deployment.addResource(TicketEndpoint.class);
    deployment.addClass(Ticket.class);
    deployment.addClass(Tickets.class);
    deployment.addClass(TicketDTO.class);

    deployment.addAsWebInfResource(new ClassLoaderAsset("META-INF/persistence.xml", SWARM_513Test.class.getClassLoader()), "classes/META-INF/persistence.xml");
    deployment.addAsWebInfResource(new ClassLoaderAsset("META-INF/import.sql", SWARM_513Test.class.getClassLoader()), "classes/META-INF/import.sql");

    return deployment;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:14,代码来源:SWARM_513Test.java


示例18: createDeployment

import org.wildfly.swarm.jaxrs.JAXRSArchive; //导入依赖的package包/类
@Deployment
public static Archive createDeployment() throws Exception {
    try {
        return ShrinkWrap.createFromZipFile(JAXRSArchive.class, new File("target/endpoint.war"));
    } catch (Throwable e) {
        e.printStackTrace();
        throw e;
    }
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:10,代码来源:VerifyBuildArtefactIT.java


示例19: testWithoutSwaggerConf

import org.wildfly.swarm.jaxrs.JAXRSArchive; //导入依赖的package包/类
@Test
public void testWithoutSwaggerConf() {
    JAXRSArchive archive = ShrinkWrap.create(JAXRSArchive.class);

    archive.addResource(MyResource.class);
    archive.addResource(MyOtherResource.class);

    SwaggerArchivePreparer preparer = new SwaggerArchivePreparer(archive);
    preparer.process();

    SwaggerArchive swaggerArchive = archive.as(SwaggerArchive.class);

    assertThat(swaggerArchive.getResourcePackages()).containsOnly("com.myapp");
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:15,代码来源:SwaggerArchivePreparerTest.java


示例20: testWithSwaggerConfInRoot

import org.wildfly.swarm.jaxrs.JAXRSArchive; //导入依赖的package包/类
@Test
public void testWithSwaggerConfInRoot() {
    JAXRSArchive archive = ShrinkWrap.create(JAXRSArchive.class);

    archive.addResource(MyResource.class);
    archive.addResource(MyOtherResource.class);
    archive.add(new ByteArrayAsset("packages: com.myapp.mysubstuff".getBytes()), "META-INF/swarm.swagger.conf");

    SwaggerArchivePreparer preparer = new SwaggerArchivePreparer(archive);
    preparer.process();

    SwaggerArchive swaggerArchive = archive.as(SwaggerArchive.class);

    assertThat(swaggerArchive.getResourcePackages()).containsOnly("com.myapp.mysubstuff");
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:16,代码来源:SwaggerArchivePreparerTest.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MongoClient类代码示例发布时间:2022-05-22
下一篇:
Java Descriptor类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap