class GeoToolsLayer extends FeatureSourceRetriever implements VectorLayer {

	@Override
	@Transactional(rollbackFor = { Throwable.class })
	public Object create(Object feature) throws LayerException {
		SimpleFeatureSource source = getFeatureSource();
		if (source instanceof SimpleFeatureStore) {
			SimpleFeatureStore store = (SimpleFeatureStore) source;
			DefaultFeatureCollection collection = new DefaultFeatureCollection();
			collection.add((SimpleFeature) feature);
			transactionSynchronization.synchTransaction(store);
			try {
				List<FeatureId> ids = store.addFeatures(collection);
				// fetch it again to get the generated values !!!
				if (ids.size() == 1) {
					return read(ids.get(0).getID());
				}
			} catch (IOException ioe) {
				featureModelUsable = false;
				throw new LayerException(ioe, ExceptionCode.LAYER_MODEL_IO_EXCEPTION);
			}
			return feature;
		} else {
			log.error("Don't know how to create or update " + getFeatureSourceName() + ", class "
					+ source.getClass().getName() + " does not implement SimpleFeatureStore");
			throw new LayerException(ExceptionCode.CREATE_OR_UPDATE_NOT_IMPLEMENTED, getFeatureSourceName(), source
					.getClass().getName());
		}
	}

}