shibboleth-3.5.0

Public Member Functions | List of all members
shibsp::ListenerService Class Referenceabstract

Interface to a remoting engine. More...

`#include <shibsp/remoting/ListenerService.h>`

Inheritance diagram for shibsp::ListenerService:

## Public Member Functions
virtual DDF | send (const DDF &in)=0
| Send a remoted message and return the response. More...
void | receive (DDF &in, std::ostream &out)
| Receive a remoted message and write the response. More...
DDF * | getInput () const
| Access the input message being processed by the active worker thread. More...
virtual void | regListener (const char *address, Remoted *svc)
| Register for a message. More...
virtual bool | unregListener (const char *address, Remoted *current)
| Unregisters service from an address, possibly restoring an original. More...
virtual Remoted * | lookup (const char *address) const
| Returns current service registered at an address, if any. More...
virtual bool | init (bool force)
| OutOfProcess servers can implement server-side initialization that should occur before daemonization. More...
virtual bool | run (bool *shutdown)=0
| OutOfProcess servers can implement server-side transport handling by calling the run method and supplying a flag to monitor for shutdown. More...
virtual void | term ()
| OutOfProcess servers can implement server-side termination/cleanup.
virtual void | receive (DDF &in, std::ostream &out)=0
| Remoted classes implement this method to process incoming messages. More...

## Detailed Description

Interface to a remoting engine.

A ListenerService supports the remoting of DDF objects, which are dynamic data trees that other class implementations can use to remote themselves by calling an out-of-process peer implementation with arbitrary data to carry out tasks on the implementation's behalf that require isolation from the dynamic process fluctuations that web servers are prone to. The ability to pass arbitrary data trees across the boundary allows arbitrary separation of duty between the in-process and out-of-process "halves". The ListenerService is responsible for marshalling and transmitting messages, as well as managing connections and communication errors.

## Member Function Documentation

## ◆ getInput()

DDF * shibsp::ListenerService::getInput | ( |  | ) | const

Access the input message being processed by the active worker thread.

Returns
  a reference to the input object

## ◆ init()

virtual bool shibsp::ListenerService::init | ( | bool | force | ) |
| virtual

OutOfProcess servers can implement server-side initialization that should occur before daemonization.

The parameter applies to implementations that can detect and remove the results of ungraceful shutdowns of previous executions and continue successfully. File-based sockets are the most common example.

Parameters

  force | true iff remnant network state should be forcibly cleared

Returns
  true iff the service initialization was successful

## ◆ lookup()

virtual Remoted * shibsp::ListenerService::lookup | ( | const char * | address | ) | const
| virtual

Returns current service registered at an address, if any.

Parameters

  address | message address to access

Returns
  registered service, or nullptr

## ◆ receive()

void shibsp::ListenerService::receive | ( | DDF & | in,
|  | std::ostream & | out
| ) |  |
| virtual

Receive a remoted message and write the response.

Parameters

  in | input message
  out | output stream to write to

Implements shibsp::Remoted.

## ◆ regListener()

virtual void shibsp::ListenerService::regListener | ( | const char * | address,
|  | Remoted * | svc
| ) |  |
| virtual

Register for a message.

Returns existing remote service, allowing message hooking.

Parameters

  address | message address to register
  svc | pointer to remote service

## ◆ run()

virtual bool shibsp::ListenerService::run | ( | bool * | shutdown | ) |
| pure virtual

OutOfProcess servers can implement server-side transport handling by calling the run method and supplying a flag to monitor for shutdown.

Parameters

  shutdown | pointer to flag that caller will set when shutdown is required

Returns
  true iff the service execution was successful

## ◆ send()

virtual DDF shibsp::ListenerService::send | ( | const DDF & | in | ) |
| pure virtual

Send a remoted message and return the response.

Parameters

  in | input message to send

Returns
  response from remote service

## ◆ unregListener()

virtual bool shibsp::ListenerService::unregListener | ( | const char * | address,
|  | Remoted * | current
| ) |  |
| virtual

Unregisters service from an address, possibly restoring an original.

Parameters

  address | message address to modify
  current | pointer to unregistering service

Returns
  true iff the current service was still registered

The documentation for this class was generated from the following file:

- shibsp/remoting/ListenerService.h