Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# microBean™ Scopelet

[![Maven Central](https://img.shields.io/maven-central/v/org.microbean/microbean-scopelet.svg?label=Maven%20Central)](https://search.maven.org/artifact/org.microbean/microbean-scopelet)
[![Maven Central](https://img.shields.io/maven-central/v/org.microbean/microbean-producer.svg?label=Maven%20Central)](https://central.sonatype.com/artifact/org.microbean/microbean-scopelet)

The microBean™ Scopelet project provides classes and interfaces assisting with implementing dependency injection scopes.
![0% AI](https://img.shields.io/badge/%F0%9F%A4%96_AI-0%25_%F0%9F%8C%BC-brightgreen)

The microBean™ Scopelet™ project provides classes and interfaces assisting with implementing dependency injection
scopes.

# Status

Expand All @@ -15,19 +18,20 @@ changes, regardless of project version and without notice.**

# Requirements

microBean™ Scopelet requires a Java runtime of version 16 or higher.
microBean™ Scopelet requires a Java runtime of version 16 or higher.

# Installation

microBean™ Scopelet is available on [Maven Central](https://search.maven.org/). Include microBean™ Scopelet as a Maven
dependency:
microBean™ Scopelet™ is available on [Maven
Central](https://central.sonatype.com/artifact/org.microbean/microbean-scopelet). Include microBean™ Scopelet™ as a
Maven dependency:

```xml
<dependency>
<groupId>org.microbean</groupId>
<artifactId>microbean-scopelet</artifactId>
<!-- Always check https://search.maven.org/artifact/org.microbean/microbean-scopelet for up-to-date available versions. -->
<version>0.0.11</version>
<!-- Always check https://central.sonatype.com/artifact/org.microbean/microbean-scopelet for up-to-date available versions. -->
<version>0.0.12</version>
</dependency>
```

Expand Down
34 changes: 11 additions & 23 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<!-- maven-javadoc-plugin properties -->
<bottom><![CDATA[Copyright &copy; ${project.inceptionYear}&ndash;{currentYear}, <a href="${project.organization.url}" target="_top">${project.organization.name}</a>. All rights reserved.]]></bottom>
<doctitle>&lt;a href="${project.url}" target="_top"&gt;&lt;span style="font-family:Lobster, cursive;"&gt;µb&lt;/span&gt; ${project.artifactId}&lt;/a&gt; ${project.version}</doctitle>
<links>https://microbean.github.io/microbean-assign/apidocs/,https://microbean.github.io/microbean-attributes/apidocs/,https://microbean.github.io/microbean-bean/apidocs/,https://microbean.github.io/microbean-construct/apidocs/,https://microbean.github.io/microbean-reference/apidocs/</links>
<links>https://microbean.github.io/microbean-assign/apidocs/,https://microbean.github.io/microbean-bean/apidocs/,https://microbean.github.io/microbean-construct/apidocs/,https://microbean.github.io/microbean-reference/apidocs/</links>
<sourcetab>2</sourcetab>

<!-- maven-release-plugin properties -->
Expand Down Expand Up @@ -121,37 +121,31 @@
<dependency>
<groupId>org.microbean</groupId>
<artifactId>microbean-assign</artifactId>
<version>0.0.11</version>
</dependency>

<dependency>
<groupId>org.microbean</groupId>
<artifactId>microbean-attributes</artifactId>
<version>0.0.5</version>
<version>0.0.14</version>
</dependency>

<dependency>
<groupId>org.microbean</groupId>
<artifactId>microbean-bean</artifactId>
<version>0.0.22</version>
<version>0.0.23</version>
</dependency>

<dependency>
<groupId>org.microbean</groupId>
<artifactId>microbean-construct</artifactId>
<version>0.0.18</version>
<version>0.0.24</version>
</dependency>

<dependency>
<groupId>org.microbean</groupId>
<artifactId>microbean-event</artifactId> <!-- scopelets fire events -->
<version>0.0.3</version>
<version>0.0.4</version>
</dependency>

<dependency>
<groupId>org.microbean</groupId>
<artifactId>microbean-reference</artifactId>
<version>0.0.5</version>
<version>0.0.6</version>
</dependency>

</dependencies>
Expand All @@ -165,12 +159,6 @@
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.microbean</groupId>
<artifactId>microbean-attributes</artifactId>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.microbean</groupId>
<artifactId>microbean-bean</artifactId>
Expand Down Expand Up @@ -330,7 +318,7 @@
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>12.3.0</version>
<version>13.0.0</version>
</dependency>
</dependencies>
</plugin>
Expand All @@ -351,7 +339,7 @@
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.14.1</version>
<version>3.15.0</version>
<configuration>
<compilerArgs>
<arg>-Xlint:all</arg>
Expand All @@ -361,7 +349,7 @@
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.9.0</version>
<version>3.10.0</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
Expand Down Expand Up @@ -463,7 +451,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.20.1</version>
<version>2.21.0</version>
</plugin>
<plugin>
<groupId>io.smallrye</groupId>
Expand All @@ -473,7 +461,7 @@
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.9.0</version>
<version>0.10.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central.sonatype.com</publishingServerId>
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- mode: Java; c-basic-offset: 2; indent-tabs-mode: nil; coding: utf-8-unix -*-
*
* Copyright © 2023–2025 microBean™.
* Copyright © 2023–2026 microBean™.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand All @@ -22,7 +22,6 @@
exports org.microbean.scopelet;

requires transitive org.microbean.assign;
requires org.microbean.attributes;
requires transitive org.microbean.bean;
requires org.microbean.constant;
requires org.microbean.construct;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/microbean/scopelet/Instance.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- mode: Java; c-basic-offset: 2; indent-tabs-mode: nil; coding: utf-8-unix -*-
*
* Copyright © 2023–2025 microBean™.
* Copyright © 2023–2026 microBean™.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -84,8 +84,8 @@ final class Instance<I> implements AutoCloseable, Supplier<I> {
* @param destruction a {@link Destruction}; may be {@code null}
*/
Instance(final I contextualInstance,
final Destructor<I> destructor,
final Destruction destruction) {
final Destructor<I> destructor,
final Destruction destruction) {
super();
this.destruction = destruction;
this.object = contextualInstance;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/microbean/scopelet/MapBackedScopelet.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- mode: Java; c-basic-offset: 2; indent-tabs-mode: nil; coding: utf-8-unix -*-
*
* Copyright © 2023–2025 microBean™.
* Copyright © 2023–2026 microBean™.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -168,8 +168,8 @@ private final <I> Supplier<I> supplier(final Object id,
@SuppressWarnings("unchecked")
final Instance<I> newInstance =
new Instance<I>(factory == this ? (I)this : factory.create(creation),
factory::destroy, // Destructor
(Destruction)creation);
factory::destroy, // Destructor
(Destruction)creation);

// Put the created instance into our instance map. There will not be a pre-existing instance.
final Object previous = this.instances.put(id, newInstance);
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/org/microbean/scopelet/NoneScopelet.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- mode: Java; c-basic-offset: 2; indent-tabs-mode: nil; coding: utf-8-unix -*-
*
* Copyright © 2023–2025 microBean™.
* Copyright © 2023–2026 microBean™.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand All @@ -15,7 +15,6 @@

import java.lang.System.Logger;

import java.lang.constant.ClassDesc;
import java.lang.constant.Constable;
import java.lang.constant.ConstantDesc;
import java.lang.constant.DynamicConstantDesc;
Expand Down Expand Up @@ -90,7 +89,7 @@ public NoneScopelet() {
* @exception InactiveScopeletException if this {@link Scopelet} {@linkplain #active() is not active}
*
* @exception ClassCastException if destruction is called for, {@code creation} is non-{@code null}, and {@code
* creation} does not implement {@link org.microbean.bean.Destruction}, a requirement of its contract
* creation} does not implement {@link Destruction}, a requirement of its contract
*
* @see DestructorRegistry
*
Expand Down Expand Up @@ -122,7 +121,7 @@ public <I> I instance(final Object ignoredBeanId, final Factory<I> factory, fina

@Override // Constable
public Optional<? extends ConstantDesc> describeConstable() {
return Optional.of(DynamicConstantDesc.of(BSM_INVOKE, ofConstructor(ClassDesc.of(this.getClass().getName()))));
return Optional.of(DynamicConstantDesc.of(BSM_INVOKE, ofConstructor(this.getClass().describeConstable().orElseThrow())));
}

}
Loading