Skip to content
/ core Public

Our internal mini core CDI JEE7 libraries.

Notifications You must be signed in to change notification settings

ds2/core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DS/2 OSS Core

Build Status

Sputnik

The OSS components of the DS/2 Core Implementation. This set of artifacts provides you with a bunch of tools and utilities to create flexible code with only small code additions. All is meant for JEE7 in mind.

Build

Gradle Wrapper

Simply run:

./gradlew clean build

Via dedicated Docker image

Run

docker run -it --rm -v $(pwd):/src dcr.ds-2.de/buildslave:0.1 ./gradlew clean build

or

docker build -f zulu.Dockerfile .

##Layers

DS/2 OSS Core uses a kind of layer architecture and provides some sample implementations for each of the layers:

  • Frontend
  • Mediate
  • Backend

The frontend deals with anything from HTTP/TCP/UDP.

The mediate layer deals with incoming data objects to access the backend.

The Backend layer is JPA, SQL etc.

Usage

To better understand this library, we use a sample project where you need some tools to develop faster.

Read properties files

For example, you need the content of a properties file in your Properties class in one of your JEE7 services. To get it, first add the ds2-oss-core-api artifact to your common deployment. Usually, you add it via Maven in scope compile:

<dependency>
  <groupId>ds2.oss.core</groupId>
  <artifactId>ds2-oss-core-api</artifactId>
  <version>RELEASE</version>
</dependency>

Then, to fill the api later with some functionality, add the core-base artifact in scope runtime:

<dependency>
  <groupId>ds2.oss.core</groupId>
  <artifactId>ds2-oss-core-base</artifactId>
  <version>RELEASE</version>
  <scope>runtime</scope>
</dependency>

You develop against the api artifact. In your class, add the properties file:

private Properties myProps;

Then add a specific annotation to it:

@PropertiesLoader
private Properties myProps;

You now have to define how to load the properties file. There are several ways. For the quickest solution and the purpose of this sample tutorial, we assume that the properties file you need is in your classpath:

@PropertiesLoader(resource="/com/test/myProps.properties")
private Properties myProps;

When you run your class now (via CDI), the properties file content will be added to your Properties field.

Also, a common way is to use a system property to tell your system where a specific properties file is. You can load it via

@PropertiesLoader(sysProp="dd.my.props.file")
private Properties myProps;

You need to run it now via

-Ddd.my.props.file=/home/test/bla/myFile.properties

Perform a release (developer only)

To perform a release, run

./gradlew clean release

About

Our internal mini core CDI JEE7 libraries.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages