Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Cloud Development with WildFly

You're reading from   Hands-On Cloud Development with WildFly Develop, deploy, and configure cloud-based, enterprise Java applications with WildFly Swarm and OpenShift

Arrow left icon
Product type Paperback
Published in Mar 2018
Publisher Packt
ISBN-13 9781786462374
Length 310 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Tomasz Adamski Tomasz Adamski
Author Profile Icon Tomasz Adamski
Tomasz Adamski
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Java EE and Modern Architectural Methodologies FREE CHAPTER 2. Getting Familiar with WildFly Swarm 3. Right-Sizing Your Services 4. Tuning the Configuration of Your Services 5. Testing Your Services with Arquillian 6. Deploying Applications on the Cloud with OpenShift 7. Configuring Storage for Your Applications 8. Scaling and Connecting Your Services 9. Configuring Continuous Integration Using Jenkins 10. Providing Security Using Keycloak 11. Adding Resilience Using Hystrix 12. Future Direction 13. Other Books You May Enjoy

Mixing the configurations

Now, what about mixing configurations? Are you allowed to do this? Yup. Let's look at the following code:

package org.packt.swarm.petstore.catalog;

import org.jboss.shrinkwrap.api.Archive;
import org.wildfly.swarm.Swarm;
import org.wildfly.swarm.datasources.DatasourcesFraction;
import org.wildfly.swarm.undertow.UndertowFraction;

public class Main {

public static void main(String[] args) throws Exception {
Swarm swarm = new Swarm();

//1
ClassLoader cl = Main.class.getClassLoader();
URL xmlConfig = cl.getResource("standalone.xml");
swarm.withXMLFile(xmlFile);


//2
UndertowFraction undertowFraction = new UndertowFraction();
undertowFraction.applyDefaults();
undertowFraction.httpPort(12345);
swarm.fraction(undertowFraction);


//3
Archive<?> deployment = swarm.createDefaultDeployment();
deployment.addModule("com.h2database.h2");

...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image