Skip to content

Commit

Permalink
Fixes #4147 - Update Herring to latest version (#4151)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnriem authored Oct 30, 2024
1 parent b8cf6e7 commit b7a2685
Show file tree
Hide file tree
Showing 35 changed files with 85 additions and 84 deletions.
4 changes: 2 additions & 2 deletions extension/coreprofile/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@
</dependency>
<dependency>
<groupId>cloud.piranha.extension</groupId>
<artifactId>piranha-extension-jersey</artifactId>
<artifactId>piranha-extension-herring</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cloud.piranha.extension</groupId>
<artifactId>piranha-extension-naming</artifactId>
<artifactId>piranha-extension-jersey</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import cloud.piranha.core.api.WebApplicationExtensionContext;
import cloud.piranha.extension.annotationscan.AnnotationScanExtension;
import cloud.piranha.extension.annotationscan.classfile.ClassfileAnnotationScanExtension;
import cloud.piranha.extension.naming.NamingExtension;
import cloud.piranha.extension.herring.HerringExtension;
import cloud.piranha.extension.scinitializer.ServletContainerInitializerExtension;
import cloud.piranha.extension.webxml.WebXmlExtension;
import cloud.piranha.extension.weld.WeldExtension;
Expand All @@ -45,7 +45,7 @@ public class CoreProfileExtension implements WebApplicationExtension {

@Override
public void extend(WebApplicationExtensionContext context) {
context.add(NamingExtension.class); // Naming (JNDI)
context.add(HerringExtension.class); // Herring (JNDI)
context.add(WebXmlExtension.class);
context.add(getAnnotationScanExtensionClass());
context.add(WeldExtension.class); // CDI / Weld
Expand Down
4 changes: 2 additions & 2 deletions extension/coreprofile/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* <li>Eclipse Parsson (JSON)</li>
* <li>Eclipse Yasson (JSON-B)</li>
* <li>Eclipse Jersey (REST)</li>
* <li>Naming (JNDI)</li>
* <li>Herring (JNDI)</li>
* <li>ServletContainerInitializer</li>
* <li>web.xml support</li>
* </ul>
Expand All @@ -50,8 +50,8 @@
requires cloud.piranha.core.api;
requires cloud.piranha.extension.annotationscan;
requires cloud.piranha.extension.annotationscan.classfile;
requires cloud.piranha.extension.herring;
requires cloud.piranha.extension.jersey;
requires cloud.piranha.extension.naming;
requires cloud.piranha.extension.scinitializer;
requires cloud.piranha.extension.webxml;
requires cloud.piranha.extension.weld;
Expand Down
4 changes: 2 additions & 2 deletions extension/naming/pom.xml → extension/herring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
<version>24.11.0-SNAPSHOT</version>
</parent>

<artifactId>piranha-extension-naming</artifactId>
<artifactId>piranha-extension-herring</artifactId>
<packaging>jar</packaging>

<name>Piranha - Extension - Naming</name>
<name>Piranha - Extension - Herring</name>

<dependencies>
<!-- compile -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package cloud.piranha.extension.naming;
package cloud.piranha.extension.herring;

import cloud.piranha.core.api.WebApplication;
import cloud.piranha.core.api.WebApplicationExtension;
Expand Down Expand Up @@ -55,12 +55,12 @@
*
* @author Manfred Riem ([email protected])
*/
public class NamingExtension implements WebApplicationExtension {
public class HerringExtension implements WebApplicationExtension {

/**
* Stores the logger.
*/
private static final System.Logger LOGGER = System.getLogger(NamingExtension.class.getName());
private static final System.Logger LOGGER = System.getLogger(HerringExtension.class.getName());

/**
* Configure the web application.
Expand All @@ -69,13 +69,13 @@ public class NamingExtension implements WebApplicationExtension {
*/
@Override
public void configure(WebApplication webApplication) {
LOGGER.log(DEBUG, "Configuring NamingExtension");
LOGGER.log(DEBUG, "Configuring HerringExtension");
if (System.getProperty(INITIAL_CONTEXT_FACTORY) == null) {
LOGGER.log(DEBUG, "Setting " + INITIAL_CONTEXT_FACTORY + " to " + NamingInitialContextFactory.class.getName());
System.setProperty(INITIAL_CONTEXT_FACTORY, NamingInitialContextFactory.class.getName());
LOGGER.log(DEBUG, "Setting " + INITIAL_CONTEXT_FACTORY + " to " + HerringInitialContextFactory.class.getName());
System.setProperty(INITIAL_CONTEXT_FACTORY, HerringInitialContextFactory.class.getName());
}
if (!System.getProperty(INITIAL_CONTEXT_FACTORY).equals(NamingInitialContextFactory.class.getName())) {
LOGGER.log(WARNING, INITIAL_CONTEXT_FACTORY + " is not set to " + NamingInitialContextFactory.class.getName());
if (!System.getProperty(INITIAL_CONTEXT_FACTORY).equals(HerringInitialContextFactory.class.getName())) {
LOGGER.log(WARNING, INITIAL_CONTEXT_FACTORY + " is not set to " + HerringInitialContextFactory.class.getName());
}

Context context = new DefaultInitialContext();
Expand Down Expand Up @@ -170,7 +170,7 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl
}
});

NamingInitialContextFactory.setInitialContext(proxyContext);
HerringInitialContextFactory.setInitialContext(proxyContext);
webApplication.setAttribute(Context.class.getName(), proxyContext);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package cloud.piranha.extension.naming;
package cloud.piranha.extension.herring;

import com.manorrock.herring.DefaultInitialContext;
import java.util.Hashtable;
Expand All @@ -38,7 +38,7 @@
*
* @author Manfred Riem ([email protected])
*/
public class NamingInitialContextFactory implements InitialContextFactory {
public class HerringInitialContextFactory implements InitialContextFactory {

/**
* Stores the initial context.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package cloud.piranha.extension.naming;
package cloud.piranha.extension.herring;

import cloud.piranha.core.api.WebApplication;
import com.manorrock.herring.thread.ThreadInitialContextFactory;
Expand All @@ -41,12 +41,12 @@
*
* @author Manfred Riem ([email protected])
*/
public class NamingServletRequestListener implements ServletRequestListener {
public class HerringServletRequestListener implements ServletRequestListener {

/**
* Stores the logger.
*/
private static final System.Logger LOGGER = System.getLogger(NamingServletRequestListener.class.getName());
private static final System.Logger LOGGER = System.getLogger(HerringServletRequestListener.class.getName());

@Override
public void requestDestroyed(ServletRequestEvent event) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
*/

/**
* This module delivers the JNDI integration extension.
* This module integrates Manorrock Herring into Piranha.
*
* @author Manfred Riem ([email protected])
*/
module cloud.piranha.extension.naming {
module cloud.piranha.extension.herring {

exports cloud.piranha.extension.naming;
opens cloud.piranha.extension.naming;
exports cloud.piranha.extension.herring;
opens cloud.piranha.extension.herring;
requires cloud.piranha.core.api;
requires transitive com.manorrock.herring;
requires transitive com.manorrock.herring.thread;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package cloud.piranha.extension.naming;
package cloud.piranha.extension.herring;

import static javax.naming.Context.INITIAL_CONTEXT_FACTORY;
import static org.junit.jupiter.api.Assertions.assertEquals;
Expand All @@ -44,11 +44,11 @@
import jakarta.servlet.ServletRequestListener;

/**
* The JUnit tests for the NamingExtension class.
* The JUnit tests for the HerringExtension class.
*
* @author Manfred Riem ([email protected])
*/
class NamingExtensionTest {
class HerringExtensionTest {

/**
* Test configure method.
Expand All @@ -57,9 +57,9 @@ class NamingExtensionTest {
*/
@Test
void testConfigure() throws Exception {
System.setProperty(INITIAL_CONTEXT_FACTORY, NamingInitialContextFactory.class.getName());
System.setProperty(INITIAL_CONTEXT_FACTORY, HerringInitialContextFactory.class.getName());
EmbeddedPiranha piranha = new EmbeddedPiranhaBuilder()
.extension(NamingExtension.class)
.extension(HerringExtension.class)
.listener(TestServletRequestListener.class.getName())
.build()
.start();
Expand All @@ -81,12 +81,12 @@ void testConfigure() throws Exception {
@Test
void testConfigure2() throws Exception {
new EmbeddedPiranhaBuilder()
.extension(NamingExtension.class)
.extension(HerringExtension.class)
.listener(TestServletRequestListener.class.getName())
.build()
.start();
assertEquals(System.getProperty(INITIAL_CONTEXT_FACTORY),
NamingInitialContextFactory.class.getName());
HerringInitialContextFactory.class.getName());
}

/**
Expand Down
6 changes: 3 additions & 3 deletions extension/microprofile/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@
</dependency>
<dependency>
<groupId>cloud.piranha.extension</groupId>
<artifactId>piranha-extension-jersey</artifactId>
<artifactId>piranha-extension-herring</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cloud.piranha.extension</groupId>
<artifactId>piranha-extension-yasson</artifactId>
<artifactId>piranha-extension-jersey</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cloud.piranha.extension</groupId>
<artifactId>piranha-extension-naming</artifactId>
<artifactId>piranha-extension-yasson</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import cloud.piranha.core.api.WebApplicationExtensionContext;
import cloud.piranha.extension.annotationscan.AnnotationScanExtension;
import cloud.piranha.extension.annotationscan.classfile.ClassfileAnnotationScanExtension;
import cloud.piranha.extension.naming.NamingExtension;
import cloud.piranha.extension.herring.HerringExtension;
import cloud.piranha.extension.scinitializer.ServletContainerInitializerExtension;

/**
Expand All @@ -43,7 +43,7 @@ public class MicroProfileExtension implements WebApplicationExtension {

@Override
public void extend(WebApplicationExtensionContext context) {
context.add(NamingExtension.class); // Naming (JNDI)
context.add(HerringExtension.class); // Herring (JNDI)
context.add(getAnnotationScanExtensionClass());
context.add(ServletContainerInitializerExtension.class); // ServletContainerInitializer
}
Expand Down
2 changes: 1 addition & 1 deletion extension/microprofile/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
requires cloud.piranha.core.api;
requires cloud.piranha.extension.annotationscan;
requires cloud.piranha.extension.annotationscan.classfile;
requires cloud.piranha.extension.herring;
requires cloud.piranha.extension.jersey;
requires cloud.piranha.extension.naming;
requires cloud.piranha.extension.scinitializer;
requires cloud.piranha.extension.yasson;
}
12 changes: 6 additions & 6 deletions extension/platform/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,22 @@
</dependency>
<dependency>
<groupId>cloud.piranha.extension</groupId>
<artifactId>piranha-extension-jersey</artifactId>
<artifactId>piranha-extension-herring</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
</dependency>
<dependency>
<groupId>cloud.piranha.extension</groupId>
<artifactId>piranha-extension-yasson</artifactId>
<artifactId>piranha-extension-jersey</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
</dependency>
<dependency>
<groupId>cloud.piranha.extension</groupId>
<artifactId>piranha-extension-naming</artifactId>
<artifactId>piranha-extension-yasson</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
</dependency>
<dependency>
<groupId>cloud.piranha.extension</groupId>
<artifactId>piranha-extension-weld</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import cloud.piranha.core.api.WebApplicationExtensionContext;
import cloud.piranha.extension.annotationscan.AnnotationScanExtension;
import cloud.piranha.extension.annotationscan.classfile.ClassfileAnnotationScanExtension;
import cloud.piranha.extension.naming.NamingExtension;
import cloud.piranha.extension.herring.HerringExtension;
import cloud.piranha.extension.scinitializer.ServletContainerInitializerExtension;

/**
Expand All @@ -43,8 +43,8 @@ public class PlatformExtension implements WebApplicationExtension {

@Override
public void extend(WebApplicationExtensionContext context) {
context.add(NamingExtension.class); // Naming (JNDI)
context.add(getAnnotationScanExtensionClass()); // Annotation scanning
context.add(HerringExtension.class); // Herring (JNDI)
context.add(getAnnotationScanExtensionClass()); // Annotation scanning
context.add(ServletContainerInitializerExtension.class); // ServletContainerInitializer
}

Expand Down
4 changes: 2 additions & 2 deletions extension/platform/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* <li>Eclipse Parsson (JSON)</li>
* <li>Eclipse Yasson (JSON-B)</li>
* <li>Glassfish Jersey (REST)</li>
* <li>Naming (JNDI)</li>
* <li>Herring (JNDI)</li>
* <li>ServletContainerInitializer</li>
* </ul>
*/
Expand All @@ -51,8 +51,8 @@
requires cloud.piranha.extension.annotationscan;
requires cloud.piranha.extension.annotationscan.classfile;
requires cloud.piranha.extension.expressly;
requires cloud.piranha.extension.herring;
requires cloud.piranha.extension.jersey;
requires cloud.piranha.extension.naming;
requires cloud.piranha.extension.scinitializer;
requires cloud.piranha.extension.yasson;
}
2 changes: 1 addition & 1 deletion extension/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
<module>eclipse-tyrus</module>
<module>eclipselink</module>
<module>hazelcast</module>
<module>herring</module>
<module>jersey</module>
<module>micro</module>
<module>microprofile</module>
<module>mojarra</module>
<module>naming</module>
<module>naming-cdi</module>
<module>omnifaces-config</module>
<module>omnifaces-microprofile-jwt-auth</module>
Expand Down
4 changes: 2 additions & 2 deletions extension/servlet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@
</dependency>
<dependency>
<groupId>cloud.piranha.extension</groupId>
<artifactId>piranha-extension-wasp</artifactId>
<artifactId>piranha-extension-herring</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cloud.piranha.extension</groupId>
<artifactId>piranha-extension-naming</artifactId>
<artifactId>piranha-extension-wasp</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import cloud.piranha.extension.annotationscan.AnnotationScanExtension;
import cloud.piranha.extension.annotationscan.classfile.ClassfileAnnotationScanExtension;
import cloud.piranha.extension.apache.fileupload.ApacheMultiPartExtension;
import cloud.piranha.extension.naming.NamingExtension;
import cloud.piranha.extension.herring.HerringExtension;
import cloud.piranha.extension.policy.PolicyExtension;
import cloud.piranha.extension.scinitializer.ServletContainerInitializerExtension;
import cloud.piranha.extension.security.servlet.ServletSecurityExtension;
Expand Down Expand Up @@ -60,7 +60,7 @@ public void extend(WebApplicationExtensionContext context) {
context.add(ServletSecurityManagerExtension.class); // SecurityManager
context.add(ApacheMultiPartExtension.class); // Servlet Part API support
context.add(WaspJspManagerExtension.class); // addJspFile
context.add(NamingExtension.class); // Naming (JNDI)
context.add(HerringExtension.class); // Herring (JNDI)
context.add(WebXmlExtension.class); // web.xml
context.add(getAnnotationScanExtensionClass()); // Annotation scanning
context.add(ServletAnnotationsExtension.class); // Servlet annotations
Expand Down
Loading

0 comments on commit b7a2685

Please sign in to comment.