Skip to content

Commit

Permalink
add new property
Browse files Browse the repository at this point in the history
Signed-off-by: Ryosuke Okada <ryosuke.okada@fujitsu.com>
Signed-off-by: arjantijms <arjan.tijms@gmail.com>
  • Loading branch information
11rx4f authored and arjantijms committed Dec 29, 2021
1 parent bd6af8f commit 0b114d5
Show file tree
Hide file tree
Showing 21 changed files with 613 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!--
Copyright (c) 2005, 2018 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2021 Contributors to the Eclipse Foundation
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -57,6 +58,18 @@ <h4>Edit Managed Executor Service<a id="sthref33" name="sthref33"></a></h4>
<dd>
<p>The number of seconds tasks can execute before they are considered unresponsive. The default value is 0.</p>
</dd>
<dt>Hung Logger Print Once</dt>
<dd>
<p>Specifies whether to print the warning message once or repeatedly. The default value is false. If set to true, the warning message is printed only once when detect a hung task exceeds "Hung After".</p>
</dd>
<dt>Hung Logger Initial Delay</dt>
<dd>
<p>The number of seconds to delay logging the detection of hung tasks. The default value is 60.</p>
</dd>
<dt>Hung Logger Interval</dt>
<dd>
<p>The number of seconds between logging the detection of hung tasks. The default value is 60.</p>
</dd>
<dt>Deployment Order</dt>
<dd>
<p>The deployment order of this resource. Resources with lower numbers are loaded first at server startup. The default value is 100.</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!--
Copyright (c) 2005, 2018 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2021 Contributors to the Eclipse Foundation
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -47,6 +48,18 @@ <h4>New Managed Executor Service<a id="sthref31" name="sthref31"></a></h4>
<dd>
<p>The number of seconds tasks can execute before they are considered unresponsive. The default value is 0.</p>
</dd>
<dt>Hung Logger Print Once</dt>
<dd>
<p>Specifies whether to print the warning message once or repeatedly. The default value is false. If set to true, the warning message is printed only once when detect a hung task exceeds "Hung After".</p>
</dd>
<dt>Hung Logger Initial Delay</dt>
<dd>
<p>The number of seconds to delay logging the detection of hung tasks. The default value is 60.</p>
</dd>
<dt>Hung Logger Interval</dt>
<dd>
<p>The number of seconds between logging the detection of hung tasks. The default value is 60.</p>
</dd>
<dt>Description</dt>
<dd>
<p>A description of this resource.</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!--
Copyright (c) 2005, 2018 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2021 Contributors to the Eclipse Foundation
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -57,6 +58,18 @@ <h4>Edit Managed Scheduled Executor Service<a id="sthref40" name="sthref40"></a>
<dd>
<p>The number of seconds tasks can execute before they are considered unresponsive. The default value is 0.</p>
</dd>
<dt>Hung Logger Print Once</dt>
<dd>
<p>Specifies whether to print the warning message once or repeatedly. The default value is false. If set to true, the warning message is printed only once when detect a hung task exceeds "Hung After".</p>
</dd>
<dt>Hung Logger Initial Delay</dt>
<dd>
<p>The number of seconds to delay logging the detection of hung tasks. The default value is 60.</p>
</dd>
<dt>Hung Logger Interval</dt>
<dd>
<p>The number of seconds between logging the detection of hung tasks. The default value is 60.</p>
</dd>
<dt>Deployment Order</dt>
<dd>
<p>The deployment order of this resource. Resources with lower numbers are loaded first at server startup. The default value is 100.</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!--
Copyright (c) 2005, 2018 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2021 Contributors to the Eclipse Foundation
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -47,6 +48,18 @@ <h4>New Managed Scheduled Executor Service<a id="sthref38" name="sthref38"></a><
<dd>
<p>The number of seconds tasks can execute before they are considered unresponsive. The default value is 0.</p>
</dd>
<dt>Hung Logger Print Once</dt>
<dd>
<p>Specifies whether to print the warning message once or repeatedly. The default value is false. If set to true, the warning message is printed only once when detect a hung task exceeds "Hung After".</p>
</dd>
<dt>Hung Logger Initial Delay</dt>
<dd>
<p>The number of seconds to delay logging the detection of hung tasks. The default value is 60.</p>
</dd>
<dt>Hung Logger Interval</dt>
<dd>
<p>The number of seconds between logging the detection of hung tasks. The default value is 60.</p>
</dd>
<dt>Description</dt>
<dd>
<p>A description of this resource.</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!--
Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2021 Contributors to the Eclipse Foundation
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -64,6 +65,17 @@
<sun:textField id="hungafter" styleClass="integer" columns="$int{55}" maxLength="#{sessionScope.fieldLengths['maxLength.common.description']}" text="#{pageSession.valueMap['hungAfterSeconds']}" />
<sun:staticText id="sec" style="padding: 8pt" text="$resource{i18n.common.Seconds}"/>
</sun:property>
<sun:property id="hungLoggerPrintOnce" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18ncon.hungLoggerPrintOnce}">
<sun:checkbox selected="#{pageSession.valueMap['hungLoggerPrintOnce']}" selectedValue="true" />
</sun:property>
<sun:property id="hungLoggerInitialDelay" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18ncon.hungLoggerInitialDelaySeconds}" helpText="$resource{i18ncon.hungLoggerInitialDelaySecondsHelp}">
<sun:textField id="hungLoggerInitialDelay" styleClass="integer" columns="$int{55}" maxLength="#{sessionScope.fieldLengths['maxLength.common.description']}" text="#{pageSession.valueMap['hungLoggerInitialDelaySeconds']}" />
<sun:staticText id="sec" style="padding: 8pt" text="$resource{i18n.common.Seconds}"/>
</sun:property>
<sun:property id="hungLoggerInterval" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18ncon.hungLoggerIntervalSeconds}" helpText="$resource{i18ncon.hungLoggerIntervalSecondsHelp}">
<sun:textField id="hungLoggerInterval" styleClass="integer" columns="$int{55}" maxLength="#{sessionScope.fieldLengths['maxLength.common.description']}" text="#{pageSession.valueMap['hungLoggerIntervalSeconds']}" />
<sun:staticText id="sec" style="padding: 8pt" text="$resource{i18n.common.Seconds}"/>
</sun:property>
<sun:property id="deploymentOrder" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" rendered="#{edit}" label="$resource{i18n.common.resource.deploymentOrder}" helpText="$resource{i18n.common.resource.deploymentOrderHelp}">
<sun:textField id="deploymentOrder" styleClass="integer" columns="$int{10}" maxLength="#{sessionScope.fieldLengths['maxLength.common.deploymentOrder']}" text="#{pageSession.valueMap['deploymentOrder']}" />
</sun:property>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

gf.buildResourceUrl(base="#{pageSession.parentUrl}/#{pageSession.childType}", resourceName="#{pageSession.Name}", url="#{pageSession.selfUrl}");
gf.getEntityAttrs(endpoint="#{pageSession.selfUrl}", valueMap="#{pageSession.valueMap}");
setPageSessionAttribute(key="convertToFalseList" value={"enabled", "contextInfoEnabled", "longRunningTasks" });
setPageSessionAttribute(key="convertToFalseList" value={"enabled", "contextInfoEnabled", "longRunningTasks", "hungLoggerPrintOnce" });
setPageSessionAttribute(key="skipAttrsList", value={"jndiName"});

gf.restRequest(endpoint="#{pageSession.selfUrl}/property" method="GET" result="#{requestScope.propTable}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
setPageSessionAttribute(key="parentPage" value="#{request.contextPath}/concurrent/managedExecutorServices.jsf");
setPageSessionAttribute(key="childType" value="managed-executor-service");
setPageSessionAttribute(key="isConcurrent" value="true");
setPageSessionAttribute(key="convertToFalseList" value={"enabled", "contextInfoEnabled","longRunningTasks" });
setPageSessionAttribute(key="convertToFalseList" value={"enabled", "contextInfoEnabled","longRunningTasks", "hungLoggerPrintOnce" });
setPageSessionAttribute(key="parentUrl", value="#{sessionScope.REST_URL}/resources");
gf.getDefaultValues(endpoint="#{pageSession.parentUrl}/#{pageSession.childType}", valueMap="#{pageSession.valueMap}");
setPageSessionAttribute(key="edit" value="#{false}" );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

gf.buildResourceUrl(base="#{pageSession.parentUrl}/#{pageSession.childType}", resourceName="#{pageSession.Name}", url="#{pageSession.selfUrl}");
gf.getEntityAttrs(endpoint="#{pageSession.selfUrl}", valueMap="#{pageSession.valueMap}");
setPageSessionAttribute(key="convertToFalseList" value={"enabled", "contextInfoEnabled", "longRunningTasks" });
setPageSessionAttribute(key="convertToFalseList" value={"enabled", "contextInfoEnabled", "longRunningTasks", "hungLoggerPrintOnce" });
setPageSessionAttribute(key="skipAttrsList", value={"jndiName"});

gf.restRequest(endpoint="#{pageSession.selfUrl}/property" method="GET" result="#{requestScope.propTable}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
setPageSessionAttribute(key="parentPage" value="#{request.contextPath}/concurrent/managedScheduledExecutorServices.jsf");
setPageSessionAttribute(key="childType" value="managed-scheduled-executor-service");
setPageSessionAttribute(key="isConcurrent" value="true");
setPageSessionAttribute(key="convertToFalseList" value={"enabled", "contextInfoEnabled", "longRunningTasks" });
setPageSessionAttribute(key="convertToFalseList" value={"enabled", "contextInfoEnabled", "longRunningTasks", "hungLoggerPrintOnce" });
setPageSessionAttribute(key="parentUrl", value="#{sessionScope.REST_URL}/resources");
gf.getDefaultValues(endpoint="#{pageSession.parentUrl}/#{pageSession.childType}", valueMap="#{pageSession.valueMap}");
setPageSessionAttribute(key="edit" value="#{false}" );
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#
# Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2021 Contributors to the Eclipse Foundation
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -93,6 +94,12 @@ longRunningTasks=Long-Running Tasks:
longRunningTasksHelp=Use the resource for long-running tasks. If enabled, long-running tasks are not reported as stuck.
hungAfterSeconds=Hung After:
hungAfterSecondsHelp=Number of seconds tasks can execute before they are considered unresponsive
hungLoggerPrintOnce=Hung Logger Print Once:
hungLoggerPrintOnceHelp=Print the warning message only once when hung tasks is detect a hung task exceeds "Hung After".
hungLoggerInitialDelaySeconds=Hung Logger Initial Delay:
hungLoggerInitialDelaySecondsHelp=Number of seconds to delay logging the detection of hung tasks.
hungLoggerIntervalSeconds=Hung Logger Interval:
hungLoggerIntervalSecondsHelp=Number of seconds between logging the detection of hung tasks.
corePoolSize=Core Size:
corePoolSizeHelp=Number of threads to keep in a thread pool
maximumPoolSize=Maximum Pool Size:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -87,6 +88,55 @@ public interface ManagedExecutorServiceBase extends ConfigBeanProxy,
*/
void setHungAfterSeconds(String value) throws PropertyVetoException;

/**
* Gets the value of the hungLoggerPrintOnce property.
*
* @return possible object is
* {@link String }
*/
@Attribute(defaultValue="false", dataType=Boolean.class)
String getHungLoggerPrintOnce();

/**
* Sets the value of the hungLoggerPrintOnce property.
*
* @param value allowed object is
* {@link String }
*/
void setHungLoggerPrintOnce(String value) throws PropertyVetoException;

/**
* Gets the value of the hungLoggerInitialDelaySeconds property.
*
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "60", dataType = Long.class)
@Min(value = 0)
String getHungLoggerInitialDelaySeconds();

/**
* Sets the value of the hungLoggerInitialDelaySeconds property.
*
* @param value allowed object is {@link String }
*/
void setHungLoggerInitialDelaySeconds(String value) throws PropertyVetoException;

/**
* Gets the value of the hungLoggerIntervalSeconds property.
*
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "60", dataType = Long.class)
@Min(value = 1)
String getHungLoggerIntervalSeconds();

/**
* Sets the value of the hungLoggerIntervalSeconds property.
*
* @param value allowed object is {@link String }
*/
void setHungLoggerIntervalSeconds(String value) throws PropertyVetoException;

/**
* Gets the value of the corePoolSize property.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -55,6 +56,15 @@ public class CreateManagedExecutorServiceBase {
@Param(name="hungafterseconds", alias="hungAfterSeconds", defaultValue="0", optional=true)
protected Integer hungafterseconds;

@Param(name="hungloggerprintonce", alias="hungLoggerPrintOnce", defaultValue="false", optional=true)
protected Boolean hungloggerprintonce;

@Param(name = "hungloggerinitialdelayseconds", alias = "hungLoggerInitialDelaySeconds", defaultValue = "60", optional = true)
protected Integer hungloggerinitialdelayseconds;

@Param(name = "hungloggerintervalseconds", alias = "hungLoggerIntervalSeconds", defaultValue = "60", optional = true)
protected Integer hungloggerintervalseconds;

@Param(name="corepoolsize", alias="corePoolSize", defaultValue="0", optional=true)
protected Integer corepoolsize;

Expand Down Expand Up @@ -83,6 +93,10 @@ protected void setAttributeList(HashMap attrList) {
longrunningtasks.toString());
attrList.put(ResourceConstants.HUNG_AFTER_SECONDS,
hungafterseconds.toString());
attrList.put(ResourceConstants.HUNG_LOGGER_PRINT_ONCE,
hungloggerprintonce.toString());
attrList.put(ResourceConstants.HUNG_LOGGER_INITIAL_DELAY_SECONDS, hungloggerinitialdelayseconds.toString());
attrList.put(ResourceConstants.HUNG_LOGGER_INTERVAL_SECONDS, hungloggerintervalseconds.toString());
attrList.put(ResourceConstants.CORE_POOL_SIZE,
corepoolsize.toString());
attrList.put(ResourceConstants.KEEP_ALIVE_SECONDS,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -60,6 +61,9 @@ public abstract class ManagedExecutorServiceBaseManager implements ResourceManag
protected String contextInfo = CONTEXT_INFO_DEFAULT_VALUE;
protected String longRunningTasks = Boolean.FALSE.toString();
protected String hungAfterSeconds = "0";
protected String hungLoggerPrintOnce = Boolean.FALSE.toString();
protected String hungLoggerInitialDelaySeconds = "60";
protected String hungLoggerIntervalSeconds = "60";
protected String corePoolSize = "0";
protected String keepAliveSeconds = "60";
protected String threadLifetimeSeconds = "0";
Expand Down Expand Up @@ -141,6 +145,9 @@ protected void setAttributes(HashMap attributes, String target) {
threadPriority = (String) attributes.get(THREAD_PRIORITY);
longRunningTasks = (String) attributes.get(LONG_RUNNING_TASKS);
hungAfterSeconds = (String) attributes.get(HUNG_AFTER_SECONDS);
hungLoggerPrintOnce = (String) attributes.get(HUNG_LOGGER_PRINT_ONCE);
hungLoggerInitialDelaySeconds = (String) attributes.get(HUNG_LOGGER_INITIAL_DELAY_SECONDS);
hungLoggerIntervalSeconds = (String) attributes.get(HUNG_LOGGER_INTERVAL_SECONDS);
corePoolSize = (String) attributes.get(CORE_POOL_SIZE);
keepAliveSeconds = (String) attributes.get(KEEP_ALIVE_SECONDS);
threadLifetimeSeconds = (String) attributes.get(THREAD_LIFETIME_SECONDS);
Expand Down Expand Up @@ -169,6 +176,9 @@ protected void setAttributesOnConfigBean(ManagedExecutorServiceBase managedExecu
managedExecutorService.setContextInfo(contextInfo);
managedExecutorService.setThreadPriority(threadPriority);
managedExecutorService.setHungAfterSeconds(hungAfterSeconds);
managedExecutorService.setHungLoggerPrintOnce(hungLoggerPrintOnce);
managedExecutorService.setHungLoggerInitialDelaySeconds(hungLoggerInitialDelaySeconds);
managedExecutorService.setHungLoggerIntervalSeconds(hungLoggerIntervalSeconds);
managedExecutorService.setCorePoolSize(corePoolSize);
managedExecutorService.setKeepAliveSeconds(keepAliveSeconds);
managedExecutorService.setThreadLifetimeSeconds(threadLifetimeSeconds);
Expand Down
Loading

0 comments on commit 0b114d5

Please sign in to comment.