Search in sources :

Example 1 with IASEjbExtraDescriptors

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;
}
Also used : IASEjbExtraDescriptors(org.glassfish.ejb.deployment.descriptor.runtime.IASEjbExtraDescriptors) ComponentNameConstructor(com.sun.enterprise.tools.verifier.tests.ComponentNameConstructor) Result(com.sun.enterprise.tools.verifier.Result)

Example 2 with IASEjbExtraDescriptors

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;
}
Also used : EjbMessageBeanDescriptor(org.glassfish.ejb.deployment.descriptor.EjbMessageBeanDescriptor) IASEjbExtraDescriptors(org.glassfish.ejb.deployment.descriptor.runtime.IASEjbExtraDescriptors) ComponentNameConstructor(com.sun.enterprise.tools.verifier.tests.ComponentNameConstructor) Result(com.sun.enterprise.tools.verifier.Result)

Example 3 with IASEjbExtraDescriptors

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);
    }
}
Also used : InvocationInfo(com.sun.ejb.InvocationInfo) Iterator(java.util.Iterator) IASEjbExtraDescriptors(org.glassfish.ejb.deployment.descriptor.runtime.IASEjbExtraDescriptors) MethodDescriptor(com.sun.enterprise.deployment.MethodDescriptor) CheckpointAtEndOfMethodDescriptor(org.glassfish.ejb.deployment.descriptor.runtime.CheckpointAtEndOfMethodDescriptor) IllegalLoopbackException(javax.ejb.IllegalLoopbackException) ConcurrentAccessException(javax.ejb.ConcurrentAccessException) RemoveException(javax.ejb.RemoveException) ConcurrentAccessTimeoutException(javax.ejb.ConcurrentAccessTimeoutException) InvocationTargetException(java.lang.reflect.InvocationTargetException) RemoteException(java.rmi.RemoteException) EJBException(javax.ejb.EJBException) BackingStoreException(org.glassfish.ha.store.api.BackingStoreException) IOException(java.io.IOException) NotSerializableException(java.io.NotSerializableException) SystemException(javax.transaction.SystemException) CreateException(javax.ejb.CreateException) NoSuchObjectLocalException(javax.ejb.NoSuchObjectLocalException) CheckpointAtEndOfMethodDescriptor(org.glassfish.ejb.deployment.descriptor.runtime.CheckpointAtEndOfMethodDescriptor)

Example 4 with IASEjbExtraDescriptors

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());
}
Also used : BeanCacheDescriptor(org.glassfish.ejb.deployment.descriptor.runtime.BeanCacheDescriptor) IASEjbExtraDescriptors(org.glassfish.ejb.deployment.descriptor.runtime.IASEjbExtraDescriptors)

Example 5 with IASEjbExtraDescriptors

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;
}
Also used : EjbEntityDescriptor(org.glassfish.ejb.deployment.descriptor.EjbEntityDescriptor) SecurityManager(com.sun.enterprise.security.SecurityManager) IASEjbExtraDescriptors(org.glassfish.ejb.deployment.descriptor.runtime.IASEjbExtraDescriptors)

Aggregations

IASEjbExtraDescriptors (org.glassfish.ejb.deployment.descriptor.runtime.IASEjbExtraDescriptors)9 Result (com.sun.enterprise.tools.verifier.Result)6 ComponentNameConstructor (com.sun.enterprise.tools.verifier.tests.ComponentNameConstructor)6 EjbEntityDescriptor (org.glassfish.ejb.deployment.descriptor.EjbEntityDescriptor)3 EjbMessageBeanDescriptor (org.glassfish.ejb.deployment.descriptor.EjbMessageBeanDescriptor)2 InvocationInfo (com.sun.ejb.InvocationInfo)1 EjbMessageBeanDescriptor (com.sun.enterprise.deployment.EjbMessageBeanDescriptor)1 EjbSessionDescriptor (com.sun.enterprise.deployment.EjbSessionDescriptor)1 MethodDescriptor (com.sun.enterprise.deployment.MethodDescriptor)1 ResourcePrincipal (com.sun.enterprise.deployment.ResourcePrincipal)1 SecurityManager (com.sun.enterprise.security.SecurityManager)1 IOException (java.io.IOException)1 NotSerializableException (java.io.NotSerializableException)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 RemoteException (java.rmi.RemoteException)1 Iterator (java.util.Iterator)1 ConcurrentAccessException (javax.ejb.ConcurrentAccessException)1 ConcurrentAccessTimeoutException (javax.ejb.ConcurrentAccessTimeoutException)1 CreateException (javax.ejb.CreateException)1 EJBException (javax.ejb.EJBException)1