class ArchetypeServiceImpl implements ArchetypeService {

    @Override
    public void delete(final String alias) {
        checkNotEmpty(ALIAS_PARAM, alias);

        final OrganizationalUnit archetypesOU = resolveOU();

        if (archetypesOU != null) {
            repositoryService.removeRepository(archetypesOU.getSpace(),
                                               alias);

            archetypeConfigStorage.deleteArchetype(alias);

            archetypePreferencesManager.removeArchetype(alias);

            archetypeListUpdatedEvent.fire(new ArchetypeListUpdatedEvent(ArchetypeListOperation.DELETE));

            LOGGER.info("Archetype {} successfully deleted.", alias);
        } else {
            throw new IllegalStateException("Cannot delete an archetype when there is no archetype space available.");
        }
    }

    public  ArchetypeServiceImpl();
    @Inject public  ArchetypeServiceImpl(final @Named("ioStrategy") IOService ioService,
                                final RepositoryService repositoryService,
                                final OrganizationalUnitService ouService,
                                final Event<ArchetypeListUpdatedEvent> archetypeListUpdatedEvent,
                                final ArchetypeConfigStorage archetypeConfigStorage,
                                final PathUtil pathUtil,
                                final ArchetypePreferencesManager archetypePreferencesManager,
                                final KieModuleService moduleService,
                                final POMService pomService);

}