📍Use lombok, reformat, and optimize the code (#1560)
* Use lombok, reformat, and optimize the code * Fix merge conflicts and some sonar issues Co-authored-by: va1m <va1m@email.com>
This commit is contained in:
@ -29,7 +29,6 @@ package com.iluwatar.business.delegate;
|
||||
public class BusinessDelegate {
|
||||
|
||||
private BusinessLookup lookupService;
|
||||
private BusinessService businessService;
|
||||
private ServiceType serviceType;
|
||||
|
||||
public void setLookupService(BusinessLookup businessLookup) {
|
||||
@ -41,7 +40,7 @@ public class BusinessDelegate {
|
||||
}
|
||||
|
||||
public void doTask() {
|
||||
businessService = lookupService.getBusinessService(serviceType);
|
||||
BusinessService businessService = lookupService.getBusinessService(serviceType);
|
||||
businessService.doProcessing();
|
||||
}
|
||||
}
|
||||
|
@ -23,9 +23,12 @@
|
||||
|
||||
package com.iluwatar.business.delegate;
|
||||
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* Class for performing service lookups.
|
||||
*/
|
||||
@Setter
|
||||
public class BusinessLookup {
|
||||
|
||||
private EjbService ejbService;
|
||||
@ -45,12 +48,4 @@ public class BusinessLookup {
|
||||
return jmsService;
|
||||
}
|
||||
}
|
||||
|
||||
public void setJmsService(JmsService jmsService) {
|
||||
this.jmsService = jmsService;
|
||||
}
|
||||
|
||||
public void setEjbService(EjbService ejbService) {
|
||||
this.ejbService = ejbService;
|
||||
}
|
||||
}
|
||||
|
@ -23,16 +23,14 @@
|
||||
|
||||
package com.iluwatar.business.delegate;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* Service EJB implementation.
|
||||
*/
|
||||
@Slf4j
|
||||
public class EjbService implements BusinessService {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(EjbService.class);
|
||||
|
||||
@Override
|
||||
public void doProcessing() {
|
||||
LOGGER.info("EjbService is now processing");
|
||||
|
@ -23,16 +23,14 @@
|
||||
|
||||
package com.iluwatar.business.delegate;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* Service JMS implementation.
|
||||
*/
|
||||
@Slf4j
|
||||
public class JmsService implements BusinessService {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(JmsService.class);
|
||||
|
||||
@Override
|
||||
public void doProcessing() {
|
||||
LOGGER.info("JmsService is now processing");
|
||||
|
@ -28,5 +28,6 @@ package com.iluwatar.business.delegate;
|
||||
*/
|
||||
public enum ServiceType {
|
||||
|
||||
EJB, JMS
|
||||
EJB,
|
||||
JMS
|
||||
}
|
||||
|
Reference in New Issue
Block a user