Skip to content

Commit

Permalink
Merge pull request payara#604 from aubi/FISH-5722-mes-in-payara-resou…
Browse files Browse the repository at this point in the history
…rces-xml

Fish 5722 mes in payara resources xml
  • Loading branch information
aubi committed Jun 17, 2022
2 parents 27993c8 + 6cecdb9 commit d9aff93
Show file tree
Hide file tree
Showing 21 changed files with 2,430 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
// Portions Copyright [2016-2018] [Payara Foundation]
// Portions Copyright [2016-2022] [Payara Foundation]
package org.glassfish.concurrent.admin;

import com.sun.appserv.connectors.internal.api.ConnectorsUtil;
Expand Down Expand Up @@ -153,7 +153,13 @@ protected ResourceStatus isValid(Resources resources, boolean validateResourceRe
clazz = ManagedScheduledExecutorService.class;
}
status = resourcesHelper.validateBindableResourceForDuplicates(resources, jndiName, validateResourceRef, target, clazz);


try {
Integer.parseInt(corePoolSize);
} catch (NumberFormatException nfe) {
return new ResourceStatus(ResourceStatus.FAILURE, localStrings.getLocalString("coresize.must.be.number", "Option corepoolsize must be a number."));
}

return status;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
// Portions Copyright [2022] [Payara Foundation and/or its affiliates]

package org.glassfish.concurrent.admin;

Expand Down Expand Up @@ -78,19 +79,26 @@ protected void setAttributes(HashMap attributes, String target) {

@Override
protected ResourceStatus isValid(Resources resources, boolean validateResourceRef, String target){
if (Integer.parseInt(corePoolSize) == 0 &&
Integer.parseInt(maximumPoolSize) == 0) {
ResourceStatus superStatus = super.isValid(resources, validateResourceRef, target);

try {
Integer.parseInt(maximumPoolSize);
} catch (NumberFormatException nfe) {
return new ResourceStatus(ResourceStatus.FAILURE, localStrings.getLocalString("maxsize.must.be.number", "Option maximumpoolsize must be a number."));
}

if (Integer.parseInt(corePoolSize) == 0
&& Integer.parseInt(maximumPoolSize) == 0) {
String msg = localStrings.getLocalString("coresize.maxsize.both.zero", "Options corepoolsize and maximumpoolsize cannot both have value 0.");
return new ResourceStatus(ResourceStatus.FAILURE, msg);
}

if (Integer.parseInt(corePoolSize) >
Integer.parseInt(maximumPoolSize)) {
if (Integer.parseInt(corePoolSize) > Integer.parseInt(maximumPoolSize)) {
String msg = localStrings.getLocalString("coresize.biggerthan.maxsize", "Option corepoolsize cannot have a bigger value than option maximumpoolsize.");
return new ResourceStatus(ResourceStatus.FAILURE, msg);
}

return super.isValid(resources, validateResourceRef, target);
return superStatus;
}

protected ManagedExecutorServiceBase createConfigBean(Resources param, Properties properties) throws PropertyVetoException, TransactionFailure {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
# only if the new code is made subject to such option by the copyright
# holder.
#
# Portions Copyright [2022] [Payara Foundation and/or its affiliates]

#context-service element
create.context.service.failed=Context service {0} creation failed.
Expand Down Expand Up @@ -86,6 +87,8 @@ delete.managed.scheduled.executor.service.no.resource-ref=This managed scheduled
delete.managed.scheduled.executor.service.multiple.resource-refs=This managed scheduled executor service [ {0} ] is referenced in multiple instance/cluster targets, Use delete-resource-ref on appropriate target.
list.managed.scheduled.executor.service.failed=List managed scheduled executor services failed.

coresize.must.be.number=Option corepoolsize must be a number.
maxsize.must.be.number=Option maximumpoolsize must be a number.
coresize.maxsize.both.zero=Options corepoolsize and maximumpoolsize cannot both have value 0.
coresize.biggerthan.maxsize=Option corepoolsize cannot have a bigger value than option maximumpoolsize.
delete.concurrent.resource.notAllowed=The {0} resource cannot be deleted as it is required to be configured in the system.

0 comments on commit d9aff93

Please sign in to comment.