Class Services

Description

The Services class handles starting, stopping, registering, etc of any available services.

  • license: GNU General Public License (GPL)
  • copyright: Copyright © 2005, Middlebury College
  • version: $Id: Services.class.php,v 1.24 2007/09/10 20:52:31 adamfranco Exp $
  • version: $Id: Services.class.php,v 1.24 2007/09/10 20:52:31 adamfranco Exp $

Located in /harmoni/core/services/Services.class.php (line 17)

ServicesInterface
   |
   --ServicesAbstract
      |
      --Services
Variable Summary
Method Summary
void Services ()
boolean available (string $name)
void createAlias (string $registeredName, string $aliasName)
object Object|false get (string $name)
boolean register (string $name, string $class)
void registerObject (string $name, ref $object)
boolean restart (string $name)
boolean running (string $name)
boolean start (string $name, [optional $args = null])
void startAll ()
boolean startManager (string $name, object OsidContext $context, object Properties $configuration)
boolean stop (string $name)
void stopAll ()
array _getBacktrace ()
string _getServiceName (string $name)
void __sleep ()
Variables
array $_registeredServices (line 30)

A private array of registerd services: array("key1"=>classname, ...)

  • var: The array of registered services.
array $_services (line 23)

A private array of services: array("key1"=>ServiceObject1, ...)

  • var: The array of services.
Methods
Constructor Services (line 37)

The constructor.

  • access: public
void Services ()
available (line 299)

Checks if the service referenced by $name is available for use.

  • return: True if the service is available, false otherwise.
  • access: public
boolean available (string $name)
  • string $name: The service name.*

Redefinition of:
ServicesInterface::available()
Checks if the service referenced by $name is available for use.
createAlias (line 107)

Create an alias from one service name to another.

  • since: 3/24/05
  • access: public
void createAlias (string $registeredName, string $aliasName)
  • string $registeredName
  • string $aliasName
get (line 143)

Returns the service object associated with reference name $name.

Returns the service object associated with reference name $name.

  • return: The service object.
  • access: public
object Object|false get (string $name)
  • string $name: The reference name of the service.

Redefinition of:
ServicesInterface::get()
Returns the service object associated with reference name $name.
register (line 60)

Registers a new service named $name. Upon starting, a new class of type $class will be instantiated.

  • return: True on success. False if service is registered and running or an error occurs.
  • access: public
boolean register (string $name, string $class)
  • string $name: The reference name of the service.
  • string $class: The class name to be instantiated.

Redefinition of:
ServicesInterface::register()
Registers a new service.
registerObject (line 90)

Register's an object as a service.

  • access: public
void registerObject (string $name, ref $object)
  • string $name: The name of the new service.
  • ref $object: object $object The object.

Redefinition of:
ServicesInterface::registerObject()
Register's an object as a service.
restart (line 285)

Attempts to restart the service reference by $name.

boolean restart (string $name)
  • string $name: The service name.

Redefinition of:
ServicesInterface::restart()
Attempts to restart the service reference by $name.
running (line 310)

Checks if the service referenced by $name has been started.

  • return: True if the service is running, false otherwise.
  • access: public
boolean running (string $name)
  • string $name: The service name.

Redefinition of:
ServicesInterface::running()
Checks if the service referenced by $name has been started.
start (line 164)

Attempts to start the service referenced by $name.

boolean start (string $name, [optional $args = null])
  • string $name: The service name.
  • optional $args: mixed $args,... Optional arguments to pass to the constructor of the service class.

Redefinition of:
ServicesInterface::start()
Attempts to start the service referenced by $name.
startAll (line 259)

Cycles through all registered services and attempts to start them.

void startAll ()

Redefinition of:
ServicesInterface::startAll()
Cycles through all registered services and attempts to start them.
startManager (line 220)

Attempts to start the manager referenced by $name. The manager must extend OsidManager And assign its context and configuration.

  • return: true on success
  • since: 3/24/05
  • access: public
boolean startManager (string $name, object OsidContext $context, object Properties $configuration)
  • string $name
  • object OsidContext $context
  • object Properties $configuration
stop (line 272)

Attempts to stop the service reference by $name.

boolean stop (string $name)
  • string $name: The service name.

Redefinition of:
ServicesInterface::stop()
Attempts to stop the service reference by $name.
stopAll (line 131)

Attempts to stop all running services.

void stopAll ()

Redefinition of:
ServicesInterface::stopAll()
Attempts to stop all running services.
_getBacktrace (line 46)
  • return: Returns a backtrace string to prepend onto error messages.
array _getBacktrace ()
_getServiceName (line 337)

Get service name. Gets the name of a service or its alias.

  • since: 3/24/05
  • access: public
string _getServiceName (string $name)
  • string $name
__sleep (line 325)

Stops all the services -- used internally by PHP.

  • access: private
void __sleep ()

Inherited Methods

Inherited From ServicesAbstract

ServicesAbstract::createServiceAlias()
ServicesAbstract::getService()
ServicesAbstract::getServices()
ServicesAbstract::registerObjectAsService()
ServicesAbstract::registerService()
ServicesAbstract::requireService()
ServicesAbstract::restartService()
ServicesAbstract::serviceAvailable()
ServicesAbstract::serviceRunning()
ServicesAbstract::startAllServices()
ServicesAbstract::startManagerAsService()
ServicesAbstract::startService()
ServicesAbstract::stopAllServices()
ServicesAbstract::stopService()

Inherited From ServicesInterface

ServicesInterface::available()
ServicesInterface::get()
ServicesInterface::getService()
ServicesInterface::getServices()
ServicesInterface::register()
ServicesInterface::registerObject()
ServicesInterface::registerObjectAsService()
ServicesInterface::registerService()
ServicesInterface::requireService()
ServicesInterface::restart()
ServicesInterface::restartService()
ServicesInterface::running()
ServicesInterface::serviceAvailable()
ServicesInterface::serviceRunning()
ServicesInterface::start()
ServicesInterface::startAll()
ServicesInterface::startAllServices()
ServicesInterface::startService()
ServicesInterface::stop()
ServicesInterface::stopAll()
ServicesInterface::stopAllServices()
ServicesInterface::stopService()

Documentation generated on Wed, 19 Sep 2007 10:26:26 -0400 by phpDocumentor 1.3.0RC3