Skip to content

Commit

Permalink
Merge branch 'develop' into update-from-template-merged
Browse files Browse the repository at this point in the history
  • Loading branch information
xdev-gh-bot committed Feb 10, 2025
2 parents 37e12e8 + 6e57e1d commit 9ea7450
Show file tree
Hide file tree
Showing 15 changed files with 465 additions and 32 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ body:
attributes:
label: "Checklist"
options:
- label: "I am able to reproduce the bug with the [latest version](https://github.com/xdev-software/template-placeholder/releases/latest)"
- label: "I am able to reproduce the bug with the [latest version](https://github.com/xdev-software/expiring-limited-cache/releases/latest)"
required: true
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/expiring-limited-cache/issues) or [closed](https://github.com/xdev-software/expiring-limited-cache/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
required: true
- label: "I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise."
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/enhancement.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ body:
attributes:
label: "Checklist"
options:
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/expiring-limited-cache/issues) or [closed](https://github.com/xdev-software/expiring-limited-cache/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
required: true
- label: "I have taken the time to fill in all the required details. I understand that the feature request will be dismissed otherwise."
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/question.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ body:
attributes:
label: "Checklist"
options:
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/expiring-limited-cache/issues) or [closed](https://github.com/xdev-software/expiring-limited-cache/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
required: true
- label: "I have taken the time to fill in all the required details. I understand that the question will be dismissed otherwise."
required: true
Expand Down
2 changes: 1 addition & 1 deletion .run/Run Demo.run.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run Demo" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="software.xdev.Application" />
<module name="template-placeholder-demo" />
<module name="expiring-limited-cache-demo" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<extension name="coverage">
<pattern>
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 1.0.3
* Improve performance when using virtual threads #49
* Updated dependencies

# 1.0.2
* Fixed possible NPE when shutting down

# 1.0.1
* Restore original logging with SLF4j

# 1.0.0
_Initial release_
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ You should have the following things installed:
* Ensure that the JDK/Java-Version is correct


## Releasing [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/template-placeholder/release.yml?branch=master)](https://github.com/xdev-software/template-placeholder/actions/workflows/release.yml)
## Releasing [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/expiring-limited-cache/release.yml?branch=master)](https://github.com/xdev-software/expiring-limited-cache/actions/workflows/release.yml)

Before releasing:
* Consider doing a [test-deployment](https://github.com/xdev-software/template-placeholder/actions/workflows/test-deploy.yml?query=branch%3Adevelop) before actually releasing.
* Consider doing a [test-deployment](https://github.com/xdev-software/expiring-limited-cache/actions/workflows/test-deploy.yml?query=branch%3Adevelop) before actually releasing.
* Check the [changelog](CHANGELOG.md)

If the ``develop`` is ready for release, create a pull request to the ``master``-Branch and merge the changes
Expand Down
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
[![Latest version](https://img.shields.io/maven-central/v/software.xdev/template-placeholder?logo=apache%20maven)](https://mvnrepository.com/artifact/software.xdev/template-placeholder)
[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/template-placeholder/check-build.yml?branch=develop)](https://github.com/xdev-software/template-placeholder/actions/workflows/check-build.yml?query=branch%3Adevelop)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=xdev-software_template-placeholder&metric=alert_status)](https://sonarcloud.io/dashboard?id=xdev-software_template-placeholder)
[![Latest version](https://img.shields.io/maven-central/v/software.xdev/expiring-limited-cache?logo=apache%20maven)](https://mvnrepository.com/artifact/software.xdev/expiring-limited-cache)
[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/expiring-limited-cache/check-build.yml?branch=develop)](https://github.com/xdev-software/expiring-limited-cache/actions/workflows/check-build.yml?query=branch%3Adevelop)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=xdev-software_expiring-limited-cache&metric=alert_status)](https://sonarcloud.io/dashboard?id=xdev-software_expiring-limited-cache)

# template-placeholder
# expiring-limited-cache

A [expiring and limited java cache](./expiring-limited-cache/src/main/java/software/xdev/caching/ExpiringLimitedCache.java).

Provides a ``Map`` that clears entries after a specific time, when a specific size is reached or when the JVM needs memory.

Usecase examples:
* Caching all objects in an S3 Bucket
* Caching API responses

## Installation
[Installation guide for the latest release](https://github.com/xdev-software/template-placeholder/releases/latest#Installation)
[Installation guide for the latest release](https://github.com/xdev-software/expiring-limited-cache/releases/latest#Installation)

## Support
If you need support as soon as possible and you can't wait for any pull request, feel free to use [our support](https://xdev.software/en/services/support).
Expand All @@ -15,4 +22,4 @@ If you need support as soon as possible and you can't wait for any pull request,
See the [contributing guide](./CONTRIBUTING.md) for detailed instructions on how to get started with our project.

## Dependencies and Licenses
View the [license of the current project](LICENSE) or the [summary including all dependencies](https://xdev-software.github.io/template-placeholder/dependencies)
View the [license of the current project](LICENSE) or the [summary including all dependencies](https://xdev-software.github.io/expiring-limited-cache/dependencies)
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

## Reporting a Vulnerability

Please report a security vulnerability [on GitHub Security Advisories](https://github.com/xdev-software/template-placeholder/security/advisories/new).
Please report a security vulnerability [on GitHub Security Advisories](https://github.com/xdev-software/expiring-limited-cache/security/advisories/new).
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

<parent>
<groupId>software.xdev</groupId>
<artifactId>template-placeholder-root</artifactId>
<version>1.0.0-SNAPSHOT</version>
<artifactId>expiring-limited-cache-root</artifactId>
<version>1.0.4-SNAPSHOT</version>
</parent>

<artifactId>template-placeholder-demo</artifactId>
<version>1.0.0-SNAPSHOT</version>
<artifactId>expiring-limited-cache-demo</artifactId>
<version>1.0.4-SNAPSHOT</version>
<packaging>jar</packaging>

<organization>
Expand All @@ -32,9 +32,15 @@
<dependencies>
<dependency>
<groupId>software.xdev</groupId>
<artifactId>template-placeholder</artifactId>
<artifactId>expiring-limited-cache</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.16</version>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package software.xdev;

import java.time.Duration;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import software.xdev.caching.ExpiringLimitedCache;


public final class Application
{
private static final Logger LOG = LoggerFactory.getLogger(Application.class);

private static final ExpiringLimitedCache<Integer, String> CACHE = new ExpiringLimitedCache<>(
"demo",
Duration.ofSeconds(2),
1
);

@SuppressWarnings("java:S2629") // No we don't write if everywhere now
public static void main(final String[] args)
{
CACHE.put(1, "HI");
CACHE.put(2, "DEMO");
// Returns null as size > max
LOG.info("1={}", CACHE.get(1));
LOG.info("2={}", CACHE.get(2));

LOG.info("Waiting a moment...");
try
{
Thread.sleep(3 * 1000L);
}
catch(final InterruptedException iex)
{
Thread.currentThread().interrupt();
}

// Will also return null as expired
LOG.info("2={}", CACHE.get(2));
}

private Application()
{
}
}
42 changes: 34 additions & 8 deletions template-placeholder/pom.xml → expiring-limited-cache/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@
<modelVersion>4.0.0</modelVersion>

<groupId>software.xdev</groupId>
<artifactId>template-placeholder</artifactId>
<version>1.0.0-SNAPSHOT</version>
<artifactId>expiring-limited-cache</artifactId>
<version>1.0.4-SNAPSHOT</version>
<packaging>jar</packaging>

<name>template-placeholder</name>
<description>template-placeholder</description>
<url>https://github.com/xdev-software/template-placeholder</url>
<name>expiring-limited-cache</name>
<description>expiring-limited-cache</description>
<url>https://github.com/xdev-software/expiring-limited-cache</url>

<scm>
<url>https://github.com/xdev-software/template-placeholder</url>
<connection>scm:git:https://github.com/xdev-software/template-placeholder.git</connection>
<url>https://github.com/xdev-software/expiring-limited-cache</url>
<connection>scm:git:https://github.com/xdev-software/expiring-limited-cache.git</connection>
</scm>

<inceptionYear>2023</inceptionYear>
<inceptionYear>2024</inceptionYear>

<organization>
<name>XDEV Software</name>
Expand Down Expand Up @@ -84,6 +84,26 @@
</repository>
</distributionManagement>

<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.16</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.16</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.11.3</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<pluginManagement>
<plugins>
Expand Down Expand Up @@ -172,6 +192,12 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.2</version>
</plugin>
</plugins>
</build>
<profiles>
Expand Down
Loading

0 comments on commit 9ea7450

Please sign in to comment.