private void finishInitialization(EPServiceProvider epService, CSVInputAdapterSpec spec)
{
assertValidParameters(epService, spec);
EPServiceProviderSPI spi = (EPServiceProviderSPI)epService;
scheduleSlot = spi.getSchedulingMgmtService().allocateBucket().allocateSlot();
reader = new CSVReader(spec.getAdapterInputSource());
reader.setLooping(spec.isLooping());
String[] firstRow = getFirstRow();
Map<String, Object> givenPropertyTypes = constructPropertyTypes(spec.geteventTypeName(), spec.getPropertyTypes(), spi.getEventAdapterService());
propertyOrder = spec.getPropertyOrder() != null ?
spec.getPropertyOrder() :
CSVPropertyOrderHelper.resolvePropertyOrder(firstRow, givenPropertyTypes);
reader.setIsUsingTitleRow(isUsingTitleRow(firstRow, propertyOrder));
if(!isUsingTitleRow(firstRow, propertyOrder))
{
this.firstRow = firstRow;
}
propertyTypes = resolvePropertyTypes(givenPropertyTypes);
if(givenPropertyTypes == null)
{
spi.getEventAdapterService().addNestableMapType(eventTypeName, new HashMap<String, Object>(propertyTypes), null, true, true, true, false, false);
}
coercer.setPropertyTypes(propertyTypes);
}