Package org.apache.tapestry.ioc.services

Examples of org.apache.tapestry.ioc.services.MethodSignature


    public void addToString(String toString)
    {
        _lock.check();

        MethodSignature sig = new MethodSignature(String.class, "toString", null, null);

        // TODO: Very simple quoting here, will break down if the string itself contains
        // double quotes or various other characters that need escaping.

        addMethod(Modifier.PUBLIC, sig, format("return \"%s\";", toString));
View Full Code Here


    private void addDelegateGetter(ClassFab cf, Class serviceInterface, String serviceId)
    {
        String body = format("return (%s) _creator.createObject();", serviceInterface.getName());

        MethodSignature sig = new MethodSignature(serviceInterface, "_delegate", null, null);

        cf.addMethod(Modifier.PRIVATE, sig, body);
    }
View Full Code Here

            filterMethods.add(mi.next());
        }

        while (!serviceMethods.isEmpty())
        {
            MethodSignature ms = serviceMethods.remove(0);

            addBridgeMethod(ms, filterMethods);
        }

        reportExtraFilterMethods(filterMethods);
View Full Code Here

    {
        Iterator i = filterMethods.iterator();

        while (i.hasNext())
        {
            MethodSignature ms = (MethodSignature) i.next();

            _logger.error(ServiceMessages
                    .extraFilterMethod(ms, _filterInterface, _serviceInterface));
        }
    }
View Full Code Here

    {
        Iterator i = filterMethods.iterator();

        while (i.hasNext())
        {
            MethodSignature fms = (MethodSignature) i.next();

            int position = _filterMethodAnalyzer.findServiceInterfacePosition(ms, fms);

            if (position >= 0)
            {
View Full Code Here

        MethodIterator mi = new MethodIterator(interfaceClass);

        while (mi.hasNext())
        {
            MethodSignature sig = mi.next();

            // TODO: Checks for methods that don't have at least one parameter, or don't have a
            // compatible 1st parameter. Currently, we'll get a Javassist exception.

            builder.clear();
            builder.begin();

            builder.addln("Object selector = $1;");
            builder.addln(
                    "%s adapter = (%<s) _registry.getByInstance(selector);",
                    interfaceClassName);
            builder.addln("return ($r) adapter.%s($$);", sig.getName());

            builder.end();

            cf.addMethod(Modifier.PUBLIC, sig, builder.toString());
View Full Code Here

        cf.addConstructor(new Class[]
        { ObjectCreator.class }, null, "_creator = $1;");

        String body = format("return (%s) _creator.createObject();", serviceInterface.getName());

        MethodSignature sig = new MethodSignature(serviceInterface, PER_THREAD_METHOD_NAME, null,
                null);

        cf.addMethod(Modifier.PRIVATE, sig, body);

        String toString = format(
View Full Code Here

        MethodIterator mi = new MethodIterator(serviceInterface);

        while (mi.hasNext())
        {
            MethodSignature sig = mi.next();

            cf.addNoOpMethod(sig);
        }

        if (!mi.getToString()) cf.addToString(format("<NoOp %s>", serviceInterface.getName()));
View Full Code Here

    {
        MethodIterator mi = new MethodIterator(commandInterface);

        while (mi.hasNext())
        {
            MethodSignature sig = mi.next();

            addMethod(cf, commandInterface, sig);
        }

        if (!mi.getToString())
View Full Code Here

        classFab.addField("_serviceType", Class.class);

        classFab.addConstructor(new Class[] { Environment.class, Class.class }, null,
                                "{ _environment = $1; _serviceType = $2; }");

        classFab.addMethod(Modifier.PRIVATE, new MethodSignature(serviceType, "_delegate", null, null),
                           "return ($r) _environment.peekRequired(_serviceType); ");

        classFab.proxyMethodsToDelegate(serviceType, "_delegate()",
                                        format("<EnvironmentalProxy for %s>", serviceType.getName()));
View Full Code Here

TOP

Related Classes of org.apache.tapestry.ioc.services.MethodSignature

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.