Create data container to receive produced data. This is invoked once
on every instance every time ThreadLocalDirectory.fetch() is invoked.
This might be an empty list, creating a new counter set to zero, or
even copying the current state of LocalInstance.current.
LocalInstance.current will be set to the value received from this
factory after invokation this method.
The first time this method is invoked for a thread, previous will be
null.
If using mutable objects, an implementation should always create a
new instance in this method, as the previous data generation will be
transmitted to the consuming thread. This obviously does not matter
if using immutable (value) objects.
Examples:
Using a mutable aggregator (a list of integers):
if (previous == null) {
return new ArrayList<Integer>();
} else {
return new ArrayList<Integer>(previous.size());
}
Using an immutable aggregator (an integer):
return Integer.valueOf(0);