Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Update example of transform logging to match 5.3

...

Tapestry performs a transformation on your classes as they are loaded, often you want to gain insight into what it has done. Tapestry uses a secondary logger, consisting of the class name with the prefix "tapestry.transformer.", to log (at debug level) the results of transforming the class.

Example:

No Format
[DEBUG] MerryChristmasIndex Finished// class transformation: InternalClassTransformation[
public org.apache.tapestry5.integration.app1.pages.MerryChristmas extends java.lang.Object
  implements org.apache.tapestry5.runtime.Component, org.apache.tapestry5.runtime.RenderCommand

add default method: public void postRenderCleanup()
<default>

add default method: public void setupRender(org.apache.tapestry5.MarkupWriter $1, org.apache.tapestry5.runtime.Event $2)
<default>

add default method: public void beginRender(org.apache.tapestry5.MarkupWriter $1, org.apache.tapestry5.runtime.Event $2)
<default>

add default method: public void beforeRenderTemplate(org.apache.tapestry5.MarkupWriter $1, org.apache.tapestry5.runtime.Event $2)
<default>

add default method: public void afterRenderTemplate(org.apache.tapestry5.MarkupWriter $1, org.apache.tapestry5.runtime.Event $2)
<default>

add default method: public void beforeRenderBody(org.apache.tapestry5.MarkupWriter $1, org.apache.tapestry5.runtime.Event $2)
<default>

add default method: public void afterRenderBody(org.apache.tapestry5.MarkupWriter $1, org.apache.tapestry5.runtime.Event $2)
<default>

add default method: public void afterRender(org.apache.tapestry5.MarkupWriter $1, org.apache.tapestry5.runtime.Event $2)
<default>

add default method: public void cleanupRender(org.apache.tapestry5.MarkupWriter $1, org.apache.tapestry5.runtime.Event $2)
<default>

add default method: public boolean handleComponentEvent(org.apache.tapestry5.runtime.ComponentEvent $1)
<default>

add default method: public org.apache.tapestry5.ComponentResources getComponentResources()
<default>

add default method: public void containingPageDidLoad()
<default>

add default method: public void containingPageDidDetach()
<default>

add default method: public void containingPageDidAttach()
<default>

add field: protected final org.apache.tapestry5.internal.InternalComponentResources _$resources;

replace method: public final org.apache.tapestry5.ComponentResources getComponentResources()
return _$resources;

add default method: public void render(org.apache.tapestry5.MarkupWriter $1, org.apache.tapestry5.runtime.RenderQueue $2)
<default>

replace method: public void render(org.apache.tapestry5.MarkupWriter $1, org.apache.tapestry5.runtime.RenderQueue $2)
_$resources.queueRender($2);

convert default constructor: initializer();

add constructor: version 49.0 (49)
// access flags 0x11
public final class org/apache/tapestry5/integration/app1/pages/Index$Invocation_containingPageDidLoad_123fd9264de3fa20 extends org/apache/tapestry5/internal/plastic/AbstractMethodInvocation  implements org/apache/tapestry5/plastic/MethodInvocation  {


  // access flags 0x1
  public <init>(Ljava/lang/Object;Lorg/apache/tapestry5/plastic/InstanceContext;Lorg/apache/tapestry5/internal/plastic/MethodInvocationBundle;)V
    ALOAD 0
    ALOAD 1
    ALOAD 2
    ALOAD 3
    INVOKESPECIAL org/apache/tapestry5/internal/plastic/AbstractMethodInvocation.<init> (Ljava/lang/Object;Lorg/apache/tapestry5/plastic/InstanceContext;Lorg/apache/tapestry5/internal/plastic/MethodInvocationBundle;)V
    RETURN
    MAXSTACK = 0
    MAXLOCALS = 0

  // access flags 0x1
  public setReturnValue(Ljava/lang/Object;)Lorg/apache/tapestry5/plastic/MethodInvocation;
    NEW java/lang/IllegalArgumentException
    DUP
    LDC "Method public void containingPageDidLoad() of class org.apache.tapestry5.integration.app1.pages.MerryChristmas(org.apache.tapestry5.internal.InternalComponentResources $1)
{
  _$resources = $1;
  initializer();

}

]
Index is void, setting a return value is not allowed."

Essentially, this output is a dissasembly of the bytecode transformed or created by Tapestry for the component. Is this helpful? Probably only if you are developing your own code that integrates into the component class transformation chain; for example, to support your own field and method annotations.

...