Class SessionSlot
java.lang.Object
org.openqa.selenium.grid.node.local.SessionSlot
- All Implemented Interfaces:
Function<CreateSessionRequest,,org.openqa.selenium.internal.Either<org.openqa.selenium.WebDriverException, ActiveSession>> Predicate<org.openqa.selenium.Capabilities>,org.openqa.selenium.remote.http.HttpHandler
public class SessionSlot
extends Object
implements org.openqa.selenium.remote.http.HttpHandler, Function<CreateSessionRequest,org.openqa.selenium.internal.Either<org.openqa.selenium.WebDriverException,ActiveSession>>, Predicate<org.openqa.selenium.Capabilities>
-
Constructor Summary
ConstructorsConstructorDescriptionSessionSlot(EventBus bus, org.openqa.selenium.Capabilities stereotype, SessionFactory factory) -
Method Summary
Modifier and TypeMethodDescriptionorg.openqa.selenium.internal.Either<org.openqa.selenium.WebDriverException, ActiveSession> apply(CreateSessionRequest sessionRequest) org.openqa.selenium.remote.http.HttpResponseexecute(org.openqa.selenium.remote.http.HttpRequest req) getId()@Nullable ActiveSessionorg.openqa.selenium.Capabilitiesbooleanbooleanbooleanbooleanbooleanvoidrelease()voidreserve()voidstop()voidstop(SessionClosedReason reason) voidstop(SessionClosedReason reason, @Nullable NodeId nodeId, @Nullable URI nodeUri) Stops the session with full context for sidecar services.booleantest(org.openqa.selenium.Capabilities capabilities) booleantryReserve(org.openqa.selenium.Capabilities capabilities) Atomically attempts to reserve this slot if it's available and matches the given capabilities.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openqa.selenium.remote.http.HttpHandler
with
-
Constructor Details
-
SessionSlot
public SessionSlot(EventBus bus, org.openqa.selenium.Capabilities stereotype, SessionFactory factory)
-
-
Method Details
-
getId
-
getStereotype
public org.openqa.selenium.Capabilities getStereotype() -
reserve
public void reserve() -
tryReserve
public boolean tryReserve(org.openqa.selenium.Capabilities capabilities) 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
public org.openqa.selenium.remote.http.HttpResponse execute(org.openqa.selenium.remote.http.HttpRequest req) throws UncheckedIOException - Specified by:
executein interfaceorg.openqa.selenium.remote.http.HttpHandler- Throws:
UncheckedIOException
-
test
public boolean test(org.openqa.selenium.Capabilities capabilities) -
apply
public org.openqa.selenium.internal.Either<org.openqa.selenium.WebDriverException,ActiveSession> apply(CreateSessionRequest sessionRequest) - Specified by:
applyin interfaceFunction<CreateSessionRequest,org.openqa.selenium.internal.Either<org.openqa.selenium.WebDriverException, ActiveSession>>
-
isSupportingCdp
public boolean isSupportingCdp() -
isSupportingBiDi
public boolean isSupportingBiDi() -
hasRelayFactory
public boolean hasRelayFactory() -
isRelayServiceUp
public boolean isRelayServiceUp() -
getConnectionCounter
-