Search in sources :

Example 1 with BusinessService

use of com.hack23.cia.service.impl.action.common.BusinessService in project cia by Hack23.

the class ApplicationManagerImpl method service.

@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public ServiceResponse service(final ServiceRequest serviceRequest) {
    final BusinessService businessService = serviceRequestBusinessServiceMap.get(serviceRequest.getClass());
    ServiceResponse serviceResponse = null;
    if (businessService != null) {
        serviceResponse = businessService.processService(serviceRequest);
    }
    return serviceResponse;
}
Also used : BusinessService(com.hack23.cia.service.impl.action.common.BusinessService) ServiceResponse(com.hack23.cia.service.api.action.common.ServiceResponse) Secured(org.springframework.security.access.annotation.Secured)

Example 2 with BusinessService

use of com.hack23.cia.service.impl.action.common.BusinessService in project cia by Hack23.

the class ApplicationManagerImpl method asyncService.

@Async("SecureTaskExecutor")
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Future<ServiceResponse> asyncService(final ServiceRequest serviceRequest) {
    final BusinessService businessService = serviceRequestBusinessServiceMap.get(serviceRequest.getClass());
    ServiceResponse serviceResponse = null;
    if (businessService != null) {
        serviceResponse = businessService.processService(serviceRequest);
    }
    return new AsyncResult<>(serviceResponse);
}
Also used : BusinessService(com.hack23.cia.service.impl.action.common.BusinessService) ServiceResponse(com.hack23.cia.service.api.action.common.ServiceResponse) AsyncResult(org.springframework.scheduling.annotation.AsyncResult) Secured(org.springframework.security.access.annotation.Secured) Async(org.springframework.scheduling.annotation.Async)

Aggregations

ServiceResponse (com.hack23.cia.service.api.action.common.ServiceResponse)2 BusinessService (com.hack23.cia.service.impl.action.common.BusinessService)2 Secured (org.springframework.security.access.annotation.Secured)2 Async (org.springframework.scheduling.annotation.Async)1 AsyncResult (org.springframework.scheduling.annotation.AsyncResult)1