All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.beehive.controls.system.jms.impl.JMSControlImplClientInitializer Maven / Gradle / Ivy

The newest version!

package org.apache.beehive.controls.system.jms.impl;

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 JMSControlImplClientInitializer
extends org.apache.beehive.controls.runtime.bean.ClientInitializer
{
    static final Field __jndiControlField;
    static
    {
        try
        {
            __jndiControlField = org.apache.beehive.controls.system.jms.impl.JMSControlImpl.class.getDeclaredField("_jndiControl");
            __jndiControlField.setAccessible(true);
        }
        catch (NoSuchFieldException __bc_nsfe)
        {
            throw new ExceptionInInitializerError(__bc_nsfe);
        }
    }
    
    
    private static void initializeFields(ControlBeanContext cbc,
    org.apache.beehive.controls.system.jms.impl.JMSControlImpl client)
    {
        try
        {
            String __bc_id;
            //
            // Initialize any nested controls used by the client
            //
            __bc_id = "_jndiControl";
            org.apache.beehive.controls.system.jndi.JndiControlBean __jndiControl = (cbc == null ? null : (org.apache.beehive.controls.system.jndi.JndiControlBean)cbc.getBean(__bc_id));
            if (__jndiControl == null)
            __jndiControl = (org.apache.beehive.controls.system.jndi.JndiControlBean) Controls.instantiate(org.apache.beehive.controls.system.jndi.JndiControlBean.class, getAnnotationMap(cbc, __jndiControlField), cbc, __bc_id );
            
            
            __jndiControlField.set(client, __jndiControl);
        }
        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, org.apache.beehive.controls.system.jms.impl.JMSControlImpl client)
    {
        
        initializeFields( cbc, client );
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy