class ResourceTypesResource extends RealmAwareResource {

    @Override
    public Promise<ResourceResponse, ResourceException> deleteInstance(Context context, String resourceId,
            DeleteRequest request) {

        String principalName = "unknown";
        try {
            final Subject callingSubject = getSubject(context);
            final String realm = getRealm(context);
            principalName = PrincipalRestUtils.getPrincipalNameFromSubject(callingSubject);

            resourceTypeService.deleteResourceType(callingSubject, realm, resourceId);

            final ResourceResponse resource = newResourceResponse(resourceId, "0", JsonValue.json(JsonValue.object()));
            return newResultPromise(resource);
        } catch (EntitlementException e) {
            if (logger.errorEnabled()) {
                logger.error("ApplicationsResource :: DELETE by "
                        + principalName
                        + ": Application failed to delete the resource specified. ", e);
            }
            return exceptionMappingHandler.handleError(context, request, e).asPromise();
        }
    }

    @Inject public  ResourceTypesResource(
            @Named("frRest") Debug logger,
            ExceptionMappingHandler<EntitlementException, ResourceException> exceptionMappingHandler,
            ResourceTypeService resourceTypeService);

}