Package org.apache.turbine.util

Examples of org.apache.turbine.util.TurbineException


        {
            return clazz.newInstance();
        }
        catch (Exception x)
        {
            throw new TurbineException(
                    "Instantiation failed for " + clazz.getName(), x);
        }
    }
View Full Code Here


            Class[] sign = getSignature(clazz, params, signature);
            return clazz.getConstructor(sign).newInstance(params);
        }
        catch (Exception x)
        {
            throw new TurbineException(
                    "Instantiation failed for " + clazz.getName(), x);
        }
    }
View Full Code Here

                {
                    throw x;
                }
                catch (ClassCastException x)
                {
                    throw new TurbineException(
                            "Incorrect factory " + (String) factory +
                            " for class " + className, x);
                }
                factories = (HashMap) factories.clone();
                factories.put(className, factory);
View Full Code Here

                            ((Recyclable) instance).recycle();
                        }
                    }
                    catch (Exception x)
                    {
                        throw new TurbineException(
                                "Recycling failed for " + instance.getClass().getName(), x);
                    }
                }
            }
            return instance;
View Full Code Here

        /** template name with relative path */
        String relativeTemplateName = getRelativeTemplateName(templateName);

        if (StringUtils.isEmpty(relativeTemplateName))
        {
            throw new TurbineException(
                "Template " + templateName + " not found in template paths");
        }

        // get the RequestDispatcher for the JSP
        RequestDispatcher dispatcher = data.getServletContext()
            .getRequestDispatcher(relativeTemplateName);

        try
        {
            if (isForward)
            {
                // forward the request to the JSP
                dispatcher.forward(data.getRequest(), data.getResponse());
            }
            else
            {
                data.getOut().flush();
                // include the JSP
                dispatcher.include(data.getRequest(), data.getResponse());
            }
        }
        catch (Exception e)
        {
            // as JSP service is in Alpha stage, let's try hard to send the
            // error message to the browser, to speed up debugging
            try
            {
                data.getOut().print("Error encountered processing a template: "
                    + templateName);
                e.printStackTrace(data.getOut());
            }
            catch (IOException ignored)
            {
            }

            // pass the exception to the caller according to the general
            // contract for tamplating services in Turbine
            throw new TurbineException(
                "Error encountered processing a template: " + templateName, e);
        }
    }
View Full Code Here

        // Get the specified configuration.
        String[] cfg = (String[]) configurations.get(key);
        if (cfg == null)
        {
            throw new TurbineException("RunTime configuration '" + key + "' is undefined");
        }

        TurbineRunData data;
        try
        {
            data = (TurbineRunData) pool.getInstance(cfg[0]);
           
            ParameterParser pp = (ParameterParser) pool.getInstance(cfg[1]);
            data.setParameterParser(pp);
           
            CookieParser cp = (CookieParser) pool.getInstance(cfg[2]);
            data.setCookieParser(cp);

            Locale locale = req.getLocale();
           
            if (locale == null)
            {
                // get the default from the Turbine configuration
                locale = data.getLocale();
            }
           
            // set the locale detected and propagate it to the parsers
            data.setLocale(locale);
        }
        catch (ClassCastException x)
        {
            throw new TurbineException("RunData configuration '" + key + "' is illegal", x);
        }

        // Set the request and response.
        data.setRequest(req);
        data.setResponse(res);
View Full Code Here

            throw t;
        }

        catch (Throwable t)
        {
            throw new TurbineException
                    ("Failed to instantiate " + handlerClass, t);
        }
    }
View Full Code Here

            XmlRpcClient client = new XmlRpcClient(url);
            return client.execute(methodName, params);
        }
        catch (Exception e)
        {
            throw new TurbineException("XML-RPC call failed", e);
        }
    }
View Full Code Here

            client.setBasicAuthentication(username, password);
            return client.execute(methodName, params);
        }
        catch (Exception e)
        {
            throw new TurbineException("XML-RPC call failed", e);
        }
    }
View Full Code Here

    public void doBuild(RunData data)
        throws Exception
    {
        if (!data.isOutSet())
        {
            throw new TurbineException(
                "data.declareDirectResponse() has not been called");
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.turbine.util.TurbineException

Copyright © 2018 www.massapicom. 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.