
package dspControl;

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 DspControlControllerClientInitializer
extends org.apache.beehive.controls.runtime.bean.ClientInitializer
{
    static final Field _DSPControlFileField;
    static
    {
        try
        {
            _DSPControlFileField = dspControl.DspControlController.class.getDeclaredField("DSPControlFile");
            _DSPControlFileField.setAccessible(true);
        }
        catch (NoSuchFieldException __bc_nsfe)
        {
            throw new ExceptionInInitializerError(__bc_nsfe);
        }
    }
    
    
    private static void initializeFields(ControlBeanContext cbc,
    dspControl.DspControlController client)
    {
        try
        {
            String __bc_id;
            //
            // Initialize any nested controls used by the client
            //
            __bc_id = client.getClass() + "@" + client.hashCode() + ".controls.DSPControlFile.DSPControlFile";
            controls.DSPControlFileBean _DSPControlFile = (cbc == null ? null : (controls.DSPControlFileBean)cbc.getBean(__bc_id));
            if (_DSPControlFile == null)
            _DSPControlFile = (controls.DSPControlFileBean) Controls.instantiate(controls.DSPControlFileBean.class, getAnnotationMap(cbc, _DSPControlFileField), cbc, __bc_id );
            
            
            _DSPControlFileField.set(client, _DSPControlFile);
        }
        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, dspControl.DspControlController client)
    {
        
        initializeFields( cbc, client );
    }
}
