ChucK/Patterns/ExternalDataLoader

I have been experimenting with a pattern for loading external data, such that once the data is loaded into the ChucK VM, an event is triggered and a consumer of the data is informed that the data is ready for loadinginng

public class DataObj {
int mydata[];
}

public class TheEvent extends Event
{
int value;
}

//GlobalSpace - All public class that holds globally accessible
// Objects (in this case a user defined event class
//However you cannot (in v. 1.2.1.1) use a straightforward
//approach to capturing non-primative types in a static variable
//So we do a bare declare of e...
public class GlobalSpace {
static TheEvent @ e;
//static int data[200];
static DataObj @ callback;
}
// ...then use the following to do the assignment
new TheEvent @=> GlobalSpace.e;
//This seems to be a necessary hack to allow us to
//use a non-primitive in a static variable space
//