Package org.apache.tapestry

Examples of org.apache.tapestry.ApplicationRuntimeException


        {
            return defineClass(enhancedClassName, byteCode, 0, byteCode.length, domain);
        }
        catch (Throwable ex)
        {
            throw new ApplicationRuntimeException(
                Tapestry.format(
                    "EnhancedClassLoader.unable-to-define-class",
                    enhancedClassName,
                    ex.getMessage()),
                ex);
View Full Code Here


     **/

    public ILink getLink(IRequestCycle cycle, IComponent component, Object[] parameters)
    {
        if (Tapestry.size(parameters) != 2)
            throw new ApplicationRuntimeException(
                Tapestry.format("service-incorrect-parameter-count", Tapestry.ASSET_SERVICE, new Integer(2)));

        // Service is stateless

        return constructLink(cycle, Tapestry.ASSET_SERVICE, null, parameters, false);
View Full Code Here

        throws IOException
    {
        Object[] parameters = getParameters(cycle);

        if (Tapestry.size(parameters) != 2)
            throw new ApplicationRuntimeException(
                Tapestry.format("service-incorrect-parameter-count", Tapestry.ASSET_SERVICE, new Integer(2)));

        String resourcePath = (String) parameters[0];
        String checksum = (String) parameters[1];

        URL resourceURL = engine.getResourceResolver().getResource(resourcePath);

        if (resourceURL == null)
            throw new ApplicationRuntimeException(
                Tapestry.format("missing-resource", resourcePath));

        String actualChecksum = engine.getResourceChecksumSource().getChecksum(resourceURL);

        if (!actualChecksum.equals(checksum))
        {
            throw new ApplicationRuntimeException(
                Tapestry.format("AssetService.checksum-failure", checksum, resourcePath));
        }

        URLConnection resourceConnection = resourceURL.openConnection();
View Full Code Here

        {
            result = _resolver.findClass(className);
        }
        catch (Exception ex)
        {
            throw new ApplicationRuntimeException(ex.getMessage(), specification.getLocation(), ex);
        }

        try
        {
            ComponentClassFactory factory = createComponentClassFactory(specification, result);

            if (factory.needsEnhancement())
            {
                result = factory.createEnhancedSubclass();

                if (!_disableValidation)
                    validateEnhancedClass(result, className, specification);
            }
        }
        catch (CodeGenerationException e)
        {
            throw new ApplicationRuntimeException(
                Tapestry.format("ComponentClassFactory.code-generation-error", className),
                e);
        }

        return result;
View Full Code Here

        while (true)
        {
            Method m = checkForAbstractMethods(current, implementedMethods);

            if (m != null)
                throw new ApplicationRuntimeException(
                    Tapestry.format(
                        "DefaultComponentClassEnhancer.no-impl-for-abstract-method",
                        new Object[] { m, current, className, subject.getName()}),
                    specification.getLocation(),
                    null);
View Full Code Here

    protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
    {
        Select select = Select.get(cycle);
        if (select == null)
            throw new ApplicationRuntimeException(
                Tapestry.getMessage("Option.must-be-contained-by-select"),
                this,
                null,
                null);
View Full Code Here

    private NumberAdaptor getAdaptor(IFormComponent field)
    {
        NumberAdaptor result = getAdaptor(_valueTypeClass);

        if (result == null)
            throw new ApplicationRuntimeException(
                Tapestry.format(
                    "NumberValidator.no-adaptor-for-field",
                    field,
                    _valueTypeClass.getName()));
View Full Code Here

    public void setValueType(String typeName)
    {
        Class typeClass = (Class) TYPES.get(typeName);

        if (typeClass == null)
            throw new ApplicationRuntimeException(
                Tapestry.format("NumberValidator.unknown-type", typeName));

        _valueTypeClass = typeClass;
    }
View Full Code Here

    protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
    {
        Choose choose = getChoose();

        if (choose == null)
            throw new ApplicationRuntimeException(
                Tapestry.getMessage("When.must-be-contained-by-choose"),
                this,
                null,
                null);
View Full Code Here

            {
                return _urlCodec.encode(aHrefBinding.getString(), encoding);
            }
            catch (UnsupportedEncodingException e)
            {
                throw new ApplicationRuntimeException(
                    Tapestry.format("illegal-encoding", encoding),
                    e);
            }
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.ApplicationRuntimeException

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.