use of org.glassfish.ejb.deployment.descriptor.runtime.IASEjbExtraDescriptors in project Payara by payara.
the class ASEjbCommitOption method check.
/**
* @param descriptor
* @return
*/
public Result check(EjbDescriptor descriptor) {
Result result = getInitializedResult();
ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
boolean oneFailed = false;
try {
IASEjbExtraDescriptors iasEjbExtraDesc = descriptor.getIASEjbExtraDescriptors();
String commitOption = iasEjbExtraDesc.getCommitOption();
if (commitOption != null) {
if (commitOption.length() == 0) {
addErrorDetails(result, compName);
result.failed(smh.getLocalString(getClass().getName() + ".failed", "FAILED [AS-EJB ejb] : commit-option cannot be an empty String"));
} else {
if (// 4699329
!commitOption.equals("A") && !commitOption.equals("B") && !commitOption.equals("C")) {
addErrorDetails(result, compName);
result.failed(// 4699329
smh.getLocalString(// 4699329
getClass().getName() + ".failed1", "FAILED [AS-EJB ejb] : commit-option cannot be {0}. " + "It must be one of A, B and " + "C", new Object[] { commitOption }));
}
}
} else {
addNaDetails(result, compName);
result.notApplicable(smh.getLocalString(getClass().getName() + ".notApplicable", "NOT APPLICABLE [AS-EJB ejb] commit-option Element is not defined"));
}
} catch (Exception ex) {
addErrorDetails(result, compName);
result.addErrorDetails(smh.getLocalString(getClass().getName() + ".notRun", "NOT RUN [AS-EJB] : Could not create an descriptor object"));
}
return result;
}
use of org.glassfish.ejb.deployment.descriptor.runtime.IASEjbExtraDescriptors in project Payara by payara.
the class ASEjbJMSMaxMessagesLoad method check.
public Result check(EjbDescriptor descriptor) {
Result result = getInitializedResult();
ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
try {
IASEjbExtraDescriptors iasEjbDescriptor = descriptor.getIASEjbExtraDescriptors();
int value = iasEjbDescriptor.getJmsMaxMessagesLoad();
Integer jmsMaxMsgs = new Integer(value);
if (jmsMaxMsgs != null) {
if (value < 1 || value > Integer.MAX_VALUE) {
addErrorDetails(result, compName);
result.failed(smh.getLocalString(getClass().getName() + ".failed", "FAILED [AS-EJB ejb] : {0} is not a valid value for jms-max-messages-load. It should be " + '\n' + "between 0 and MAX_INT", new Object[] { new Integer(value) }));
} else {
addGoodDetails(result, compName);
result.passed(smh.getLocalString(getClass().getName() + ".passed", "PASSED [AS-EJB ejb] : jms-max-messages-load is {0}", new Object[] { jmsMaxMsgs }));
}
} else {
if (descriptor instanceof EjbMessageBeanDescriptor) {
// <addition author="irfan@sun.com" [bug/rfe]-id="4724447" >
// Change in message output ms->jms //
addWarningDetails(result, compName);
result.warning(smh.getLocalString(getClass().getName() + ".warning", "WARNING [AS-EJB ejb] : jms-max-messages-load should be defined for MDBs"));
} else {
addNaDetails(result, compName);
result.notApplicable(smh.getLocalString(getClass().getName() + ".notApplicable", "NOT APPLICABLE [AS-EJB ejb] : jms-max-messages-load element is not defined"));
}
}
} catch (Exception ex) {
addErrorDetails(result, compName);
result.addErrorDetails(smh.getLocalString(getClass().getName() + ".notRun", "NOT RUN [AS-EJB] : Could not create a descriptor object"));
}
return result;
}
use of org.glassfish.ejb.deployment.descriptor.runtime.IASEjbExtraDescriptors in project Payara by payara.
the class AsynchronousTask method loadCheckpointInfo.
protected void loadCheckpointInfo() {
try {
if (isHAEnabled) {
Iterator iter = invocationInfoMap.values().iterator();
while (iter.hasNext()) {
InvocationInfo info = (InvocationInfo) iter.next();
info.checkpointEnabled = false;
MethodDescriptor md = new MethodDescriptor(info.method, info.methodIntf);
IASEjbExtraDescriptors extraDesc = ejbDescriptor.getIASEjbExtraDescriptors();
if (extraDesc != null) {
CheckpointAtEndOfMethodDescriptor cpDesc = extraDesc.getCheckpointAtEndOfMethodDescriptor();
if (cpDesc != null) {
info.checkpointEnabled = cpDesc.isCheckpointEnabledFor(md);
}
}
if (info.checkpointEnabled) {
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "[SFSBContainer] " + info.method + " MARKED for " + "end-of-method-checkpoint");
}
}
}
}
} catch (Exception ex) {
_logger.log(Level.WARNING, EXCEPTION_WHILE_LOADING_CHECKPOINT, ex);
}
}
use of org.glassfish.ejb.deployment.descriptor.runtime.IASEjbExtraDescriptors in project Payara by payara.
the class CacheProperties method init.
public void init(EjbDescriptor desc) {
BeanCacheDescriptor beanCacheDes = null;
IASEjbExtraDescriptors iased = desc.getIASEjbExtraDescriptors();
if (iased != null) {
beanCacheDes = iased.getBeanCache();
}
loadProperties(ejbContainer, desc, beanCacheDes);
// container.setMonitorOn(ejbContainer.isMonitoringEnabled());
}
use of org.glassfish.ejb.deployment.descriptor.runtime.IASEjbExtraDescriptors in project Payara by payara.
the class EntityContainerFactory method createContainer.
public Container createContainer(EjbDescriptor ejbDescriptor, ClassLoader loader, DeploymentContext deployContext) throws Exception {
EntityContainer container = null;
SecurityManager sm = getSecurityManager(ejbDescriptor);
// hence we can always cast
assert ejbDescriptor instanceof EjbEntityDescriptor;
if (((EjbEntityDescriptor) ejbDescriptor).getIASEjbExtraDescriptors().isIsReadOnlyBean()) {
container = new ReadOnlyBeanContainer(ejbDescriptor, loader, sm);
} else {
String commitOption = null;
IASEjbExtraDescriptors iased = ((EjbEntityDescriptor) ejbDescriptor).getIASEjbExtraDescriptors();
if (iased != null) {
commitOption = iased.getCommitOption();
}
if (commitOption == null) {
commitOption = ejbContainerDesc.getCommitOption();
}
if (commitOption.equals("A")) {
_logger.log(Level.WARNING, "entitybean.container.commit_option_A_not_supported", new Object[] { ejbDescriptor.getName() });
container = new EntityContainer(ejbDescriptor, loader, sm);
} else if (commitOption.equals("C")) {
_logger.log(Level.FINE, "Using commit option C for: " + ejbDescriptor.getName());
container = new CommitCEntityContainer(ejbDescriptor, loader, sm);
} else {
_logger.log(Level.FINE, "Using commit option B for: " + ejbDescriptor.getName());
container = new EntityContainer(ejbDescriptor, loader, sm);
}
}
container.initializeHome();
return container;
}
Aggregations