public class BeaconSendingContext
extends java.lang.Object
| Constructor and Description |
|---|
BeaconSendingContext(Logger logger,
Configuration configuration,
HTTPClientProvider httpClientProvider,
TimingProvider timingProvider)
Constructor.
|
BeaconSendingContext(Logger logger,
Configuration configuration,
HTTPClientProvider httpClientProvider,
TimingProvider timingProvider,
com.dynatrace.openkit.core.communication.AbstractBeaconSendingState initialState)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
executeCurrentState()
Executes the current state.
|
void |
finishSession(SessionImpl session)
Finish a session which has been started previously using
startSession(SessionImpl). |
boolean |
isInitialized()
Get a boolean indicating whether OpenKit is initialized or not.
|
boolean |
isInTerminalState()
Gets a boolean indicating whether the current state is a terminal state or not.
|
boolean |
isShutdownRequested()
Gets a boolean flag indicating whether shutdown was requested before or not.
|
void |
requestShutdown()
Requests a shutdown.
|
void |
startSession(SessionImpl session)
Start a new session.
|
boolean |
waitForInit()
Wait until OpenKit has been fully initialized.
|
boolean |
waitForInit(long timeoutMillis)
Wait until OpenKit has been fully initialized or timeout expired.
|
public BeaconSendingContext(Logger logger, Configuration configuration, HTTPClientProvider httpClientProvider, TimingProvider timingProvider)
The state is initialized to BeaconSendingInitState,
public BeaconSendingContext(Logger logger, Configuration configuration, HTTPClientProvider httpClientProvider, TimingProvider timingProvider, com.dynatrace.openkit.core.communication.AbstractBeaconSendingState initialState)
The initial state is provided. This constructor is intended for unit testing.
public void executeCurrentState()
public void requestShutdown()
public boolean isShutdownRequested()
public boolean waitForInit()
If initialization is interrupted (e.g. requestShutdown() was called), then this method also returns.
true OpenKit is fully initialized, false OpenKit init got interrupted.public boolean waitForInit(long timeoutMillis)
If initialization is interrupted (e.g. requestShutdown() was called), then this method also returns.
timeoutMillis - The maximum number of milliseconds to wait for initialization being completed.true if OpenKit is fully initialized, false if OpenKit init got interrupted or time to wait expired.public boolean isInitialized()
true if OpenKit is initialized, false otherwise.public boolean isInTerminalState()
true if the current state is a terminal state, false otherwise.public void startSession(SessionImpl session)
This add the session to the internal container of sessions.
session - The new session to start.public void finishSession(SessionImpl session)
startSession(SessionImpl).session - The session to finish.