Method Signature
OnixS::ICE::BOE::Scheduling::SessionScheduler provides these overloads for BGW sessions:
SessionScheduler& add(BgwSession* session, const SessionSchedule& schedule, IBgwCredentialsProvider* bgwCredentialsProvider); SessionScheduler& add(BgwSession* session, const SessionScheduleId& scheduleId, IBgwCredentialsProvider* bgwCredentialsProvider);
Parameters
- session is the BGW session to be managed by the Scheduler.
- schedule defines active/inactive time frames for automatic connect/disconnect.
- scheduleId identifies a predefined schedule from Scheduler configuration.
- bgwCredentialsProvider supplies BGW credentials on the first connection attempt.
Behavior
- If the session is added during an active time frame, Scheduler connects it immediately.
- If the session is added during an inactive time frame and it is currently active, Scheduler disconnects it.
- If the session was already registered, an exception is thrown.
- For the scheduleId overload, an exception is thrown if the schedule id is not found.
Example
The example below shows how to register a BGW session with a custom schedule. In this example, BusSession is used as IBgwCredentialsProvider.
scheduler.add(&bgwSession, scheduleForBus, &busSession);
scheduler.add(&bgwSession, scheduleForBgw, &busSession);
See Also