Examples of ControlException


Examples of org.apache.beehive.controls.api.ControlException

                _lastKey = (Serializable) ((EJBObject) _beanInstance).getPrimaryKey();
            else
                _lastKey = (Serializable) ((EJBLocalObject) _beanInstance).getPrimaryKey();
        }
        catch (RemoteException re) {
            throw new ControlException("Unable to save bean instance", re);
        }
        return true;
    }
View Full Code Here

Examples of org.apache.beehive.controls.api.ControlException

    // add additional processing.
    //
    public void onCreate() {
        super.onCreate();
        if (_beanType != EJBControlImpl.ENTITY_BEAN) {
            throw new ControlException("Attempting to use a entity bean control with a bean that is not a entity bean");
        }
    }
View Full Code Here

Examples of org.apache.beehive.controls.api.ControlException

        // first time initialization

        // assume v2 attributes
        EJBHome ejbHome = (EJBHome) context.getControlPropertySet(EJBHome.class);
        if (ejbHome == null)
            throw new ControlException("No @EJBHome property is defined");

        _jndiName = ejbHome.jndiName();
        if (_jndiName == null || _jndiName.length() == 0) {
            String ejbLink = ejbHome.ejbLink();
            if (ejbLink.length() == 0) {
                //
                // Should be caught by the compiler
                //
                throw new ControlException("Either the jndiName() or ejbLink() member of @EJBHome must be defined.");
            }

            //
            // Generate a unique local jndi name to associate w/ the link,
            // based upon the local control service uri and control id
View Full Code Here

Examples of org.apache.beehive.controls.api.ControlException

        try {
            return _beanHandle.getEJBObject();
        }
        catch (java.rmi.RemoteException re) {
            throw new ControlException("Unable to convert EJB handle to object", re);
        }
    }
View Full Code Here

Examples of org.apache.beehive.controls.api.ControlException

        if (_beanInstance instanceof EJBObject) {
            try {
                _beanHandle = ((EJBObject) _beanInstance).getHandle();
            }
            catch (java.rmi.RemoteException re) {
                throw new ControlException("Unable to get bean instance from handle", re);
            }

            return true;
        }
        return false;
View Full Code Here

Examples of org.apache.beehive.controls.api.ControlException

                    URL url = new URL(_jndiName);
                    jndiConn = url.openConnection();
                    _homeInstance = jndiConn.getContent();
                }
                catch (MalformedURLException mue) {
                    throw new ControlException(_jndiName + " is not a valid JNDI URL", mue);
                }
                catch (IOException ioe) {
                    throw new ControlException("Error during JNDI lookup from " + _jndiName, ioe);
                }
            }
            else {
                try {
                    javax.naming.Context ctx = getInitialContext();
                    _homeInstance = ctx.lookup(_jndiName);
                }
                catch (Exception ne) {
                    throw new ControlException("Error during JNDI lookup from " + _jndiName, ne);
                }
            }

            if (!_homeInterface.isAssignableFrom(_homeInstance.getClass())) {
                throw new ControlException("JNDI lookup of " + _jndiName + " failed to return an instance of " + _homeInterface);
            }
        }
    }
View Full Code Here

Examples of org.apache.beehive.controls.api.ControlException

            // By convention, the below cond should never be true.  The bean
            // type-specific resolve should throw an appropriate exception
            // that is more specific.  This is a safety net.
            if (_beanInstance == null)
                throw new ControlException("Unable to resolve bean instance");

            try {
                return m.invoke(_beanInstance, args);
            }
            catch (Exception e) {
View Full Code Here

Examples of org.apache.beehive.controls.api.ControlException

                //
                // Spring doesn't provide any mechanism to pass dynamic constructor args
                // to Spring bean factory methods.
                //
                if (props != null)
                    throw new ControlException("Providing a PropertyMap to the bean constructor is not supported by SpringControlFactory");
            }
            else
            {
                //
                // Fall back to using standard Java instantation if no Spring configuration
                // could be found.
                // TODO: Have a configuration option where this results in a failure, to avoid
                // masking misconfiguration issues if the expectation is that all usage of
                // Controls is configured via Spring.
                //
                bean = super.instantiate(beanClass, props, context, id);
            }
        }
        catch (Exception e)
        {
            throw new ControlException("Exception creating ControlBean", e);
        }

        return bean;
    }
View Full Code Here

Examples of org.apache.beehive.controls.api.ControlException

        // cache the Map.get method for efficiency
        try {
            _methodMapGet = java.util.Map.class.getMethod("get", new Class[]{Object.class});
        } catch (NoSuchMethodException e) {
            throw new ControlException("Can not find java.util.Map.get(Object) method");
        }
    }
View Full Code Here

Examples of org.apache.beehive.controls.api.ControlException

        SqlGrammar _parser = new SqlGrammar(new StringReader(sql));
        SqlStatement parsed = null;
        try {
            parsed = _parser.parse();
        } catch (ParseException e) {
            throw new ControlException("Error parsing SQL statment." + e.getMessage(), e);
        } catch (TokenMgrError tme) {
            throw new ControlException("Error parsing SQL statment. " + tme.getMessage(), tme);
        }

        if (parsed.isCacheable()) {
            _cachedSqlStatements.put(sql, parsed);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.