Merge remote-tracking branch 'origin/jetty-10.0.x' into jetty-11.0.x

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
Lachlan Roberts 2020-08-04 20:39:32 +10:00
commit 730b42619b
7 changed files with 69 additions and 66 deletions

View File

@ -1,25 +1,24 @@
// //
// ======================================================================== // ========================================================================
// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. // Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// and Apache License v2.0 which accompanies this distribution.
// //
// The Eclipse Public License is available at // This program and the accompanying materials are made available under
// http://www.eclipse.org/legal/epl-v10.html // the terms of the Eclipse Public License 2.0 which is available at
// https://www.eclipse.org/legal/epl-2.0
// //
// The Apache License v2.0 is available at // This Source Code may also be made available under the following
// http://www.opensource.org/licenses/apache2.0.php // Secondary Licenses when the conditions for such availability set
// forth in the Eclipse Public License, v. 2.0 are satisfied:
// the Apache License v2.0 which is available at
// https://www.apache.org/licenses/LICENSE-2.0
// //
// You may elect to redistribute this code under either of these licenses. // SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
// ======================================================================== // ========================================================================
// //
package org.eclipse.jetty.client; package org.eclipse.jetty.client;
import org.eclipse.jetty.client.api.Connection; import org.eclipse.jetty.client.api.Connection;
import org.eclipse.jetty.client.api.Destination;
public class ConnectionPoolHelper public class ConnectionPoolHelper
{ {

View File

@ -1,19 +1,19 @@
// //
// ======================================================================== // ========================================================================
// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. // Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// and Apache License v2.0 which accompanies this distribution.
// //
// The Eclipse Public License is available at // This program and the accompanying materials are made available under
// http://www.eclipse.org/legal/epl-v10.html // the terms of the Eclipse Public License 2.0 which is available at
// https://www.eclipse.org/legal/epl-2.0
// //
// The Apache License v2.0 is available at // This Source Code may also be made available under the following
// http://www.opensource.org/licenses/apache2.0.php // Secondary Licenses when the conditions for such availability set
// forth in the Eclipse Public License, v. 2.0 are satisfied:
// the Apache License v2.0 which is available at
// https://www.apache.org/licenses/LICENSE-2.0
// //
// You may elect to redistribute this code under either of these licenses. // SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
// ======================================================================== // ========================================================================
// //
package org.eclipse.jetty.util; package org.eclipse.jetty.util;

View File

@ -1,19 +1,19 @@
// //
// ======================================================================== // ========================================================================
// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. // Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// and Apache License v2.0 which accompanies this distribution.
// //
// The Eclipse Public License is available at // This program and the accompanying materials are made available under
// http://www.eclipse.org/legal/epl-v10.html // the terms of the Eclipse Public License 2.0 which is available at
// https://www.eclipse.org/legal/epl-2.0
// //
// The Apache License v2.0 is available at // This Source Code may also be made available under the following
// http://www.opensource.org/licenses/apache2.0.php // Secondary Licenses when the conditions for such availability set
// forth in the Eclipse Public License, v. 2.0 are satisfied:
// the Apache License v2.0 which is available at
// https://www.apache.org/licenses/LICENSE-2.0
// //
// You may elect to redistribute this code under either of these licenses. // SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
// ======================================================================== // ========================================================================
// //
package org.eclipse.jetty.util; package org.eclipse.jetty.util;

View File

@ -1,19 +1,19 @@
// //
// ======================================================================== // ========================================================================
// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. // Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// and Apache License v2.0 which accompanies this distribution.
// //
// The Eclipse Public License is available at // This program and the accompanying materials are made available under
// http://www.eclipse.org/legal/epl-v10.html // the terms of the Eclipse Public License 2.0 which is available at
// https://www.eclipse.org/legal/epl-2.0
// //
// The Apache License v2.0 is available at // This Source Code may also be made available under the following
// http://www.opensource.org/licenses/apache2.0.php // Secondary Licenses when the conditions for such availability set
// forth in the Eclipse Public License, v. 2.0 are satisfied:
// the Apache License v2.0 which is available at
// https://www.apache.org/licenses/LICENSE-2.0
// //
// You may elect to redistribute this code under either of these licenses. // SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
// ======================================================================== // ========================================================================
// //
package org.eclipse.jetty.util; package org.eclipse.jetty.util;

View File

@ -21,7 +21,7 @@ package org.eclipse.jetty.websocket.jakarta.common;
import java.util.Collections; import java.util.Collections;
import java.util.Set; import java.util.Set;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CopyOnWriteArraySet; import java.util.concurrent.ConcurrentHashMap;
import jakarta.websocket.CloseReason; import jakarta.websocket.CloseReason;
import jakarta.websocket.Session; import jakarta.websocket.Session;
@ -30,12 +30,12 @@ import org.eclipse.jetty.util.component.Graceful;
public class SessionTracker extends AbstractLifeCycle implements JakartaWebSocketSessionListener, Graceful public class SessionTracker extends AbstractLifeCycle implements JakartaWebSocketSessionListener, Graceful
{ {
private final CopyOnWriteArraySet<JakartaWebSocketSession> sessions = new CopyOnWriteArraySet<>(); private final Set<JakartaWebSocketSession> sessions = Collections.newSetFromMap(new ConcurrentHashMap<>());
private boolean isShutdown = false; private boolean isShutdown = false;
public Set<Session> getSessions() public Set<Session> getSessions()
{ {
return Collections.unmodifiableSet(sessions); return Set.copyOf(sessions);
} }
@Override @Override

View File

@ -19,8 +19,12 @@
package org.eclipse.jetty.websocket.common; package org.eclipse.jetty.websocket.common;
import java.util.Collection; import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArrayList;
import org.eclipse.jetty.util.component.AbstractLifeCycle; import org.eclipse.jetty.util.component.AbstractLifeCycle;
@ -31,12 +35,12 @@ import org.eclipse.jetty.websocket.api.WebSocketSessionListener;
public class SessionTracker extends AbstractLifeCycle implements WebSocketSessionListener, Graceful public class SessionTracker extends AbstractLifeCycle implements WebSocketSessionListener, Graceful
{ {
private final List<Session> sessions = new CopyOnWriteArrayList<>(); private final Set<Session> sessions = Collections.newSetFromMap(new ConcurrentHashMap<>());
private boolean isShutdown = false; private boolean isShutdown = false;
public Collection<Session> getSessions() public Collection<Session> getSessions()
{ {
return sessions; return Set.copyOf(sessions);
} }
@Override @Override

View File

@ -1,19 +1,19 @@
// //
// ======================================================================== // ========================================================================
// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. // Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// and Apache License v2.0 which accompanies this distribution.
// //
// The Eclipse Public License is available at // This program and the accompanying materials are made available under
// http://www.eclipse.org/legal/epl-v10.html // the terms of the Eclipse Public License 2.0 which is available at
// https://www.eclipse.org/legal/epl-2.0
// //
// The Apache License v2.0 is available at // This Source Code may also be made available under the following
// http://www.opensource.org/licenses/apache2.0.php // Secondary Licenses when the conditions for such availability set
// forth in the Eclipse Public License, v. 2.0 are satisfied:
// the Apache License v2.0 which is available at
// https://www.apache.org/licenses/LICENSE-2.0
// //
// You may elect to redistribute this code under either of these licenses. // SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
// ======================================================================== // ========================================================================
// //
package org.eclipse.jetty.client.jmh; package org.eclipse.jetty.client.jmh;