Skip to content

Commit

Permalink
8301367: Add exception handler method to the BaseLdapServer
Browse files Browse the repository at this point in the history
Reviewed-by: jpai, vtewari, dfuchs
  • Loading branch information
AlekseiEfimov committed Feb 2, 2023
1 parent 7b6ac41 commit 03b23a1
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions test/jdk/com/sun/jndi/ldap/lib/BaseLdapServer.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -173,7 +173,7 @@ private void handleConnection(Socket socket) {
if (!isRunning()) {
logger.log(INFO, "Connection Handler exit {0}", t.getMessage());
} else {
t.printStackTrace();
handleSocketException(socket, t);
}
}

Expand All @@ -189,6 +189,15 @@ private void handleConnection(Socket socket) {
*/
protected void beforeConnectionHandled(Socket socket) { /* empty */ }

/*
* Called to handle exceptions observed on an established client connection.
*
* By default, an exception stack trace is printed.
*/
protected void handleSocketException(Socket socket, Throwable exception) {
exception.printStackTrace();
}

/*
* Called after an LDAP request has been read in `handleConnection()`.
*
Expand Down

3 comments on commit 03b23a1

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin
Copy link
Member

@GoeLin GoeLin commented on 03b23a1 Jul 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 03b23a1 Jul 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin the backport was successfully created on the branch GoeLin-backport-03b23a1e in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 03b23a1e from the openjdk/jdk repository.

The commit being backported was authored by Aleksei Efimov on 2 Feb 2023 and was reviewed by Jaikiran Pai, Vyom Tewari and Daniel Fuchs.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev.git GoeLin-backport-03b23a1e:GoeLin-backport-03b23a1e
$ git checkout GoeLin-backport-03b23a1e
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev.git GoeLin-backport-03b23a1e

Please sign in to comment.