Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Payara 1159 admin console integration for ejb pool features #1610

Merged
merged 6 commits into from
May 28, 2017
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@
setPageSessionAttribute(key="rest-api" value="true");

gf.getEntityAttrs(endpoint="#{pageSession.selfUrl}.json", valueMap="#{pageSession.valueMap}");


setPageSessionAttribute(key="convertToFalseList", value={"limitInstances"});
gf.restRequest(endpoint="#{pageSession.selfUrl}/property.json" method="GET" result="#{requestScope.propTable}");
setPageSessionAttribute(key="tableList" value="#{requestScope.propTable.data.extraProperties.properties}");

Expand Down Expand Up @@ -120,6 +121,13 @@
<sun:textField id="Timeout" styleClass="integer" columns="$int{20}" maxLength="#{sessionScope.fieldLengths['maxLength.ejbSettings.timeout']}" style="padding-bottom 8pt" text="#{pageSession.valueMap['poolIdleTimeoutInSeconds']}" />
<sun:staticText id="sec" style="padding: 8pt" text="$resource{i18n.common.Seconds}"/>
</sun:property>
<sun:property id="LimitInstances" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18n_ejbLite.ejbSettings.limitInstanceLabel}" helpText="$resource{i18n_ejbLite.ejbSettings.limitInstanceHelp}">
<sun:checkbox id="LimitInstances" selected="#{pageSession.valueMap['limitInstances']}" selectedValue="true" />
</sun:property>
<sun:property id="MaxWaitTimeMillisProp" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18n_ejbLite.ejbSettings.maxWaitTimeMillisLabel}" helpText="$resource{i18n_ejbLite.ejbSettings.maxWaitTimeMillisHelp}">
<sun:textField id="MaxWaitTimeMillis" styleClass="integer" columns="$int{20}" maxLength="#{sessionScope.fieldLengths['maxLength.ejbSettings.maxWaitTimeMillis']}" style="padding-bottom 8pt" text="#{pageSession.valueMap['maxWaitTimeInMillis']}" />
<sun:staticText id="milli" style="padding: 8pt" text="$resource{i18n.common.Milliseconds}"/>
</sun:property>
</sun:propertySheetSection>
<!-- Cache Settings section -->
<sun:propertySheetSection id="cacheSettingSection" label="$resource{i18n_ejbLite.ejbSettings.cacheSettingsLabel}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,13 @@ ejbSettings.maxSizeHelp=Maximum number of beans that can be created to satisfy c
ejbSettings.poolResizeLabel=Pool Resize Quantity:
ejbSettings.poolResizeHelp=Number of beans to be removed when pool idle timeout expires
ejbSettings.timeoutLabel=Pool Idle Timeout:
ejbSettings.timeoutHelp=Number of beans to be removed when pool idle timeout timer expires
ejbSettings.timeoutHelp=Amount of time before pool idle timeout timer expires

ejbSettings.limitInstanceLabel=Limit Concurrent EJB Instances:
ejbSettings.limitInstanceHelp=Enable maximum allowable concurrent instances/threads for any particular stateless EJB
ejbSettings.maxWaitTimeMillisLabel=Timeout to wait for EJB instance:
ejbSettings.maxWaitTimeMillisHelp=In milliseconds, maximum time to wait for available EJB instance/thread. 0 (default) means indefinite.

ejbSettings.cacheSettingsLabel=Cache Settings
ejbSettings.maxCacheLabel=Max Cache Size:
ejbSettings.maxCacheHelp=Default is 512 beans
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import org.glassfish.quality.ToDo;

import javax.validation.constraints.Min;
import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import org.glassfish.api.admin.config.PropertyDesc;
Expand Down Expand Up @@ -243,6 +244,43 @@ public interface EjbContainer extends ConfigBeanProxy, PropertyBag, ConfigExtens
*/
void setPoolIdleTimeoutInSeconds(String value) throws PropertyVetoException;

/**
* Gets the value of the maxWaitTimeInMillis property.
*
* @return possible object is
* {@link String }
*/
@Attribute(defaultValue="6000")
@Min(value=0)
@Max(value=30000)
String getMaxWaitTimeInMillis();

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

/**
* Gets the value of the limitInstances property.
*
* @return possible object is
* {@link Boolean }
*/
@Attribute(defaultValue = "false")
@Pattern(regexp = "true|false")
String getLimitInstances();

/**
* Sets the value of the limitInstances property.
*
* @param value allowed object is
* {@link Boolean }
*/
void setLimitInstances(Boolean value) throws PropertyVetoException;

/**
* Gets the value of the cacheIdleTimeoutInSeconds property.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -772,14 +772,17 @@ public void destroy(Object obj) {

private static class PoolProperties {
int maxPoolSize;
int maxWaitTimeInMillis = Integer.getInteger(String.format("fish.payara.ejb-container.%s", RuntimeTagNames.MAX_WAIT_TIME_IN_MILLIS),
DescriptorConstants.MAX_WAIT_TIME_DEFAULT);
int maxWaitTimeInMillis;
int poolIdleTimeoutInSeconds;
int poolResizeQuantity;
int steadyPoolSize;

public PoolProperties(EjbContainer ejbContainer, BeanPoolDescriptor beanPoolDes) {

maxWaitTimeInMillis = Integer.parseInt(ejbContainer.getMaxWaitTimeInMillis());
if(!Boolean.valueOf(ejbContainer.getLimitInstances())) {
maxWaitTimeInMillis = -1;
}
maxPoolSize = Integer.parseInt(ejbContainer.getMaxPoolSize());
poolIdleTimeoutInSeconds = Integer.parseInt(
ejbContainer.getPoolIdleTimeoutInSeconds());
Expand Down