Skip to content

Commit 33ba622

Browse files
committed
removed unused lombok imports
1 parent c5e0ec5 commit 33ba622

File tree

2 files changed

+26
-30
lines changed

2 files changed

+26
-30
lines changed

micro-curator/src/main/java/com/aol/micro/server/curator/lock/DistributedLockServiceCuratorImpl.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
import lombok.AllArgsConstructor;
2020
import lombok.experimental.Wither;
2121

22-
import lombok.AllArgsConstructor;
23-
import lombok.experimental.Wither;
24-
2522
/**
2623
* DistributedLockService suitable for single threaded use only
2724
*
@@ -30,7 +27,7 @@
3027
@AllArgsConstructor
3128
public class DistributedLockServiceCuratorImpl implements DistributedLockService, ConnectionStateListener {
3229

33-
30+
3431

3532
private final ConcurrentMap<String, InterProcessMutex> locks = new ConcurrentHashMap<>();
3633

@@ -61,8 +58,8 @@ public boolean tryLock(String key) {
6158
try {
6259
InterProcessMutex mutex = locks.computeIfAbsent(key,
6360
__ -> new InterProcessMutex(curatorFramework, String.join("/", basePath, key)));
64-
65-
61+
62+
6663
boolean owned = mutex.isAcquiredInThisProcess();
6764
if(owned) {
6865
return true;
@@ -89,7 +86,7 @@ public boolean tryReleaseLock(String key) {
8986

9087
@Override
9188
public void stateChanged(CuratorFramework client, ConnectionState newState) {
92-
89+
9390
switch (newState) {
9491
case LOST:
9592
case SUSPENDED:

micro-tomcat/src/main/java/com/aol/micro/server/servers/tomcat/TomcatApplication.java

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import lombok.AccessLevel;
1212
import lombok.AllArgsConstructor;
1313
import lombok.Getter;
14-
import lombok.experimental.Wither;
1514

1615
import org.apache.catalina.LifecycleException;
1716
import org.apache.catalina.connector.Connector;
@@ -49,13 +48,13 @@ public class TomcatApplication implements ServerApplication {
4948
private final PStack<ServletData> servletData;
5049
private final PStack<ServletContextListener> servletContextListenerData;
5150
private final PStack<ServletRequestListener> servletRequestListenerData;
52-
51+
5352
public TomcatApplication(AllData serverData) {
5453
this.serverData = serverData.getServerData();
5554
this.filterData = serverData.getFilterDataList();
5655
this.servletData = serverData.getServletDataList();
5756
this.servletContextListenerData = serverData.getServletContextListeners();
58-
this.servletRequestListenerData = serverData.getServletRequestListeners();
57+
this.servletRequestListenerData = serverData.getServletRequestListeners();
5958
}
6059

6160
public void run(CompletableFuture start, JaxRsServletConfigurer jaxRsConfigurer, CompletableFuture end) {
@@ -65,13 +64,13 @@ public void run(CompletableFuture start, JaxRsServletConfigurer jaxRsConfigurer
6564
tomcat.getEngine().setBackgroundProcessorDelay(-1);
6665
File docBase = new File(".");
6766
StandardContext context =(StandardContext)tomcat.addContext("", docBase.getAbsolutePath());
68-
context.addServletContainerInitializer(new TomcatListener(jaxRsConfigurer, serverData, filterData, servletData, servletContextListenerData, servletRequestListenerData),
67+
context.addServletContainerInitializer(new TomcatListener(jaxRsConfigurer, serverData, filterData, servletData, servletContextListenerData, servletRequestListenerData),
6968
new HashSet<>());
7069
addAccessLog(tomcat,context);
71-
70+
7271
serverData.getModule().getServerConfigManager().accept(new WebServerProvider(tomcat));
73-
74-
addSSL(tomcat.getConnector());
72+
73+
addSSL(tomcat.getConnector());
7574

7675
startServer(tomcat, start, end);
7776
}
@@ -82,22 +81,22 @@ private void addSSL(Connector connector) {
8281
if(sslProperties!= null && handler instanceof AbstractHttp11JsseProtocol){
8382
new SSLConfigurationBuilder().build((AbstractHttp11JsseProtocol)handler,sslProperties);
8483
connector.setScheme("https");
85-
connector.setSecure(true);
86-
}
84+
connector.setSecure(true);
85+
}
8786
}
8887

8988
private void startServer( Tomcat httpServer, CompletableFuture start, CompletableFuture end) {
90-
89+
9190
try {
9291
logger.info("Starting application {} on port {}", serverData.getModule().getContext(), serverData.getPort());
9392
logger.info("Browse to http://localhost:{}/{}/application.wadl", serverData.getPort(), serverData.getModule().getContext());
9493
logger.info("Configured resource classes :-");
9594
serverData.extractResources().forEach(
9695
t -> logger.info(t.v1() + " : " + "http://localhost:" + serverData.getPort() + "/" + serverData.getModule().getContext() + t.v2()));
9796
;
98-
97+
9998
httpServer.start();
100-
99+
101100
start.complete(true);
102101
end.get();
103102

@@ -114,46 +113,46 @@ private void startServer( Tomcat httpServer, CompletableFuture start, Completabl
114113
httpServer.getConnector().destroy();
115114
httpServer.getEngine().destroy();
116115
httpServer.destroy();
117-
118-
119-
116+
117+
118+
120119
} catch (LifecycleException e) {
121120
}
122121
try{
123122
Thread.sleep(5_000);
124123
}
125124
catch (InterruptedException e) {
126-
125+
127126
}
128-
127+
129128
}
130129
}
131130

132131
private void addAccessLog(Tomcat httpServer, StandardContext context) {
133132
try {
134-
133+
135134
String accessLogLocation = serverData.getRootContext().getBean(AccessLogLocationBean.class).getAccessLogLocation();
136135

137136
accessLogLocation = accessLogLocation + "/" + replaceSlash(serverData.getModule().getContext()) + "-access.log";
138-
137+
139138
AccessLogValve accessLogValve = new AccessLogValve();
140139
accessLogValve.setDirectory(accessLogLocation);
141140
accessLogValve.setPattern(Constants.AccessLog.COMMON_ALIAS);
142141
accessLogValve.setSuffix(".log");
143142
accessLogValve.setRotatable(true);
144143
context.getPipeline().addValve(accessLogValve);
145-
144+
146145
} catch (Exception e) {
147-
146+
148147
logger.error(InternalErrorCode.SERVER_STARTUP_FAILED_TO_CREATE_ACCESS_LOG.toString() + ": " + e.getMessage());
149148
if (e.getCause() != null)
150149
logger.error("CAUSED BY: " + InternalErrorCode.SERVER_STARTUP_FAILED_TO_CREATE_ACCESS_LOG.toString() + ": " + e.getCause().getMessage());
151150

152151
}
153152

154153
}
155-
156-
154+
155+
157156

158157
private String replaceSlash(String context) {
159158
if (context != null && context.contains("/")) {

0 commit comments

Comments
 (0)