Petals CDK

Add a method to get timeout value if set or its default value

Details

  • Type: Improvement Request Improvement Request
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 5.6.1
  • Fix Version/s: 5.6.2
  • Component/s: configuration
  • Security Level: Public
  • Description:
    Hide

    At an external listener implementation level, to get the consumer timeout value set, it is needed to get it from the class Consumes, and NPE can occurs when converting from Long to long.
    The method getDefaultTimeoutFrom of AbstractListener contains a private method to get the timeout value set on a consumer or a provider, and if not set, a default timeout value is used.
    So, it should be interesting to change the visibility of AbstractListener.getDefaultTimeoutFrom(...) to public, so instead of:

    long timeout = this.restExternalListener.getConsumes().getTimeout(); --> NPE if no timeout set

    we can use something as:

    long timeout = this.restExternalListener.getTimeout(this.restExternalListener.getConsumes());  --> No NPE if no timeout set, a default value is returned
    Show
    At an external listener implementation level, to get the consumer timeout value set, it is needed to get it from the class Consumes, and NPE can occurs when converting from Long to long. The method getDefaultTimeoutFrom of AbstractListener contains a private method to get the timeout value set on a consumer or a provider, and if not set, a default timeout value is used. So, it should be interesting to change the visibility of AbstractListener.getDefaultTimeoutFrom(...) to public, so instead of:
    long timeout = this.restExternalListener.getConsumes().getTimeout(); --> NPE if no timeout set
    we can use something as:
    long timeout = this.restExternalListener.getTimeout(this.restExternalListener.getConsumes());  --> No NPE if no timeout set, a default value is returned
  • Environment:
    -

Issue Links

Activity

Transition Status Change Time Execution Times Last Executer Last Execution Date
New New Open Open
43s
1
Christophe DENEUX
Fri, 24 Feb 2017 - 12:29:42 +0100
Open Open In Progress In Progress
3s
1
Christophe DENEUX
Fri, 24 Feb 2017 - 12:29:45 +0100
In Progress In Progress Resolved Resolved
1m 14s
1
Christophe DENEUX
Fri, 24 Feb 2017 - 12:30:59 +0100

People

Dates

  • Created:
    Fri, 24 Feb 2017 - 12:28:59 +0100
    Updated:
    Fri, 24 Feb 2017 - 12:36:11 +0100
    Resolved:
    Fri, 24 Feb 2017 - 12:30:59 +0100