
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 CreditCardValidationProcessClientInitializer
extends org.apache.beehive.controls.runtime.bean.ClientInitializer
{
    static final Field _ccTxnInsertField;
    static
    {
        try
        {
            _ccTxnInsertField = com.acme.intg.processes.CreditCardValidationProcess.class.getDeclaredField("ccTxnInsert");
            _ccTxnInsertField.setAccessible(true);
        }
        catch (NoSuchFieldException __bc_nsfe)
        {
            throw new ExceptionInInitializerError(__bc_nsfe);
        }
    }
    
    
    private static void initializeFields(ControlBeanContext cbc,
    com.acme.intg.processes.CreditCardValidationProcess client)
    {
        try
        {
            String __bc_id;
            //
            // Initialize any nested controls used by the client
            //
            __bc_id = "ccTxnInsert";
            com.acme.intg.controls.CCTxnDBControlBean _ccTxnInsert = (cbc == null ? null : (com.acme.intg.controls.CCTxnDBControlBean)cbc.getBean(__bc_id));
            if (_ccTxnInsert == null)
            _ccTxnInsert = (com.acme.intg.controls.CCTxnDBControlBean) Controls.instantiate(com.acme.intg.controls.CCTxnDBControlBean.class, getAnnotationMap(cbc, _ccTxnInsertField), cbc, __bc_id );
            
            
            _ccTxnInsertField.set(client, _ccTxnInsert);
        }
        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.CreditCardValidationProcess client)
    {
        
        initializeFields( cbc, client );
    }
}
