org.codehaus.aspectwerkz.transform.delegation
Class ContextImpl

java.lang.Object
  extended byorg.codehaus.aspectwerkz.transform.delegation.ContextImpl
All Implemented Interfaces:
Context

public class ContextImpl
extends Object
implements Context

Implementation of the transformation context interface for the delegation weaving.

Author:
Jonas Bonér , Alexandre Vasseur

Constructor Summary
ContextImpl(String className, byte[] bytecode, ClassLoader loader)
          Creates a new context.
 
Method Summary
 void addMetaData(Object key, Object value)
          Adds new meta-data for the transformation.
 void dump(String dir)
          Dump the class to specific directory.
 Object getClassAbstraction()
          Returns the class abstraction.
 String getClassName()
           
 byte[] getCurrentBytecode()
          Returns the current bytecode.
 List getDefinitions()
          The definitions context (with hierarchical structure)
 byte[] getInitialBytecode()
          Returns the initial bytecode.
 ClassLoader getLoader()
          Returns the class loader.
 Object getMetaData(Object key)
          Returns meta-data for the transformation.
 boolean isAdvised()
          Checks if the class being transformed has beed advised.
 boolean isPrepared()
          Checks if the class is prepared.
 boolean isReadOnly()
          Checks if the context is read-only.
 void markAsAdvised()
          Marks the class being transformed as advised.
 void markAsPrepared()
          Marks the class as prepared.
 void markAsReadOnly()
          Marks the context as read-only.
 void resetAdvised()
          Resets the isAdviced flag.
 void setCurrentBytecode(byte[] bytecode)
          Sets the current bytecode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextImpl

public ContextImpl(String className,
                   byte[] bytecode,
                   ClassLoader loader)
Creates a new context.

Parameters:
loader - the class loader
Method Detail

getClassName

public String getClassName()
Specified by:
getClassName in interface Context

getInitialBytecode

public byte[] getInitialBytecode()
Description copied from interface: Context
Returns the initial bytecode.

Specified by:
getInitialBytecode in interface Context
Returns:
bytecode

getCurrentBytecode

public byte[] getCurrentBytecode()
Description copied from interface: Context
Returns the current bytecode.

Specified by:
getCurrentBytecode in interface Context
Returns:
bytecode

setCurrentBytecode

public void setCurrentBytecode(byte[] bytecode)
Sets the current bytecode.

Specified by:
setCurrentBytecode in interface Context
Parameters:
bytecode -

getClassAbstraction

public Object getClassAbstraction()
Returns the class abstraction.

Specified by:
getClassAbstraction in interface Context
Returns:
clazz

getLoader

public ClassLoader getLoader()
Returns the class loader.

Specified by:
getLoader in interface Context
Returns:
the class loader

getDefinitions

public List getDefinitions()
The definitions context (with hierarchical structure)

Specified by:
getDefinitions in interface Context
Returns:

markAsAdvised

public void markAsAdvised()
Marks the class being transformed as advised. The marker can at most be set once per class per transformer

Specified by:
markAsAdvised in interface Context

markAsPrepared

public void markAsPrepared()
Marks the class as prepared.

Specified by:
markAsPrepared in interface Context

resetAdvised

public void resetAdvised()
Resets the isAdviced flag.

Specified by:
resetAdvised in interface Context

isAdvised

public boolean isAdvised()
Checks if the class being transformed has beed advised.

Specified by:
isAdvised in interface Context
Returns:
boolean

isPrepared

public boolean isPrepared()
Checks if the class is prepared.

Specified by:
isPrepared in interface Context
Returns:

markAsReadOnly

public void markAsReadOnly()
Marks the context as read-only.

Specified by:
markAsReadOnly in interface Context

isReadOnly

public boolean isReadOnly()
Checks if the context is read-only.

Specified by:
isReadOnly in interface Context
Returns:
boolean

getMetaData

public Object getMetaData(Object key)
Returns meta-data for the transformation.

Specified by:
getMetaData in interface Context
Parameters:
key - the key
Returns:
the value

addMetaData

public void addMetaData(Object key,
                        Object value)
Adds new meta-data for the transformation.

Specified by:
addMetaData in interface Context
Parameters:
key - the key
value - the value

dump

public void dump(String dir)
Dump the class to specific directory.

Specified by:
dump in interface Context
Parameters:
dir -


Copyright © 2002-2004 Jonas Bonér, Alexandre Vasseur. All Rights Reserved.