org.objectweb.fractal.juliak.asm
Class InterceptorClassGenerator

java.lang.Object
  extended by org.objectweb.fractal.juliak.asm.AbstractClassGenerator
      extended by org.objectweb.fractal.juliak.asm.InterceptorClassGenerator
All Implemented Interfaces:
ClassGenerator

public class InterceptorClassGenerator
extends AbstractClassGenerator

This class generates Interceptor implementations.

Since:
2.5
Author:
Lionel Seinturier

Constructor Summary
InterceptorClassGenerator(String desc)
           
 
Method Summary
 byte[] generate(String targetClassname, InterfaceType it, InitializationContext ic)
          Generate the bytecode of an interceptor class implementing the given Fractal interface type.
protected  String getClassNameSuffix(InterfaceType it)
          Return the name of the suffix which is appended to generated class names.
 boolean match(InterfaceType it)
          Return true if the mode (IN, OUT or IN_OUT) of at least one of the class generators matchs the mode (client or server) of the given interface type.
 
Methods inherited from class org.objectweb.fractal.juliak.asm.AbstractClassGenerator
generate, getClassLoader, getLoader, getTargetClassName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InterceptorClassGenerator

public InterceptorClassGenerator(String desc)
                          throws TreeParserException
Throws:
TreeParserException
Method Detail

getClassNameSuffix

protected String getClassNameSuffix(InterfaceType it)
Return the name of the suffix which is appended to generated class names.

Specified by:
getClassNameSuffix in class AbstractClassGenerator

match

public boolean match(InterfaceType it)
Return true if the mode (IN, OUT or IN_OUT) of at least one of the class generators matchs the mode (client or server) of the given interface type.

Specified by:
match in interface ClassGenerator
Specified by:
match in class AbstractClassGenerator

generate

public byte[] generate(String targetClassname,
                       InterfaceType it,
                       InitializationContext ic)
                throws InstantiationException
Generate the bytecode of an interceptor class implementing the given Fractal interface type.

Specified by:
generate in interface ClassGenerator
Specified by:
generate in class AbstractClassGenerator
Parameters:
targetClassname - the name of the class to generate
it - the corresponding interface type
ic - the context for initializing the generated class
Returns:
the bytecode of the generated class or null if the interceptor does not apply to the current interface type
Throws:
InstantiationException