@SuppressWarnings("deprecation") protected <T> T construct(Class<T> componentType) { switch (configuration.getNodeLockingScheme()) { case MVCC: return componentType.cast(new MVCCNodeFactory()); case OPTIMISTIC: return componentType.cast(new OptimisticNodeFactory()); case PESSIMISTIC: return componentType.cast(new PessimisticNodeFactory()); default: throw new ConfigurationException("Unknown locking scheme " + configuration.getNodeLockingScheme()); } } }