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


        if (eagerLoad)
        {
            cf.addInterface(EagerLoadServiceProxy.class);

            cf.addMethod(Modifier.PUBLIC, new MethodSignature(void.class, "eagerLoadService", null,
                    null), "_delegate();");
        }

        return cf.createClass();
    }
View Full Code Here

        builder.end();

        builder.addln("return _delegate;");
        builder.end();

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

        // Here's the rub, this _delegate() method has to be synchronized. But after the first
        // time through (when we create the service), the time inside the method is infintesmal.
        // Let's hope that they aren't lying when they say that synchronized is now super cheap!
View Full Code Here

     */
    private void addShutdownListenerMethod(ClassFab cf)
    {
        cf.addInterface(RegistryShutdownListener.class);

        MethodSignature sig = new MethodSignature(void.class, "registryDidShutdown", null, null);

        cf.addMethod(
                Modifier.PUBLIC | Modifier.SYNCHRONIZED,
                sig,
                "{ _shutdown = true; _delegate = null; _creator = null; }");
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();

            _log.error(
                    ServiceMessages.extraFilterMethod(ms, _filterInterface, _serviceInterface),
                    null);
        }
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())
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.