
package com.acme.intg.processes;

import java.lang.reflect.Field;
import org.apache.beehive.controls.api.ControlException;
import org.apache.beehive.controls.api.bean.Controls;
import org.apache.beehive.controls.api.versioning.VersionRequired;
import org.apache.beehive.controls.api.context.ControlBeanContext;
import org.apache.beehive.controls.runtime.bean.EventAdaptor;
import org.apache.beehive.controls.runtime.bean.AdaptorPersistenceDelegate;

@SuppressWarnings("all")
public class CreditCardProcessClientInitializer
extends org.apache.beehive.controls.runtime.bean.ClientInitializer
{
    static final Field _callNonXMLToXMLField;
    static final Field _validateCCField;
    static
    {
        try
        {
            _callNonXMLToXMLField = com.acme.intg.processes.CreditCardProcess.class.getDeclaredField("callNonXMLToXML");
            _callNonXMLToXMLField.setAccessible(true);
            _validateCCField = com.acme.intg.processes.CreditCardProcess.class.getDeclaredField("validateCC");
            _validateCCField.setAccessible(true);
        }
        catch (NoSuchFieldException __bc_nsfe)
        {
            throw new ExceptionInInitializerError(__bc_nsfe);
        }
    }
    
    
    private static void initializeFields(ControlBeanContext cbc,
    com.acme.intg.processes.CreditCardProcess client)
    {
        try
        {
            String __bc_id;
            //
            // Initialize any nested controls used by the client
            //
            __bc_id = "callNonXMLToXML";
            com.acme.intg.controls.ConvertNonXMLToXMLPControlBean _callNonXMLToXML = (cbc == null ? null : (com.acme.intg.controls.ConvertNonXMLToXMLPControlBean)cbc.getBean(__bc_id));
            if (_callNonXMLToXML == null)
            _callNonXMLToXML = (com.acme.intg.controls.ConvertNonXMLToXMLPControlBean) Controls.instantiate(com.acme.intg.controls.ConvertNonXMLToXMLPControlBean.class, getAnnotationMap(cbc, _callNonXMLToXMLField), cbc, __bc_id );
            
            
            _callNonXMLToXMLField.set(client, _callNonXMLToXML);
            __bc_id = "validateCC";
            com.acme.intg.controls.CreditCardValidationProcessPControlBean _validateCC = (cbc == null ? null : (com.acme.intg.controls.CreditCardValidationProcessPControlBean)cbc.getBean(__bc_id));
            if (_validateCC == null)
            _validateCC = (com.acme.intg.controls.CreditCardValidationProcessPControlBean) Controls.instantiate(com.acme.intg.controls.CreditCardValidationProcessPControlBean.class, getAnnotationMap(cbc, _validateCCField), cbc, __bc_id );
            
            
            _validateCCField.set(client, _validateCC);
        }
        catch (RuntimeException __bc_re) { throw __bc_re; }
        catch (Exception __bc_e)
        {
            __bc_e.printStackTrace();
            throw new ControlException("Initializer failure", __bc_e);
        }
    }
    
    public static void initialize(ControlBeanContext cbc, com.acme.intg.processes.CreditCardProcess client)
    {
        
        initializeFields( cbc, client );
    }
}
