Add @Override to remaining source files

Issue: SPR-10130
This commit is contained in:
Rob Winch
2013-05-13 16:47:34 -05:00
parent 30db112d37
commit 9468548116
1279 changed files with 5825 additions and 2 deletions

View File

@@ -47,6 +47,7 @@ public class StandardWebSocketSessionAdapter extends AbstractWebSocketSesssionAd
private String remoteAddress;
@Override
public void initSession(javax.websocket.Session session) {
Assert.notNull(session, "session is required");
this.session = session;

View File

@@ -67,6 +67,7 @@ public abstract class ConnectionManagerSupport implements SmartLifecycle {
* connection manager will connect to the remote endpoint upon a
* ContextRefreshedEvent.
*/
@Override
public boolean isAutoStartup() {
return this.autoStartup;
}
@@ -86,6 +87,7 @@ public abstract class ConnectionManagerSupport implements SmartLifecycle {
* Return the phase in which this endpoint connection factory will be auto-connected
* and stopped.
*/
@Override
public int getPhase() {
return this.phase;
}
@@ -97,6 +99,7 @@ public abstract class ConnectionManagerSupport implements SmartLifecycle {
/**
* Return whether this ConnectionManager has been started.
*/
@Override
public boolean isRunning() {
synchronized (this.lifecycleMonitor) {
return this.isRunning;
@@ -107,6 +110,7 @@ public abstract class ConnectionManagerSupport implements SmartLifecycle {
* Connect to the configured {@link #setDefaultUri(URI) default URI}. If already
* connected, the method has no impact.
*/
@Override
public final void start() {
synchronized (this.lifecycleMonitor) {
if (!isRunning()) {
@@ -139,6 +143,7 @@ public abstract class ConnectionManagerSupport implements SmartLifecycle {
protected abstract void openConnection() throws Exception;
@Override
public final void stop() {
synchronized (this.lifecycleMonitor) {
if (isRunning()) {
@@ -168,6 +173,7 @@ public abstract class ConnectionManagerSupport implements SmartLifecycle {
protected abstract void closeConnection() throws Exception;
@Override
public final void stop(Runnable callback) {
synchronized (this.lifecycleMonitor) {
this.stop();

View File

@@ -51,6 +51,7 @@ public abstract class AbstractServerSockJsSession extends AbstractSockJsSession
return this.sockJsConfig;
}
@Override
public final synchronized void sendMessage(WebSocketMessage message) throws IOException {
Assert.isTrue(!isClosed(), "Cannot send a message when session is closed");
Assert.isInstanceOf(TextMessage.class, message, "Expected text message: " + message);
@@ -132,6 +133,7 @@ public abstract class AbstractServerSockJsSession extends AbstractSockJsSession
}
Date time = new Date(System.currentTimeMillis() + getSockJsConfig().getHeartbeatTime());
this.heartbeatTask = getSockJsConfig().getTaskScheduler().schedule(new Runnable() {
@Override
public void run() {
try {
sendHeartbeat();

View File

@@ -130,6 +130,7 @@ public abstract class AbstractSockJsService implements SockJsService, SockJsConf
// sort with longest prefix at the top
Collections.sort(this.sockJsPrefixes, Collections.reverseOrder(new Comparator<String>() {
@Override
public int compare(String o1, String o2) {
return new Integer(o1.length()).compareTo(new Integer(o2.length()));
}
@@ -166,6 +167,7 @@ public abstract class AbstractSockJsService implements SockJsService, SockJsConf
return this;
}
@Override
public int getStreamBytesLimit() {
return streamBytesLimit;
}
@@ -196,10 +198,12 @@ public abstract class AbstractSockJsService implements SockJsService, SockJsConf
return this;
}
@Override
public long getHeartbeatTime() {
return this.heartbeatTime;
}
@Override
public TaskScheduler getTaskScheduler() {
return this.taskScheduler;
}
@@ -249,6 +253,7 @@ public abstract class AbstractSockJsService implements SockJsService, SockJsConf
*
* @throws Exception
*/
@Override
public final void handleRequest(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler handler)
throws IOException, TransportErrorException {
@@ -438,6 +443,7 @@ public abstract class AbstractSockJsService implements SockJsService, SockJsConf
private static final String INFO_CONTENT =
"{\"entropy\":%s,\"origins\":[\"*:*\"],\"cookie_needed\":%s,\"websocket\":%s}";
@Override
public void handle(ServerHttpRequest request, ServerHttpResponse response) throws IOException {
if (HttpMethod.GET.equals(request.getMethod())) {
@@ -483,6 +489,7 @@ public abstract class AbstractSockJsService implements SockJsService, SockJsConf
"</body>\n" +
"</html>";
@Override
public void handle(ServerHttpRequest request, ServerHttpResponse response) throws IOException {
if (!HttpMethod.GET.equals(request.getMethod())) {

View File

@@ -70,6 +70,7 @@ public abstract class AbstractSockJsSession implements ConfigurableWebSocketSess
this.handler = webSocketHandler;
}
@Override
public String getId() {
return this.id;
}
@@ -89,26 +90,32 @@ public abstract class AbstractSockJsSession implements ConfigurableWebSocketSess
return "wss".equals(this.uri.getSchemeSpecificPart());
}
@Override
public String getRemoteHostName() {
return this.remoteHostName;
}
@Override
public void setRemoteHostName(String remoteHostName) {
this.remoteHostName = remoteHostName;
}
@Override
public String getRemoteAddress() {
return this.remoteAddress;
}
@Override
public void setRemoteAddress(String remoteAddress) {
this.remoteAddress = remoteAddress;
}
@Override
public Principal getPrincipal() {
return this.principal;
}
@Override
public void setPrincipal(Principal principal) {
this.principal = principal;
}
@@ -117,6 +124,7 @@ public abstract class AbstractSockJsSession implements ConfigurableWebSocketSess
return State.NEW.equals(this.state);
}
@Override
public boolean isOpen() {
return State.OPEN.equals(this.state);
}
@@ -216,6 +224,7 @@ public abstract class AbstractSockJsSession implements ConfigurableWebSocketSess
* {@inheritDoc}
* <p>Performs cleanup and notifies the {@link SockJsHandler}.
*/
@Override
public final void close() throws IOException {
close(new CloseStatus(3000, "Go away!"));
}
@@ -224,6 +233,7 @@ public abstract class AbstractSockJsSession implements ConfigurableWebSocketSess
* {@inheritDoc}
* <p>Performs cleanup and notifies the {@link SockJsHandler}.
*/
@Override
public final void close(CloseStatus status) throws IOException {
if (isOpen()) {
if (logger.isDebugEnabled()) {

View File

@@ -107,6 +107,7 @@ public class SockJsFrame {
|| (ch >= '\uFFF0' && ch <= '\uFFFF') || (ch >= '\uD800' && ch <= '\uDFFF');
}
@Override
public String toString() {
String result = this.content;
if (result.length() > 80) {
@@ -161,6 +162,7 @@ public class SockJsFrame {
* frame content is to be inserted; e.g. "data: %s\r\n\r\n"
* @return new SockJsFrame instance with the formatted content
*/
@Override
public SockJsFrame format(SockJsFrame frame) {
String content = String.format(this.format, preProcessContent(frame.getContent()));
return new SockJsFrame(content);

View File

@@ -245,6 +245,7 @@ public class DefaultSockJsService extends AbstractSockJsService {
private void scheduleSessionTask() {
this.sessionCleanupTask = getTaskScheduler().scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
try {
int count = sessions.size();

View File

@@ -117,6 +117,7 @@ public abstract class AbstractHttpServerSockJsSession extends AbstractServerSock
}
@Override
public synchronized boolean isActive() {
return ((this.asyncRequest != null) && (!this.asyncRequest.isAsyncCompleted()));
}
@@ -133,6 +134,7 @@ public abstract class AbstractHttpServerSockJsSession extends AbstractServerSock
return this.response;
}
@Override
protected final synchronized void sendMessageInternal(String message) throws IOException {
this.messageCache.add(message);
tryFlushCache();
@@ -170,6 +172,7 @@ public abstract class AbstractHttpServerSockJsSession extends AbstractServerSock
this.response = null;
}
@Override
protected synchronized void writeFrameInternal(SockJsFrame frame) throws IOException {
if (isActive()) {
frame = this.frameFormat.format(frame);

View File

@@ -48,6 +48,7 @@ public class StreamingServerSockJsSession extends AbstractHttpServerSockJsSessio
}
}
@Override
protected void flushCache() throws IOException {
cancelHeartbeat();

View File

@@ -50,6 +50,7 @@ public class XhrPollingTransportHandler extends AbstractHttpSendingTransportHand
return new DefaultFrameFormat("%s\n");
}
@Override
public PollingServerSockJsSession createSession(String sessionId, WebSocketHandler handler) {
Assert.notNull(getSockJsConfig(), "This transport requires SockJsConfiguration");
return new PollingServerSockJsSession(sessionId, getSockJsConfig(), handler);

View File

@@ -40,6 +40,7 @@ public class AbstractSockJsServiceTests extends AbstractHttpRequestTests {
private WebSocketHandler handler;
@Override
@Before
public void setUp() {
super.setUp();

View File

@@ -32,6 +32,7 @@ public class StubSockJsConfig implements SockJsConfiguration {
private TaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
@Override
public int getStreamBytesLimit() {
return streamBytesLimit;
}
@@ -40,6 +41,7 @@ public class StubSockJsConfig implements SockJsConfiguration {
this.streamBytesLimit = streamBytesLimit;
}
@Override
public long getHeartbeatTime() {
return heartbeatTime;
}
@@ -48,6 +50,7 @@ public class StubSockJsConfig implements SockJsConfiguration {
this.heartbeatTime = heartbeatTime;
}
@Override
public TaskScheduler getTaskScheduler() {
return taskScheduler;
}

View File

@@ -38,6 +38,7 @@ public class DefaultSockJsServiceTests extends AbstractHttpRequestTests {
private DefaultSockJsService service;
@Override
@Before
public void setUp() {
super.setUp();