FileDocCategorySizeDatePackage
IASEjbExtraDescriptors.javaAPI DocGlassfish v2 API19057Fri May 04 22:31:50 BST 2007com.sun.enterprise.deployment.runtime

IASEjbExtraDescriptors

public class IASEjbExtraDescriptors extends com.sun.enterprise.deployment.runtime.RuntimeDescriptor
Class that contains all the extra iAS elements for an EJB that are not in the RI DTD like: MdbConnectionFactoryDescriptor jmsMaxMessagesLoad isReadOnlyBean refreshPeriodInSeconds commitOption checkpointedMethods passByReference BeanPoolDescriptor BeanCacheDescriptor FlushAtEndOfMethodDescriptor CheckpointAtEndOfMethodDescriptor
author
Ludo
since
JDK 1.4

Fields Summary
public static final String
AVAILABILITY_ENABLED
private boolean
isReadOnlyBean
private int
refreshPeriodInSeconds
A string field whose value denoted the rate at which the read-only-bean must be refreshed from the data source. Valid values are: negative (never refreshed), 0 (always refreshed) and positive (refreshed at specified intervals). Note that the value is just a hint to the container.
private int
jmsMaxMessagesLoad
A string value specifies the maximum number of messages to load into a JMS session at one time for a message-driven bean to serve. If not specified, the default is 1.
private MdbConnectionFactoryDescriptor
mdbConnectionFactory
private String
commitOption
A string field whose valid values are either A, B, or C. Default value is set in the server configuration (server.xml).
private BeanPoolDescriptor
beanPool
This contains the bean pool properties. Used only for stateless session bean and mdb pools.
private BeanCacheDescriptor
beanCache
This contains the bean cache properties. Used only for entity beans.
private FlushAtEndOfMethodDescriptor
flushMethodDescriptor
private CheckpointAtEndOfMethodDescriptor
checkpointMethodDescriptor
private String
checkpointedMethods
private Boolean
passByReference
This contains the pass-by-reference property.
private com.sun.enterprise.deployment.EjbDescriptor
ejbDescriptor
private int
cmtTimeoutInSeconds
This contains the timeout used for container started transactions This value is used by the container only if the value is greater than 0
private String
useThreadPoolId
Specifes the thread pool to be used for this ejb's invocation
private static final String
METHODS_DELIM
private static final String
PARAMS_DELIM
private static final String
LEFT_PAREN
private static final String
RIGHT_PAREN
private static final String
PARAM_DELIM
Constructors Summary
public IASEjbExtraDescriptors()
Default constructor.


             
      
        jmsMaxMessagesLoad = 1;
        isReadOnlyBean = false;
        refreshPeriodInSeconds = DescriptorConstants.REFRESH_PERIOD_IN_SECONDS_DEFAULT;//RO Bean never refreshed???
    
Methods Summary
public BeanCacheDescriptorgetBeanCache()
Getter for property beanCache.

return
Value of property beanCache.

        return beanCache;
    
public BeanPoolDescriptorgetBeanPool()
Getter for property beanPool.

return
Value of property beanPool.

        return beanPool;
    
public CheckpointAtEndOfMethodDescriptorgetCheckpointAtEndOfMethodDescriptor()
Getter for checkpoint-at-end-of-method

return
Value of checkpointMethodDescriptor

        return checkpointMethodDescriptor;
    
public java.lang.StringgetCheckpointedMethods()
Getter for property checkpointedMethods

return
Value of property checkpointedMethods

        return checkpointedMethods;
    
public intgetCmtTimeoutInSeconds()
Getter for property cmt-timeout-in-seconds.

return
Value of property cmt-timeout-in-seconds.

        return this.cmtTimeoutInSeconds;
    
public java.lang.StringgetCommitOption()
Getter for property commitOption.

return
Value of property commitOption.

        return commitOption;
    
public com.sun.enterprise.deployment.EjbDescriptorgetEjbDescriptor()
Getter for property ejbDescriptor.

returns
EjbDescriptor object property - J2EE specific ejb descriptor

        return this.ejbDescriptor;
    
public FlushAtEndOfMethodDescriptorgetFlushAtEndOfMethodDescriptor()
Getter for flush-at-end-of-method

return
Value of flushMethodDescriptor

        return flushMethodDescriptor;
    
public intgetJmsMaxMessagesLoad()
Getter for property jmsMaxMessagesLoad.

return
Value of property jmsMaxMessagesLoad.

        return jmsMaxMessagesLoad;
    
public MdbConnectionFactoryDescriptorgetMdbConnectionFactory()
Getter for property mdbConnectionFactory.

return
Value of property mdbConnectionFactory.

        return mdbConnectionFactory;
    
public booleangetPassByReference()
Gets ejb pass-by-reference value.

return
Value of property passByReference if it is not null. Otherwise returns value of passByReference property of Application if it is not null. Default value is false.

        boolean passByReference = false;  // default
        
        // if pass-by-reference defined for ejb
        if (this.isPassByReferenceDefined()) {
            passByReference = this.passByReference.booleanValue();
        // if pass-by-reference undefined for ejb set to
        // application's pass-by-reference value if defined
        } else {
            ejbDescriptor = this.getEjbDescriptor();
            if (ejbDescriptor != null) {
                Application application = ejbDescriptor.getApplication(); 
                if (application != null) {
                    if (application.isPassByReferenceDefined()) {
                        passByReference = application.getPassByReference();
                    }
                }
            }
        }
       
        return passByReference;
    
public intgetRefreshPeriodInSeconds()
Getter for property refreshPeriodInSeconds.

return
Value of property refreshPeriodInSeconds.

        return refreshPeriodInSeconds;
    
public java.lang.StringgetUseThreadPoolId()
Getter for the property use-thread-pool-id

return
The value of use-thread-pool-id

        return this.useThreadPoolId;
    
public booleanisFlushEnabledFor(com.sun.enterprise.deployment.MethodDescriptor methodDesc)
Convenience method to check if a method is flush enabled or not

param
methodDesc - Method Descriptor object to check
return
boolean true if methodDesc is flushed enabled boolean false if methodDesc is not flushed enabled

        if (flushMethodDescriptor != null) {
            return flushMethodDescriptor.isFlushEnabledFor(methodDesc);
        }
        return false;
    
public booleanisIsReadOnlyBean()
Getter for property isReadOnlyBean.

return
Value of property isReadOnlyBean.

        return isReadOnlyBean;
    
public booleanisPassByReferenceDefined()
Evaluates property passByReference for null value

return
boolean true if property passByReference is not null boolean false if property passByReference is null

        boolean passByReferenceDefined = false;
        if (this.passByReference != null) {
            passByReferenceDefined = true;
        }
        return passByReferenceDefined;
    
private com.sun.enterprise.deployment.MethodDescriptorparseCheckpointedMethod(java.lang.String method)

        String methodName, methodParams;
        ArrayList paramTypeList = new ArrayList();
        try {
            if ( method.indexOf(LEFT_PAREN) != -1 && 
                method.indexOf(RIGHT_PAREN) != -1 ) { 
                int pos = method.indexOf(LEFT_PAREN);
                int pos2 = method.indexOf(RIGHT_PAREN);
                // retrieve the method name
                methodName = method.substring(0, pos).trim(); 
                // retrieve the parameter list
                if (pos < pos2-1) {
                    methodParams = method.substring(pos+1, pos2).trim();
                    StringTokenizer paramsTokenizer = 
                        new StringTokenizer(methodParams, PARAMS_DELIM);
                    while (paramsTokenizer.hasMoreTokens()) {
                        // process each param
                        String param = paramsTokenizer.nextToken().trim();
                        if (param.length() == 0) {
                            continue;
                        }
                        StringTokenizer paramTokenizer = 
                            new StringTokenizer(param, PARAM_DELIM);
                        while (paramTokenizer.hasMoreTokens()) {
                            String paramType = 
                                paramTokenizer.nextToken().trim();
                            if (paramType.length() != 0) {
                                paramTypeList.add(paramType);
                                // only interested in the first token
                                break;   
                            }
                        }
                    }
                }
                if (paramTypeList.size() > 0) {
                    String[] paramTypeArray = (String[])paramTypeList.toArray(
                        new String[paramTypeList.size()]);
                    return new MethodDescriptor(methodName, null, 
                        paramTypeArray, null);
                } else {
                    return new MethodDescriptor(methodName, null, null, null);
                }               
            } else {
                DOLUtils.getDefaultLogger().log(Level.WARNING, "enterprise.deployment_badformat_checkpointedmethods", new Object[] {method});
                return null;
            }
        } catch (Exception e) {
            e.printStackTrace();
            // any parsing exception indicates it is not a well-formed
            // string, we will just print warning and return null
            DOLUtils.getDefaultLogger().log(Level.WARNING, "enterprise.deployment_badformat_checkpointedmethods", new Object[] {method});
            return null;
        }     
    
public voidparseCheckpointedMethods(com.sun.enterprise.deployment.EjbDescriptor ejbDesc)
Parse checkpointed-methods element and save its values in CheckpointAtEndOfMethodDescriptor The methods should be separated by semicolons. The param list should separated by commas. All method param types should be full qualified. Variable name is allowed for the param type. No return type or exception type. Example: foo(java.lang.String, a.b.c d); bar(java.lang.String s)

        if (checkpointedMethods == null || 
            checkpointedMethods.trim().length() == 0) {
            return;
        }
        if (checkpointMethodDescriptor == null) {
            checkpointMethodDescriptor = 
                new CheckpointAtEndOfMethodDescriptor();
            setCheckpointAtEndOfMethodDescriptor(checkpointMethodDescriptor);
            checkpointMethodDescriptor.setEjbDescriptor(ejbDesc);
        }
        StringTokenizer methodsTokenizer = 
            new StringTokenizer(checkpointedMethods, METHODS_DELIM);
        while (methodsTokenizer.hasMoreTokens()) {
            // process each method
            String method = methodsTokenizer.nextToken().trim();
            if (method.length() == 0) {
                continue;
            }
            MethodDescriptor methodDescriptor = 
                parseCheckpointedMethod(method);
            if (methodDescriptor != null) {
                checkpointMethodDescriptor.getMethodDescriptors().add(
                    methodDescriptor);
            }
        }
    
public voidsetBeanCache(BeanCacheDescriptor beanCache)
Setter for property beanCache.

param
beanCache New value of property beanCache.

        this.beanCache = beanCache;
    
public voidsetBeanPool(BeanPoolDescriptor beanPool)
Setter for property beanPool.

param
beanPool New value of property beanPool.

        this.beanPool = beanPool;
    
public voidsetCheckpointAtEndOfMethodDescriptor(CheckpointAtEndOfMethodDescriptor checkpointMethodDescriptor)
Setter for checkpoint-at-end-of-method

param
checkpointMethodDescriptor New value of checkpointMethodDescriptor.

        this.checkpointMethodDescriptor = checkpointMethodDescriptor;
    
public voidsetCheckpointedMethods(java.lang.String checkpointedMethods)
Setter for property checkpointedMethods

param
checkpointedMethods New value of checkpointed methods.

        this.checkpointedMethods = checkpointedMethods;
    
public voidsetCmtTimeoutInSeconds(int val)
Setter for property cmt-timeout-in-seconds.

param
commitOption New value of property cmt-timeout-in-seconds.

        this.cmtTimeoutInSeconds = val;
    
public voidsetCommitOption(java.lang.String commitOption)
Setter for property commitOption.

param
commitOption New value of property commitOption.

        this.commitOption = commitOption;
    
public voidsetEjbDescriptor(com.sun.enterprise.deployment.EjbDescriptor ejbDescriptor)
Setter for property ejbDescriptor

param
ejbDescriptor - EjbDescriptor object - J2EE specific ejb descriptor

        this.ejbDescriptor = ejbDescriptor;
    
public voidsetFlushAtEndOfMethodDescriptor(FlushAtEndOfMethodDescriptor flushMethodDescriptor)
Setter for flush-at-end-of-method

param
flushMethodDescriptor New value of flushMethodDescriptor.

        this.flushMethodDescriptor = flushMethodDescriptor;
    
public voidsetIsReadOnlyBean(boolean isReadOnlyBean)
Setter for property isReadOnlyBean.

param
isReadOnlyBean New value of property isReadOnlyBean.

        this.isReadOnlyBean = isReadOnlyBean;
    
public voidsetJmsMaxMessagesLoad(int jmsMaxMessagesLoad)
Setter for property jmsMaxMessagesLoad.

param
jmsMaxMessagesLoad New value of property jmsMaxMessagesLoad.

        this.jmsMaxMessagesLoad = jmsMaxMessagesLoad;
    
public voidsetMdbConnectionFactory(MdbConnectionFactoryDescriptor mdbConnectionFactory)
Setter for property mdbConnectionFactory.

param
mdbConnectionFactory New value of property mdbConnectionFactory.


        this.mdbConnectionFactory = mdbConnectionFactory;
    
public voidsetPassByReference(boolean passByReference)
Sets ejb pass-by-reference value.

param
pass-by-reference New value of property pass-by-reference.

        this.passByReference = Boolean.valueOf(passByReference);
    
public voidsetPassByReference(java.lang.Boolean passByReference)
Sets ejb pass-by-reference value.

param
pass-by-reference New value of property pass-by-reference.

        this.passByReference = passByReference;
    
public voidsetRefreshPeriodInSeconds(int refreshPeriodInSeconds)
Setter for property refreshPeriodInSeconds.

param
refreshPeriodInSeconds New value of property refreshPeriodInSeconds.

        this.refreshPeriodInSeconds = refreshPeriodInSeconds;
    
public voidsetUseThreadPoolId(java.lang.String val)
Setter for the property use-thread-pool-id

param
The value for use-thread-pool-id

        this.useThreadPoolId = val;