ClientContext

implements Psr\Log\LoggerAwareInterface, SAREhub\Commons\Service\Service

Known implementers

SAREhub\Client\BasicClientContext

Methods Summary
public
# getProperty( string $name )
Sets property in context
public
# hasProperty( string $name )
Checks context has property
public
# setProperty( string $name , mixed $value )
Sets propertty yin context Value can be callable(first argument will be $this context), it will be lazy evaluate in first use.
public
# addFactory( string $name , callable $factory )
Adds factory to context as property any call to that
public
# addService( string $name , SAREhub\Commons\Service\Service $service )
Adds service to context for lifecycle manage(service will be started if not started yet). Sets service as context property. Sets context(when implements ClientContextAware) and logger(creates based on name) of service.
public
public
# now( )
Returns current timestamp
public
public
# setTimeProvider( SAREhub\Commons\Misc\TimeProvider $provider )
public
# injectLogger( string $name , Psr\Log\LoggerAwareInterface $aware )
public
public
# setLoggerFactory( SAREhub\Commons\Logger\LoggerFactory $factory )