Top Description Inners Fields Constructors Methods
org.python.core

public Class BytecodeNotification

extends Object
Class Inheritance
Imports
java.io.ByteArrayOutputStream, java.util.List, java.util.concurrent.CopyOnWriteArrayList

Notifies registered callbacks if new bytecode is loaded.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
BytecodeNotification.Callback

Interface for callbacks.

Field Summary

Modifier and TypeField and Description
private static List<BytecodeNotification.Callback>
callbacks

The following list stores register callback objects.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static void
clear()

Clears all the registered callbacks

public static void
notify(String
the name of the class of the new bytecode
name
,
byte[]
raw byte data of the class
data
,
Class<T>
Java class object of the new bytecode
klass
)

Notifies that the new bytecode to the registered callbacks

public static void
register(BytecodeNotification.Callback
the callback object
n
)

Registers the class as a callback

public static boolean

Returns:

true if successfully removed and false if the callback object was not registered
unregister
(BytecodeNotification.Callback
the callback object
n
)

Unregisters the callback object

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

callbacksback to summary
private static List<BytecodeNotification.Callback> callbacks

The following list stores register callback objects. The list is shared among the PySystemState objects if there are multiple instances.

Constructor Detail

BytecodeNotificationback to summary
public BytecodeNotification()

Method Detail

clearback to summary
public static void clear()

Clears all the registered callbacks

notifyback to summary
public static void notify(String name, byte[] data, Class<T> klass)

Notifies that the new bytecode to the registered callbacks

Parameters
name:String

the name of the class of the new bytecode

data:byte[]

raw byte data of the class

klass:Class<T>

Java class object of the new bytecode

registerback to summary
public static void register(BytecodeNotification.Callback n)

Registers the class as a callback

Parameters
n:BytecodeNotification.Callback

the callback object

unregisterback to summary
public static boolean unregister(BytecodeNotification.Callback n)

Unregisters the callback object

Parameters
n:BytecodeNotification.Callback

the callback object

Returns:boolean

true if successfully removed and false if the callback object was not registered

org.python.core back to summary

public Interface BytecodeNotification.Callback

Known Direct Implementers
org.python.modules._bytecodetools._Callback

Interface for callbacks. Notifies the name of the loaded class, raw bytes of the class, and the Java class object.

Method Summary

Modifier and TypeMethod and Description
public void
notify(String name, byte[] bytes, Class<T> c)

Method Detail

notifyback to summary
public void notify(String name, byte[] bytes, Class<T> c)