Project

General

Profile

Feature #841

Add ability to call life cycle destroy method for singleton

Added by Bruce Weertman over 5 years ago. Updated over 3 years ago.

Status:
New
Priority:
Normal
Assignee:
Target version:
Start date:
10/24/2016
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed

Description

In the xx-service.cfg file you can have a line like:

singletonClassName=edu.iris.fooservice.BarSingleton

It would be useful to add the ability to call a named "destroy" method on that singleton on service shutdown.

That could be done by adding an optional line:
singletonClassShutdownMethod=destructor

In the singleton, you would see

public class BarSingelton {

     public void destructor() {
        // do cleanup here like stop worker threads etc
     }

}

The WSS would have something like the following code somewhere in it:

Method destroyMethod = singleton.getClass().getMethod(destroyMethodName);
destroyMethod.invoke(singleton);

History

#1 Updated by Mike Stults over 3 years ago

  • Resolution set to Fixed
  • Assignee set to Mike Stults

git 58b2328..f11a99d master -> master - git commit -m "issue 841 - added default destroy method to IrisSingleton interface, it is called as part of the container lifecycle operation, added explicit unit test and adjusted related unit tests."

#2 Updated by Mike Stults over 3 years ago

2018-05-25 5a3b275 (Mike Stults): (HEAD > master, tag: v2.4.4, origin/master, origin/HEAD) - v2.4.4 for issues 939, 931, 927, 894, 841
uploaded webserviceshell/2.4.4/webserviceshell-2.4.4.jar 8545 KB

#3 Updated by Mike Stults over 3 years ago

  • Target version set to 2.4.4

Also available in: Atom PDF