Adam Bien's Weblog

Java EE 8 Security API 1.0-m01 Is Available For Testing

Version 1.0-m01 of soteria, the Java EE 8 Security (JSR 375) (see all Java EE 8 specs), is available for testing on recent Java EE 7 servers.

Soteria comes with a set of useful sample use cases, from DB, over LDAP, to custom identity stores. Soteria is running on WildFly/JBoss, TomEE and Payara (see compatibility).

See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.


NEW workshop: Building HTML 5 Applications With React.js
On demand workshops: Java EE 7 Bootstrap, Effective Java EE 7, Java EE 7 Testing and NEW: Java EE 7 Microservices are available for streaming

Newsletter: airhacksnews.com

A book about rethinking Java EE Patterns

Managing Break Parts For Cars With Java EE 7

Tim, please introduce yourself

Hello Adam. My name is Tim Brückner, I am 34 years old and work as IT consultant and software developer. I live close to the lovely city of Marburg (Germany). About five years ago I took the chance to start my own business (a cup of software) as a freelancer and since then I was able to build up a small team of 4 developers.

What are you building with Java EE?

We are developing a B2B platform for the automotive sector. Our application helps dealers and garages to improve the process of ordering spare parts at their suppliers. For some cars one can choose from more than 30 different brake pads for example. Looking up every brake pad at every supplier manually in order to compare them is way too much work to do and that is where our application comes into play.
The application can be used to provide quotes to customers as well as to order spare parts at various suppliers. It helps identifying and comparing parts and connects to third party software like ERP systems.
Our frontend is written in JSF using PrimeFaces. Our backend is built with Java EE 7 and Java 8 running on Wildfly. We are using Groovy to connect to the web services of spare part suppliers in order to fetch prices and check the availability of articles, as well as to place orders from within the application.
The platform provides a REST API which is used by third party companies to integrate the application into the business processes of their customers. We have written Android and iOS clients which utilize the same API.
We started building the application as a monolith, but as the number of installations rose, we decided to pull out parts of the application which could be hosted as a centralized service. So we are currently in the process of moving from a monolith to SCSs (self contained systems).
Our latest addition to the platform is the implementation of a spare parts catalogue based on TecDoc data. It is used to lookup and identify spare parts in the context of a specific car.

Can you share with us some geeky numbers like e.g. TX per seconds, heap sizes etc -- whatever Java EE devs might find interesting.

We run multiple instances of the application - one for each customer. Each instance runs on a dedicated Wildfly application server and utilizes about 2GB of heap memory average. There are currently about 50 parallel user sessions per instance. Each instance of the application holds around 11 to 16 million article entries (about 50-75GB) containing supplier specific information like prices and order numbers. The spare parts catalogue holds about 3.8 million articles and about 125GB of images and documents.

Are you happy with Java EE so far? Is Java EE productive?

I am happy with Java EE and I think Java EE is very productive. Thanks to principles like convention over configuration and context and dependency injection one can easily focus on implementing the business logic instead of writing boilerplate code. This leads to a leaner implementation of features and therefore this boosts the readability and maintainability of the code as well. Since Java EE is a vendor neutral specification it is possible to stay flexible and switch the implementation behind an API or to switch the application server (what we did). Searching for answers and help is straight forward since the spec is well documented and the community is great. Java EE is like a swiss army knife for enterprise projects: There is an API for almost every aspect of an enterprise application and the container takes care of most of the technically complex aspects like transaction management or connection pooling for example.
In terms of productivity I am a big friend of PrimeFaces. Since our customer agreed on using the PrimeFaces components we could implement most views of our application pretty easily. We did some CSS skinning though, but most of the time we do not have issues with PrimeFaces updates.

Which application servers, tools or IDEs are you using?

We started with Java EE 6 and Glassfish 3 then migrated to Java EE 7, Java 8 and Wildfly. We used Netbeans for a while (we still use the Netbeans profiler) but switched to IntelliJ about two years ago. I like both IDEs. I think Netbeans has the better Maven integration. We are using the Atlassian suite (JIRA, Confluence, Bitbucket and Bamboo) in order to stay organized, as Git repository and as CI system. We are using PostgreSQL with JPA. Redis and MongoDB are being accessed natively. Docker is the newest addition to our tool stack.

You are using the Boundary Control Entity pattern to structure your applications. What were your experiences, challenges and findings so far?

Well we committed on using BCE in our project as a rule of thumb for structuring the application. BCE works great so far, but we also had some challenges to master like for example to determine where static helpers belong which may be accessed throughout the application. Or how to handle rather technical implementations which are not part of a business component or used by multiple business components like a factory for REST clients for example. What about CDI events? We made most of them part of the boundaries since they observe them. Should REST endpoints be boundaries or access boundaries themselves? We decided to make them access boundaries since the boundary could then be used from within the JSF presentation layer as well as from within the REST endpoint without the need to use DTOs within JSF.
The most difficult part was to identify the business components and to omit cyclic dependencies between them. We are using CDI events to decouple the components.

How important are standards for you? Does your application depend on application server specific APIs?

Since we are a small team it is very important for us to focus on standards because we want to spend our time implementing features for our customer instead of evaluating vendor specific libraries or frameworks. Introducing vendor specific libraries also introduces risks. We do not have the time to maintain those libraries if they are no longer supported for example. We don't want to refactor the application with every update of a library because method signatures change. We do not want to get into dependency hell if transient dependencies of libraries clash with with the libraries implementing the Java EE APIs.
Of course it is not always possible to stick to the standard, but we try to do it whenever possible.
We are using some server specific APIs for example the ResteasyClientBuilder in order to set the timeout on the REST client and in order to use the BrowserCache feature. We are using Eclipselink as persistence provider on Wildfly instead of Hibernate and of course the Eclipselink specific properties within the persistence.xml.

Which Java EE APIs are you using in your products?

We are mainly using JSF, CDI, EJB, JPA, JAX-RS and Servlet.

Take a look at the Java EE 8 APIs. Which of the APIs are most interesting / important to you?

Security (JSR 375), JAX-RS (JSR 370), JSON-B (JSR 367), CDI (JSR 365)

Can you share any resources (blogs, etc feel free to promote yourself) with us?

Whenever I search the web in order to solve some Java EE riddle I stumble upon posts of Arjan Tjims (http://arjan-tijms.omnifaces.org) or Bauke Scholz aka Balus C (http://balusc.omnifaces.org). I like to follow the Netflix tech blog (http://techblog.netflix.com). And since server side JavaScript development becomes more and more relevant I can recommend reading the following article: https://www.toptal.com/nodejs/why-the-hell-would-i-use-node-js


NEW workshop: Building HTML 5 Applications With React.js
On demand workshops: Java EE 7 Bootstrap, Effective Java EE 7, Java EE 7 Testing and NEW: Java EE 7 Microservices are available for streaming

Newsletter: airhacksnews.com

A book about rethinking Java EE Patterns

The Public Java EE 8 Mail Archives

A compilation of links to the public mail archives of the various Java EE 8 specifications. Your daily, composite digest:

  1. https://java.net/projects/javaee-spec/lists/users/archive
  2. JCache Mailing List
  3. https://java.net/projects/jsonb-spec/lists/users/archive
  4. https://java.net/projects/mvc-spec/lists/users/archive
  5. https://java.net/projects/javaee-mgmt/lists/users/archive
  6. https://java.net/projects/javaee-security-spec/lists/users/archive
  7. https://java.net/projects/javaserverfaces-spec-public/lists/users/archive
  8. https://java.net/projects/jax-rs-spec/lists/users/archive
  9. https://java.net/projects/servlet-spec/lists/users/archive
  10. https://java.net/projects/jms-spec/lists/users/archive
  11. http://lists.jboss.org/pipermail/cdi-dev/
  12. https://java.net/projects/portletspec3/lists/jsr362-observers/archive
  13. https://java.net/projects/websocket-spec/lists/users/archive
  14. https://java.net/projects/json-processing-spec/lists/users/archive
  15. https://java.net/projects/jbatch/lists/public/archive
  16. http://lists.jboss.org/pipermail/beanvalidation-dev/
  17. https://java.net/projects/ejb-spec/lists/users/archive
  18. https://java.net/projects/jpa-spec/lists/users/archive
  19. https://java.net/projects/el-spec/lists/users/archive
  20. https://java.net/projects/concurrency-ee-spec/lists/users/archive
  21. https://java.net/projects/connector-spec/lists/users/archive
  22. https://java.net/projects/jta-spec/lists/users/archive
  23. https://java.net/projects/jsp/lists/users/archive
  24. https://java.net/projects/jax-ws/lists/users/archive

See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.


NEW workshop: Building HTML 5 Applications With React.js
On demand workshops: Java EE 7 Bootstrap, Effective Java EE 7, Java EE 7 Testing and NEW: Java EE 7 Microservices are available for streaming

Newsletter: airhacksnews.com

A book about rethinking Java EE Patterns

Simplest Possible REST Client

To access the Simplest Possible REST Endpoint from Java, you will have to implement some code:


import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;

  final String URI = "http://localhost:8080/hello-rest/resources/message";
		//...
        Client client = ClientBuilder.newClient();
        String result = client.target(URI).
                request().
                get(String.class);
        assertThat(result, containsString("duke"));

For server-to-server communication no additional dependency is required. If you are using the client as test driver, you will have to declare the dependency to the SPI of you choice e.g.


<dependency>
  <groupId>org.glassfish.jersey.core</groupId>
  <artifactId>jersey-client</artifactId>
  <version>2.21</version>
</dependency>

See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.


NEW workshop: Building HTML 5 Applications With React.js
On demand workshops: Java EE 7 Bootstrap, Effective Java EE 7, Java EE 7 Testing and NEW: Java EE 7 Microservices are available for streaming

Newsletter: airhacksnews.com

A book about rethinking Java EE Patterns

Guardians, Tenants, NIO 2, BPM, Docker and Service Discovery, or 26th airhacks.tv

New record: >130 viewers from all over the world watched live the 26th edition of airhacks.tv discussing questions from various topics:

Any questions left? Ask now: https://gist.github.com/ and join the conversation at each first Monday of the month at 6 P.M. live. No registration or any other commitment required.

See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.


NEW workshop: Building HTML 5 Applications With React.js
On demand workshops: Java EE 7 Bootstrap, Effective Java EE 7, Java EE 7 Testing and NEW: Java EE 7 Microservices are available for streaming

Newsletter: airhacksnews.com

A book about rethinking Java EE Patterns

26th Airhacks Q&A: Java EE Guardians, Microservices, Highperformance JSF, Microservices Challenges

Today (Monday) at 6 pm CET I will discuss the following topics:

  1. Java EE 8 News, the guardians and the background
  2. JSF 2, NIO, asynchronous programming, performance and 2k concurrent users
  3. Injecting subtypes and delayed execution
  4. Character encoding and JAX-RS
  5. How to deal with shared business methods (IBAN)
  6. Subjective opinions about BPM with objective arguments
  7. JPA entity injection and merging best practices
  8. Multitenancy in Java EE
  9. How to pass tenant information with the request?
  10. How to migrate away from RichFaces?
  11. Source code analysis for transaction processing
  12. Where to put BaseEntity in ECB?
  13. Redeployment in Docker
  14. Distributed service discovery, distributed transactions, logging and debugging and microservices

Ask questions during the show via twitter mentioning me: http://twitter.com/AdamBien (@AdamBien) or using the hashtag: #airhacks, or the built-in chat http://www.ustream.tv/channel/adambien. You can join the Q&A session live each first Monday of month, 6 P.M at airhacks.io or http://www.ustream.tv/channel/adambien

See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.


NEW workshop: Building HTML 5 Applications With React.js
On demand workshops: Java EE 7 Bootstrap, Effective Java EE 7, Java EE 7 Testing and NEW: Java EE 7 Microservices are available for streaming

Newsletter: airhacksnews.com

A book about rethinking Java EE Patterns

Simplest Possible REST Endpoint

The following GET-request:


http://localhost:8080/hello-rest/resources/message

invokes the method whatever:

import javax.ws.rs.GET;
import javax.ws.rs.Path;

@Path("message")
public class MessageResource {
    @GET
    public String whatever() {
        return "hey, duke!";
    }
}

from a WAR with th name hello-rest and configured application path:

import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;

@ApplicationPath("resources")
public class JAXRSConfiguration extends Application {}

You only need a single dependency to compile the sample:

<dependency>
	<groupId>javax</groupId>
	<artifactId>javaee-api</artifactId>
	<version>7.0</version>
	<scope>provided</scope>
</dependency>

  1. No further configuration is required
  2. No XML is involved (web.xml is not needed)
  3. The size of the hello-rest.war is 3.2 kB
  4. Deployment takes milliseconds
Optional speedup: Java EE 7 essential archetype would create an empty maven project for you.

See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.


NEW workshop: Building HTML 5 Applications With React.js
On demand workshops: Java EE 7 Bootstrap, Effective Java EE 7, Java EE 7 Testing and NEW: Java EE 7 Microservices are available for streaming

Newsletter: airhacksnews.com

A book about rethinking Java EE Patterns

MVC, MVP, IoC, DI or A Deeper Dive Into afterburner.fx

What is the difference between MVC and MVP? How does the Dependency Injection work? Is it possible to UI-designers in production? How to implement an extension mechanism with plain Java SE? In this late night session I answered most of the questions with code as well as explained the inner workings of afterburner.fx.

Thanks to Silicon Valley JavaFX User Group for hosting this event.

Any questions left? Then join the conversation at each first Monday of the month at 6 P.M. live. No registration or any other commitment required. Checkout also past shows.

See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.


NEW workshop: Building HTML 5 Applications With React.js
On demand workshops: Java EE 7 Bootstrap, Effective Java EE 7, Java EE 7 Testing and NEW: Java EE 7 Microservices are available for streaming

Newsletter: airhacksnews.com

A book about rethinking Java EE Patterns

afterburner.fx v1.7.0 "Branch Terminator" Released

afterburner.fx is an opinionated MVP framework with built-in, conventional Dependency Injection implemented by a single class.

The v1.7.0 release comes with swappable DI mechanism. An extensible DI enables the contributors to implement project-specific conventions and will so eliminate many open pull request. The release v1.7.0 also deprecates the "Top Gun" branch.

To create your own Injector:

  1. Implement the functional interface: com.airhacks.afterburner.injection.PresenterFactory
  2. Specify the fully qualified name of the implementation in the file: META-INF/services/com.airhacks.afterburner.injection.PresenterFactory

A no-op injector already ships with afterburner.fx as a part of the unit test:


public class DebuggingInjector implements PresenterFactory {

    @Override
    public <T> T instantiatePresenter(Class<T> clazz, Function<String, Object> injectionContext) {
        System.out.println("--- clazz " + clazz + " context " + injectionContext);
        return Injector.instantiatePresenter(clazz, injectionContext);
    }

}

Checkout github.com/AdamBien/afterburner.fx. The v1.7.0 is already available in maven central:

<dependency>
  <groupId>com.airhacks</groupId>
  <artifactId>afterburner.fx</artifactId>
  <version>1.7.0</version>
</dependency>

Also take a look at: github.com/Naoghuman/NetBeansIDE-AfterburnerFX-Plugin

See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.


NEW workshop: Building HTML 5 Applications With React.js
On demand workshops: Java EE 7 Bootstrap, Effective Java EE 7, Java EE 7 Testing and NEW: Java EE 7 Microservices are available for streaming

Newsletter: airhacksnews.com

A book about rethinking Java EE Patterns

@Stateless As JAX-RS Resource?

@Stateless EJBs are an interesting component to be used as JAX-RS resource. They come with out-of-the-box method monitoring:

Are you interested in monitoring and microservices? Checkout javaeemicro.services

See you at HTML 5, JavaScript, Microservices and Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.


NEW workshop: Building HTML 5 Applications With React.js
On demand workshops: Java EE 7 Bootstrap, Effective Java EE 7, Java EE 7 Testing and NEW: Java EE 7 Microservices are available for streaming

Newsletter: airhacksnews.com

A book about rethinking Java EE Patterns

realworldpatterns.com
Online Workshops
...the last 150 posts
...the last 10 comments
License