Class SessionSlot
java.lang.Object
org.openqa.selenium.grid.node.local.SessionSlot
- All Implemented Interfaces:
Function<CreateSessionRequest, Either<WebDriverException, ActiveSession>>, Predicate<Capabilities>, HttpHandler
public class SessionSlot
extends Object
implements HttpHandler, Function<CreateSessionRequest, Either<WebDriverException, ActiveSession>>, Predicate<Capabilities>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(CreateSessionRequest sessionRequest) execute(HttpRequest req) getId()@Nullable ActiveSessionbooleanbooleanbooleanbooleanbooleanvoidrelease()voidreserve()voidstop()voidstop(SessionClosedReason reason) voidstop(SessionClosedReason reason, @Nullable NodeId nodeId, @Nullable URI nodeUri) Stops the session with full context for sidecar services.booleantest(Capabilities capabilities) booleantryReserve(Capabilities capabilities) Atomically attempts to reserve this slot if it's available and matches the given capabilities.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface HttpHandler
with
-
Constructor Details
-
SessionSlot
-
-
Method Details
-
getId
-
getStereotype
-
reserve
public void reserve() -
tryReserve
Atomically attempts to reserve this slot if it's available and matches the given capabilities. This method is thread-safe and eliminates the need for external synchronization.- Parameters:
capabilities- the capabilities to test against this slot's stereotype- Returns:
- true if the slot was successfully reserved, false if already reserved or capabilities don't match
-
release
public void release() -
isAvailable
public boolean isAvailable() -
getSession
-
stop
public void stop() -
stop
-
stop
Stops the session with full context for sidecar services.- Parameters:
reason- the reason for closing the sessionnodeId- the ID of the node where the session was running (may be null for backward compatibility)nodeUri- the URI of the node where the session was running (may be null for backward compatibility)
-
execute
- Specified by:
executein interfaceHttpHandler- Throws:
UncheckedIOException
-
test
- Specified by:
testin interfacePredicate<Capabilities>
-
apply
- Specified by:
applyin interfaceFunction<CreateSessionRequest, Either<WebDriverException, ActiveSession>>
-
isSupportingCdp
public boolean isSupportingCdp() -
isSupportingBiDi
public boolean isSupportingBiDi() -
hasRelayFactory
public boolean hasRelayFactory() -
isRelayServiceUp
public boolean isRelayServiceUp() -
getConnectionCounter
-