echocat Jomon Maven-Common

Collection of many useful tools for Java. Could be compared with apache-commons.

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

org.echocat.jomon.maven
ArtifactId

ArtifactId

common
Last Version

Last Version

1.6.3
Release Date

Release Date

Type

Type

jar
Description

Description

echocat Jomon Maven-Common
Collection of many useful tools for Java. Could be compared with apache-commons.
Project Organization

Project Organization

echocat

Download common

How to add to project

<!-- https://jarcasting.com/artifacts/org.echocat.jomon.maven/common/ -->
<dependency>
    <groupId>org.echocat.jomon.maven</groupId>
    <artifactId>common</artifactId>
    <version>1.6.3</version>
</dependency>
// https://jarcasting.com/artifacts/org.echocat.jomon.maven/common/
implementation 'org.echocat.jomon.maven:common:1.6.3'
// https://jarcasting.com/artifacts/org.echocat.jomon.maven/common/
implementation ("org.echocat.jomon.maven:common:1.6.3")
'org.echocat.jomon.maven:common:jar:1.6.3'
<dependency org="org.echocat.jomon.maven" name="common" rev="1.6.3">
  <artifact name="common" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.echocat.jomon.maven', module='common', version='1.6.3')
)
libraryDependencies += "org.echocat.jomon.maven" % "common" % "1.6.3"
[org.echocat.jomon.maven/common "1.6.3"]

Dependencies

compile (9)

Group / Artifact Type Version
org.echocat.jomon.spring : common jar 1.6.3
org.echocat.jomon.net : common jar 1.6.3
commons-io : commons-io jar 2.5
org.apache.commons : commons-lang3 jar 3.4
org.slf4j : slf4j-api jar 1.7.21
org.apache.maven : maven-core jar 3.0.4
org.apache.maven : maven-embedder jar 3.0.4
org.apache.maven : maven-plugin-api jar 3.0.4
com.google.code.findbugs : jsr305 jar 3.0.1

test (3)

Group / Artifact Type Version
org.echocat.jomon : testing jar 1.6.3
org.echocat.jomon.net : testing jar 1.6.3
ch.qos.logback : logback-classic jar 1.1.7

Project Modules

There are no modules declared in this project.

echocat Jomon

…is a library comparable with Apache Commons and it extends also Apache Commons but it contains a lot of other useful tools for Java.

Highlights

Cache

Very simple Cache-Interface org.echocat.jomon.cache.Cache which provides basic operations to access caches.

There are extensions (of this interface) that adds some more features to the basic settings of the caches. This extensions are not implemented in the basic interface because that are no guarantee to have these features. Examples:

  • org.echocat.jomon.cache.ClearableCache to clear/flush all entries of a cache
  • org.echocat.jomon.cache.LimitedCache to retrieve /add limitations of a cache
  • org.echocat.jomon.cache.StatisticsEnabledCache to retrieve statistic information about a cache

Currently there are basic implementations available:

org.echocat.jomon.cache.CombinedCache which makes it possible to stack multiple Cache
org.echocat.jomon.cache.ServletRequestBasedCache which provides caching based on a ServletRequest
org.echocat.jomon.cache.LfuCache Least Frequently Used
org.echocat.jomon.cache.LruCache Least Recently Used
org.echocat.jomon.cache.FifoCache First In First Out

Retrieve an instance of a Cache?

cacheProvider.provide(getClass(), "hostToIp",
    lruCache(String.class, String.class).withCapacity(10000).withMaximumLifetime("1h")
);

See org.echocat.jomon.cache.management.CacheProvider, org.echocat.jomon.cache.management.DefaultCacheDefinition.lruCache() and org.echocat.jomon.cache.management.DefaultCacheRepository.

Generator

We created a pattern to simple generate objects. This pattern defines that there is an singleton of a generator and this generator will generator an object instance for a given requirement.

See the org.echocat.jomon.demo.generator.EmployeeGeneratorUnitTest to see how it works.

Repository

…is another pattern. It is another way to receive elements, create, update and delete it instead of using the DAO-Pattern. Our interface structure is a simple presentation of this pattern.

See the org.echocat.jomon.demo.repository.EmployeeRepositoryUnitTest to see how it works.

Simple Cluster

org.echocat.jomon.net.cluster.channel.ClusterChannel is a basic way to send and receive messages in a cluster environment between JVMs. There are two implementations for Mutlicast and TCP.

There are also usages by org.echocat.jomon.net.cluster.cache.RemoveOverClusterListener which makes it possible that a remove on an entity in a cache will flushed over the whole cluster.

SRV Services

The org.echocat.jomon.net.cluster.channel.tcp.TcpClusterChannel does use SRV-Records to determinate all possible nodes in a cluster. It depends on the org.echocat.jomon.net.service.SrvEntryBasedServicesManager.

You just have to reconfigure the DNS-Server entries and the nodes in the cluster will recognize this change in a period of 10 seconds without an restart of the application.

Config:

TcpClusterChannel.service = ttc
TcpClusterChannel.remoteAddresses = cluster.example.com

Hosts:

_ttc._tcp.cluster.example.com. 86400 IN SRV 10 60 5060 node1.example.com.
_ttc._tcp.cluster.example.com. 86400 IN SRV 10 60 5060 node2.example.com.
_ttc._tcp.cluster.example.com. 86400 IN SRV 10 60 5060 node3.example.com.

Other useful stuff

org.echocat.jomon.runtime.util.Duration Do not use long milliseconds anymore – use an entity
org.echocat.jomon.runtime.util.ByteUnit Could be compared with TimeUnit
org.echocat.jomon.runtime.util.ByteCount Do not use long bytes anymore – use an entity
org.echocat.jomon.runtime.util.Range An interface with a lot of basic implementations for a range of something (ex: a date)
org.echocat.jomon.runtime.concurrent.Retryer A way to retry something if it dons’t work instantly
org.echocat.jomon.runtime.iterators.CloseableIterator Sometimes it is important to make it possible that an Iterator could be close – simple but effective. See also the implementations.
org.echocat.jomon.runtime.math.OverPeriodCounter Good for statistical reasons: Measure to access of objects in a specific period of time.
org.echocat.jomon.runtime.math.OverPeriodAverageLongCounter To collect average values over a time period.

..and many more. Have a look at our code.

Links

Use with Maven

<properties>
    <versions.org.echocat.jomon>--fill here latest version in--</versions.org.echocat.jomon>
</properties>
<repositories>
    <repository>
        <id>echocat</id>
        <url>http://repo.echocat.org/echocat</url>
    </repository>
</repositories>
<dependencies>
    <dependency>
        <groupId>org.echocat.jomon</groupId>
        <artifactId>cache</artifactId>
        <version>${versions.org.echocat.jomon}</version>
    </dependency>
    <dependency>
        <groupId>org.echocat.jomon</groupId>
        <artifactId>format</artifactId>
        <version>${versions.org.echocat.jomon}</version>
    </dependency>
    <dependency>
        <groupId>org.echocat.jomon.maven</groupId>
        <artifactId>common</artifactId>
        <version>${versions.org.echocat.jomon}</version>
    </dependency>
    <dependency>
        <groupId>org.echocat.jomon.net</groupId>
        <artifactId>cluster</artifactId>
        <version>${versions.org.echocat.jomon}</version>
    </dependency>
    <dependency>
        <groupId>org.echocat.jomon.net</groupId>
        <artifactId>common</artifactId>
        <version>${versions.org.echocat.jomon}</version>
    </dependency>
    <dependency>
        <groupId>org.echocat.jomon.net</groupId>
        <artifactId>http</artifactId>
        <version>${versions.org.echocat.jomon}</version>
    </dependency>
    <dependency>
        <groupId>org.echocat.jomon.net</groupId>
        <artifactId>mail</artifactId>
        <version>${versions.org.echocat.jomon}</version>
    </dependency>
    <dependency>
        <groupId>org.echocat.jomon.net</groupId>
        <artifactId>service</artifactId>
        <version>${versions.org.echocat.jomon}</version>
    </dependency>
    <dependency>
        <groupId>org.echocat.jomon.net</groupId>
        <artifactId>testing</artifactId>
        <version>${versions.org.echocat.jomon}</version>
    </dependency>
    <dependency>
        <groupId>org.echocat.jomon</groupId>
        <artifactId>process</artifactId>
        <version>${versions.org.echocat.jomon}</version>
    </dependency>
    <dependency>
        <groupId>org.echocat.jomon</groupId>
        <artifactId>resources</artifactId>
        <version>${versions.org.echocat.jomon}</version>
    </dependency>
    <dependency>
        <groupId>org.echocat.jomon</groupId>
        <artifactId>runtime</artifactId>
        <version>${versions.org.echocat.jomon}</version>
    </dependency>
    <dependency>
        <groupId>org.echocat.jomon.spring</groupId>
        <artifactId>common</artifactId>
        <version>${versions.org.echocat.jomon}</version>
    </dependency>
    <dependency>
        <groupId>org.echocat.jomon.spring</groupId>
        <artifactId>testing</artifactId>
        <version>${versions.org.echocat.jomon}</version>
    </dependency>
    <dependency>
        <groupId>org.echocat.jomon</groupId>
        <artifactId>testing</artifactId>
        <version>${versions.org.echocat.jomon}</version>
    </dependency>
</dependencies>

Find out what are the possible versions or what is the latest version.

License

echocat Velma is licensed under MPL 2.0.

Want to help?

You are welcome. Fork or contact us.

Thanks

Many thanks to two companies which helps to develop this great project.

MOTOR-TALK GmbH Home of Europeans biggest car community.
optivo GmbH One of the leading Enterprise E-Mail-Marketing companies in Germany.
org.echocat.jomon.maven

echocat

Versions

Version
1.6.3
1.6.2
1.6.1
1.6.0
1.5.0
1.4.3
1.4.2
1.4.1
1.4.0
1.3.1