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

org.apache.beehive.controls.system.jndi.impl.JndiControlImplInitializer Maven / Gradle / Ivy

The newest version!
package org.apache.beehive.controls.system.jndi.impl;

import java.lang.reflect.Field;
import org.apache.beehive.controls.api.ControlException;
import org.apache.beehive.controls.api.context.ControlBeanContext;
import org.apache.beehive.controls.runtime.bean.ControlBean;

@SuppressWarnings("all")
public class JndiControlImplInitializer
extends org.apache.beehive.controls.runtime.bean.ImplInitializer
{
    
    
    /**
    * Initializes the nested contextual services required by the implementation
    */
    public void initServices(ControlBean bean, Object target)
    {
        org.apache.beehive.controls.system.jndi.impl.JndiControlImpl __bc_impl = (org.apache.beehive.controls.system.jndi.impl.JndiControlImpl)target;
        
        super.initServices(bean, __bc_impl);
        
        ControlBeanContext __bc_beanContext = bean.getControlBeanContext();
        try
        {
            org.apache.beehive.controls.api.context.ControlBeanContext __context = __bc_beanContext;
            if (__context == null)
            throw new ControlException("Contextual service org.apache.beehive.controls.api.context.ControlBeanContext is not available");
            __bc_impl._context = __context;
        }
        catch (RuntimeException __bc_re) { throw __bc_re; }
        catch (Exception __bc_e)
        {
            throw new ControlException("Contextual service initialization failure", __bc_e);
        }
    }
    
    /**
    * Resets all nested contextual services instances to null
    */
    public void resetServices(ControlBean bean, Object target)
    {
        org.apache.beehive.controls.system.jndi.impl.JndiControlImpl __bc_impl = (org.apache.beehive.controls.system.jndi.impl.JndiControlImpl)target;
        
        super.resetServices(bean, __bc_impl);
        
        try
        {
            __bc_impl._context = null;
        }
        catch (RuntimeException __bc_re) { throw __bc_re; }
        catch (Exception __bc_e)
        {
            throw new ControlException("Contextual service reset failure", __bc_e);
        }
    }
    
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy