Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2012 International Business Machines Corp.
   * 
   * See the NOTICE file distributed with this work for additional information
   * regarding copyright ownership. Licensed under the Apache License, 
   * Version 2.0 (the "License"); you may not use this file except in compliance
   * with the License. You may obtain a copy of the License at
   * 
   *   http://www.apache.org/licenses/LICENSE-2.0
  * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
 */
 package com.ibm.jbatch.container.modelresolver.impl;
 
 
 
 
 
 
 
     public ChunkPropertyResolverImpl(boolean isPartitionStep) {
 		super(isPartitionStep);
 	}
 
     public Chunk substituteProperties(final Chunk chunkfinal Properties submittedPropsfinal Properties parentProps) {
         /*
     <xs:complexType name="Chunk">
         <xs:sequence>
             <xs:element name="reader" type="jsl:ItemReader" />
             <xs:element name="processor" type="jsl:ItemProcessor" minOccurs="0" maxOccurs="1" />
             <xs:element name="writer" type="jsl:ItemWriter" />
             <xs:element name="checkpoint-algorithm" type="jsl:CheckpointAlgorithm" minOccurs="0"
                 maxOccurs="1" />
             <xs:element name="skippable-exception-classes" type="jsl:ExceptionClassFilter"
                 minOccurs="0" maxOccurs="1" />
             <xs:element name="retryable-exception-classes" type="jsl:ExceptionClassFilter"
                 minOccurs="0" maxOccurs="1" />
             <xs:element name="no-rollback-exception-classes" type="jsl:ExceptionClassFilter"
                 minOccurs="0" maxOccurs="1" />
         </xs:sequence>
         <xs:attribute name="checkpoint-policy" use="optional" type="xs:string">
  
         </xs:attribute>
         <xs:attribute name="item-count" use="optional" type="xs:string">
         </xs:attribute>
         <xs:attribute name="time-limit" use="optional" type="xs:string">
 
         </xs:attribute>
         <xs:attribute name="skip-limit" use="optional" type="xs:string">
         </xs:attribute>
         <xs:attribute name="retry-limit" use="optional" type="xs:string">
         </xs:attribute>
     </xs:complexType>
         */
         
         //resolve all the properties used in attributes and update the JAXB model
         chunk.setCheckpointPolicy(this.replaceAllProperties(chunk.getCheckpointPolicy(), submittedPropsparentProps));
         chunk.setItemCount(this.replaceAllProperties(chunk.getItemCount(), submittedPropsparentProps));
         chunk.setTimeLimit(this.replaceAllProperties(chunk.getTimeLimit(), submittedPropsparentProps));
         chunk.setSkipLimit(this.replaceAllProperties(chunk.getSkipLimit(), submittedPropsparentProps));
         chunk.setRetryLimit(this.replaceAllProperties(chunk.getRetryLimit(), submittedPropsparentProps));
 
         // Resolve Reader properties
         if (chunk.getReader() != null) {
             PropertyResolverFactory.createReaderPropertyResolver(this.).substituteProperties(chunk.getReader(), submittedPropsparentProps);
         }
         
         // Resolve Processor properties
         if (chunk.getProcessor() != null) {
             PropertyResolverFactory.createProcessorPropertyResolver(this.).substituteProperties(chunk.getProcessor(), submittedPropsparentProps);
         }
         
         // Resolve Writer properties
         if (chunk.getWriter() != null) {
             PropertyResolverFactory.createWriterPropertyResolver(this.).substituteProperties(chunk.getWriter(), submittedPropsparentProps);
         }
         
         // Resolve CheckpointAlgorithm properties
         if (chunk.getCheckpointAlgorithm() != null) {
             PropertyResolverFactory.createCheckpointAlgorithmPropertyResolver(this.).substituteProperties(chunk.getCheckpointAlgorithm(), submittedPropsparentProps);
         }
 
         // Resolve SkippableExceptionClasses properties
         if (chunk.getSkippableExceptionClasses() != null) {
             PropertyResolverFactory.createSkippableExceptionClassesPropertyResolver(this.).substituteProperties(chunk.getSkippableExceptionClasses(), submittedPropsparentProps);
         }
         
         // Resolve RetryableExceptionClasses properties
         if (chunk.getRetryableExceptionClasses() != null) {
             PropertyResolverFactory.createRetryableExceptionClassesPropertyResolver(this.).substituteProperties(chunk.getRetryableExceptionClasses(), submittedPropsparentProps);
        }
        
        // Resolve NoRollbackExceptionClasses properties
        if (chunk.getNoRollbackExceptionClasses() != null) {
            PropertyResolverFactory.createNoRollbackExceptionClassesPropertyResolver(this.).substituteProperties(chunk.getNoRollbackExceptionClasses(), submittedPropsparentProps);
        }
        
        //FIXME There are more properties to add in here for the rest of the chunk elements
        
        return chunk;
    }
New to GrepCode? Check out our FAQ X