Class ServicesAbstract

Description

The ServicesAbstract class defines the public static methods used by users.

  • version: $Id: Services.abstract.php,v 1.15 2007/09/04 20:25:49 adamfranco Exp $
  • license: GNU General Public License (GPL)
  • copyright: Copyright © 2005, Middlebury College
  • static:

Located in /harmoni/core/services/Services.abstract.php (line 18)

ServicesInterface
   |
   --ServicesAbstract
Direct descendents
Class Description
Services The Services class handles starting, stopping, registering, etc of any available services.
Method Summary
void createServiceAlias (string $name1, string $name2)
object Object getService (string $name)
void registerObjectAsService (string $name, ref $object)
boolean registerService (string $name, string $class)
ref requireService (mixed $service, [boolean $start = true], string $name)
boolean restartService (string $name)
boolean serviceAvailable (string $name)
boolean serviceRunning (string $name)
boolean startManagerAsService (string $name, object OsidContext $context, object Properties $configuration)
boolean startService (string $name, [optional $args = null])
void stopAllServices ()
boolean stopService (string $name)
Methods
createServiceAlias (line 53)

Create an alias from one service name to another.

  • since: 3/24/05
  • access: public
void createServiceAlias (string $name1, string $name2)
  • string $name1
  • string $name2
getService (line 74)

Returns the service object associated with reference name $name.

  • return: The service object.
  • static:
  • access: public
object Object getService (string $name)
  • string $name: The reference name of the service.

Redefinition of:
ServicesInterface::getService()
Returns the service object associated with reference name $name.
getServices (line 63)

Returns the services object.

  • return: The Services object.
  • static:
  • access: public
object Services getServices ()

Redefinition of:
ServicesInterface::getServices()
Returns the services object.
registerObjectAsService (line 40)

Register's an object as a service.

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

Redefinition of:
ServicesInterface::registerObjectAsService()
Register's an object as a service.
registerService (line 29)

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.
  • static:
  • access: public
boolean registerService (string $name, string $class)
  • string $name: The reference name of the service.
  • string $class: The class name to be instantiated.

Redefinition of:
ServicesInterface::registerService()
Registers a new service.
requireService (line 219)

The Require Service function checks for required service availability.

The function first checks for service availabilty, and then attempts to start the service if it's available. If either action fails, it stops script execution. If $start=false then the function will only check for availability.

ref requireService (mixed $service, [boolean $start = true], string $name)
  • string $name: The name of the service.
  • boolean $start: If we should attempt to start the service or not.

Redefinition of:
ServicesInterface::requireService()
The Require Service function checks for required service availability.
restartService (line 175)

Attempts to restart the service reference by $name.

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

Redefinition of:
ServicesInterface::restartService()
Attempts to restart the service reference by $name.
serviceAvailable (line 190)

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

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

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

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

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

Redefinition of:
ServicesInterface::serviceRunning()
Checks if the service referenced by $name has been started.
startAllServices (line 130)

Cycles through all registered services and attempts to start them.

void startAllServices ()

Redefinition of:
ServicesInterface::startAllServices()
Cycles through all registered services and attempts to start them.
startManagerAsService (line 119)

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 startManagerAsService (string $name, object OsidContext $context, object Properties $configuration)
  • string $name
  • object OsidContext $context
  • object Properties $configuration
startService (line 87)

Attempts to start the service referenced by $name.

boolean startService (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::startService()
Attempts to start the service referenced by $name.
stopAllServices (line 160)

Attempts to stop all running services.

void stopAllServices ()

Redefinition of:
ServicesInterface::stopAllServices()
Attempts to stop all running services.
stopService (line 147)

Attempts to stop the service reference by $name.

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

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

Inherited Methods

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:24 -0400 by phpDocumentor 1.3.0RC3