org.springsource.loaded
Interface ReloadEventProcessorPlugin

All Superinterfaces:
Plugin
All Known Implementing Classes:
GrailsPlugin, GroovyPlugin, JVMPlugin, SpringPlugin

public interface ReloadEventProcessorPlugin
extends Plugin

ReloadEventProcessor Plugins are called when a type is reloading. For information on registering them, see Plugin

Since:
0.5.0

Method Summary
 void reloadEvent(java.lang.String typename, java.lang.Class<?> clazz, java.lang.String encodedTimestamp)
          Called when a type has been reloaded.
 boolean shouldRerunStaticInitializer(java.lang.String typename, java.lang.Class<?> clazz, java.lang.String encodedTimestamp)
          Called when a type has been reloaded, allows the plugin to decide if the static initializer should be re-run for the reloaded type.
 

Method Detail

shouldRerunStaticInitializer

boolean shouldRerunStaticInitializer(java.lang.String typename,
                                     java.lang.Class<?> clazz,
                                     java.lang.String encodedTimestamp)
Called when a type has been reloaded, allows the plugin to decide if the static initializer should be re-run for the reloaded type. If the reloaded type has a different static initializer, the new one is the one that will run.

Parameters:
typename - the (dotted) type name, for example java.lang.String
clazz - the Class object that has been reloaded
encodedTimestamp - an encoded time stamp for this version, containing chars (A-Za-z0-9)
Returns:
true if the static initializer should be re-run

reloadEvent

void reloadEvent(java.lang.String typename,
                 java.lang.Class<?> clazz,
                 java.lang.String encodedTimestamp)
Called when a type has been reloaded. Note, the class is only truly defined to the VM once, and so the Class object (clazz parameter) is always the same for the same type (ignoring multiple classloader situations). It is passed here so that plugins processing events can clear any cached state related to it. The encodedTimestamp is an encoding of the ID that the agent has assigned to this reloaded version of this type.

Parameters:
typename - the (dotted) type name, for example java.lang.String
clazz - the Class object that has been reloaded
encodedTimestamp - an encoded time stamp for this version, containing chars (A-Za-z0-9)