There is no way its reasonable to for a developer to figured this one out with 
help:
think things like this can be vastly improved by an API.

Example:
   @Match("AssetPathConverter")
    @SuppressWarnings("unchecked")
    public void adviseJsPathMethod(MethodAdviceReceiver receiver)
            throws SecurityException, NoSuchMethodException
    {
        MethodAdvice advice = new MethodAdvice()
        {
            @Override
            public void advise(MethodInvocation invocation)
            {
                invocation.proceed();
                if(invocation.getReturnType().equals(String.class))
                {
                    String result = invocation.getReturnValue().toString();
                    
                    if (result.matches(".*\\.nocache\\.js"))
                    {                      
                        log.fine(String.format("Converting GWT Path: %s", 
result));
                        // remove assets/<version>/ctx from GWT path - 
interferes with servlets
                        
invocation.setReturnValue(PathProcessor.removeAssetPathPart(result));
                    }
                }
            }
        };
        
receiver.adviseMethod(receiver.getInterface().getMethod("convertAssetPath", 
String.class), advice);
    }
    


On Aug 24, 2011, at 2:43 PM, Thiago H. de Paula Figueiredo wrote:

> On Wed, 24 Aug 2011 15:39:43 -0300, Lenny Primak <[email protected]> 
> wrote:
> 
>> I like that too, but not necessarily enough.  For example, contributing a 
>> service isn't only a matter of finding the right service class,
>> but also there is a lot of code involved that it's not reasonable for anyone 
>> new to know how to create that piece of code,
> 
> Lots of code? Just adding a contribute method with a single line? I'm really 
> not following you here.
> 
>> i.e. code that invokes class transformation API.
> 
> I'm not following this too. Anyway, class transformations are not for 
> beginners.
> 
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and 
> instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to