package org.yaourtcorp.kafka.producer.example.yogurt;

import java.util.Random;
import java.util.UUID;

import org.joda.time.DateTime;
import org.kohsuke.randname.RandomNameGenerator;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.yaourtcorp.kafka.producer.example.EventsFactory;

@Component(value="eventsFactory")
public class YogurtsFactory implements EventsFactory<Yogurt>{

	@Value( "${number.of.manfacturers}" )
	private int numberOfManufacturers;
	
	private final Random randomManufacturerIds = new Random();
	private final RandomNameGenerator rndNames = new RandomNameGenerator(0);
	


	@Override
	public Yogurt createNewEvent() {
		return new Yogurt(
				UUID.randomUUID().toString(),
				rndNames.next(),
				randomManufacturerIds.nextInt(numberOfManufacturers)+1,
				DateTime.now());
	}

	

}

@@ -345,16 +345,137 @@
 actory;%0A
+/*%0A * Factory of yogurts: create new yogurt objects with an unique cool name for each! (yeah, this example is stupid)%0A */
 %0A@Compon

Clean comments