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-3964 Review comments #4

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all 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 @@ -50,31 +50,36 @@ public interface DescriptorConstants {

/**
* Bean Pool - maximum size, a pool of slsb can grow to.
*/
*/
String MAX_POOL_SIZE = "MaxPoolSize";
int MAX_POOL_SIZE_DEFAULT = -1;

/**
* Bean Pool - maximum time a caller will have to wait when pool
* has reached maximum configured size and an instance is not
* available to process the incoming request.
*/
*/
String MAX_WAIT_TIME = "MaxWaitTimeInMillis";
int MAX_WAIT_TIME_DEFAULT = -1;

/**
* Bean Pool - size of slsb pool grows in increments specified by
* resize-quantity, within the configured upper limit max-pool-size.
*/
String POOL_RESIZE_QTY = "PoolResizeQuantity";
int POOL_RESIZE_QTY_DEFAULT = -1;

/**
* Bean Pool - minimum number of slsb instances maintained in a pool.
*/
*/
String STEADY_POOL_SIZE = "SteadyPoolSize";
int STEADY_POOL_SIZE_DEFAULT = -1;

/**
* Bean Pool - idle bean instance in a pool becomes a candidate for
* passivation (sfsb/eb) or deletion (slsb), when this timeout expires.
*/
*/
String POOL_IDLE_TIMEOUT = "PoolIdleTimeoutInSeconds";
int POOL_IDLE_TIMEOUT_DEFAULT = -1;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import javax.ejb.ActivationConfigProperty;
import javax.ejb.MessageDriven;

import com.sun.enterprise.deployment.DescriptorConstants;
import org.glassfish.ejb.deployment.annotation.handlers.AbstractEjbHandler;
import com.sun.enterprise.deployment.EnvironmentProperty;
import com.sun.enterprise.deployment.NameValuePairDescriptor;
Expand Down Expand Up @@ -117,7 +118,7 @@ protected EjbDescriptor createEjbDescriptor(String elementName,
* Set Annotation information to Descriptor.
* This method will also be invoked for an existing descriptor with
* annotation as user may not specific a complete xml.
* @param ejbDescMaxWaitTimeInMillis
* @param ejbDesc
* @param ainfo
* @return HandlerProcessingResult
*/
Expand All @@ -143,30 +144,41 @@ protected HandlerProcessingResult setEjbDescriptorInfo(
(String) TranslatedConfigView.getTranslatedValue(acProp.propertyValue()), "");
// with empty description
// xml override
if (acProp.propertyName().equals("resourceAdapter")) {
ejbMsgBeanDesc.setResourceAdapterMid(envProp.getValue());
} else if (acProp.propertyName().equals("MaxPoolSize")) {
initialiseBeanPoolDescriptor(ejbMsgBeanDesc);
ejbMsgBeanDesc.getIASEjbExtraDescriptors().getBeanPool().setMaxPoolSize(Integer.valueOf(envProp.getValue()));
} else if (acProp.propertyName().equals("PoolResizeQuantity")) {
initialiseBeanPoolDescriptor(ejbMsgBeanDesc);
ejbMsgBeanDesc.getIASEjbExtraDescriptors().getBeanPool().setPoolResizeQuantity(Integer.valueOf(envProp.getValue()));
} else if (acProp.propertyName().equals("SteadyPoolSize")) {
initialiseBeanPoolDescriptor(ejbMsgBeanDesc);
ejbMsgBeanDesc.getIASEjbExtraDescriptors().getBeanPool().setSteadyPoolSize(Integer.valueOf(envProp.getValue()));
} else if (acProp.propertyName().equals("MaxWaitTimeInMillis")) {
initialiseBeanPoolDescriptor(ejbMsgBeanDesc);
ejbMsgBeanDesc.getIASEjbExtraDescriptors().getBeanPool().setMaxWaitTimeInMillis(Integer.valueOf(envProp.getValue()));
} else if (acProp.propertyName().equals("PoolIdleTimeoutInSeconds")) {
initialiseBeanPoolDescriptor(ejbMsgBeanDesc);
ejbMsgBeanDesc.getIASEjbExtraDescriptors().getBeanPool().setPoolIdleTimeoutInSeconds(Integer.valueOf(envProp.getValue()));
} else if (acProp.propertyName().equals("SingletonBeanPool")) {
NameValuePairDescriptor singletonProperty = new NameValuePairDescriptor();
singletonProperty.setName("singleton-bean-pool");
singletonProperty.setValue(envProp.getValue());
ejbMsgBeanDesc.getEjbBundleDescriptor().addEnterpriseBeansProperty(singletonProperty);
} else if (ejbMsgBeanDesc.getActivationConfigValue(envProp.getName()) == null) {
ejbMsgBeanDesc.putActivationConfigProperty(envProp);
switch (acProp.propertyName()) {
case "resourceAdapter":
ejbMsgBeanDesc.setResourceAdapterMid(envProp.getValue());
break;
case DescriptorConstants.MAX_POOL_SIZE:
initialiseBeanPoolDescriptor(ejbMsgBeanDesc);
ejbMsgBeanDesc.getIASEjbExtraDescriptors().getBeanPool().setMaxPoolSize(Integer.valueOf(envProp.getValue()));
break;
case DescriptorConstants.POOL_RESIZE_QTY:
initialiseBeanPoolDescriptor(ejbMsgBeanDesc);
ejbMsgBeanDesc.getIASEjbExtraDescriptors().getBeanPool().setPoolResizeQuantity(Integer.valueOf(envProp.getValue()));
break;
case DescriptorConstants.STEADY_POOL_SIZE:
initialiseBeanPoolDescriptor(ejbMsgBeanDesc);
ejbMsgBeanDesc.getIASEjbExtraDescriptors().getBeanPool().setSteadyPoolSize(Integer.valueOf(envProp.getValue()));
break;
case DescriptorConstants.MAX_WAIT_TIME:
initialiseBeanPoolDescriptor(ejbMsgBeanDesc);
ejbMsgBeanDesc.getIASEjbExtraDescriptors().getBeanPool().setMaxWaitTimeInMillis(Integer.valueOf(envProp.getValue()));
break;
case DescriptorConstants.POOL_IDLE_TIMEOUT:
initialiseBeanPoolDescriptor(ejbMsgBeanDesc);
ejbMsgBeanDesc.getIASEjbExtraDescriptors().getBeanPool().setPoolIdleTimeoutInSeconds(Integer.valueOf(envProp.getValue()));
break;
case "SingletonBeanPool":
NameValuePairDescriptor singletonProperty = new NameValuePairDescriptor();
singletonProperty.setName("singleton-bean-pool");
singletonProperty.setValue(envProp.getValue());
ejbMsgBeanDesc.getEjbBundleDescriptor().addEnterpriseBeansProperty(singletonProperty);
break;
default:
if (ejbMsgBeanDesc.getActivationConfigValue(envProp.getName()) == null) {
ejbMsgBeanDesc.putActivationConfigProperty(envProp);
}
break;
}
}

Expand Down