本文整理汇总了Java中org.wildfly.swarm.Swarm.start方法的典型用法代码示例。如果您正苦于以下问题:Java Swarm.start方法的具体用法?Java Swarm.start怎么用?Java Swarm.start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.wildfly.swarm.Swarm
的用法示例。
在下文中一共展示了Swarm.start方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import org.wildfly.swarm.Swarm; //导入方法依赖的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);
}
示例2: testDeploymentFailure
import org.wildfly.swarm.Swarm; //导入方法依赖的package包/类
@Test
public void testDeploymentFailure() throws Exception {
Swarm swarm = new Swarm();
swarm.start();
JARArchive a = ShrinkWrap.create(JARArchive.class, "bad-deployment.jar");
a.addModule("com.i.do.no.exist");
try {
swarm.deploy(a);
fail("should have throw a DeploymentException");
} catch (DeploymentException e) {
// expected and correct
assertThat(e.getArchive()).isSameAs(a);
assertThat(e.getMessage()).contains("org.jboss.modules.ModuleNotFoundException: com.i.do.no.exist");
} finally {
swarm.stop();
}
}
示例3: main
import org.wildfly.swarm.Swarm; //导入方法依赖的package包/类
public static void main(String... args) throws Exception {
swarm = new Swarm(args);
swarm.start();
Archive<?> deployment = swarm.createDefaultDeployment();
if (deployment == null) {
throw new Error("Couldn't create default deployment");
}
Node persistenceXml = deployment.get("WEB-INF/classes/META-INF/persistence.xml");
if (persistenceXml == null) {
throw new Error("persistence.xml is not found");
}
if (persistenceXml.getAsset() == null) {
throw new Error("persistence.xml is not found");
}
swarm.deploy(deployment);
}
示例4: main
import org.wildfly.swarm.Swarm; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
Swarm swarm = new Swarm();
WARArchive deployment = ShrinkWrap.create(WARArchive.class);
deployment.
addAllDependencies().
addClass(JaxRsActivator.class).
addAsServiceProvider(Extension.class, K8SExtension.class).
addPackages(true,"ch.trivadis.workshop");
deployment.staticContent();
swarm.start();
swarm.deploy(deployment);
}
示例5: testDeploymentSuccess
import org.wildfly.swarm.Swarm; //导入方法依赖的package包/类
@Test
public void testDeploymentSuccess() throws Exception {
Swarm swarm = new Swarm();
swarm.start();
JARArchive a = ShrinkWrap.create(JARArchive.class, "good-deployment.jar");
a.add(EmptyAsset.INSTANCE, "nothing.xml");
swarm.deploy(a);
swarm.stop();
}
示例6: main
import org.wildfly.swarm.Swarm; //导入方法依赖的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);
}
示例7: main
import org.wildfly.swarm.Swarm; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
Swarm swarm = new Swarm();
swarm.start();
swarm.deploy();
}
示例8: main
import org.wildfly.swarm.Swarm; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
ClassLoader cl = Main.class.getClassLoader();
URL stageConfig = cl.getResource("project-stages.yml");
Preconditions.checkNotNull(stageConfig, "stageConfig");
Swarm swarm = new Swarm(false, args)
.withStageConfig(stageConfig);
swarm.start();
swarm.deploy();
}