Class ServicesInterface

Description

The ServicesInterface defines the functionality required by any Services class or derivative.

The ServicesInterface defines the functionality required by any Services class or derivative.

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

Located in /harmoni/core/services/Services.interface.php (line 14)


	
			
Direct descendents
Class Description
ServicesAbstract The ServicesAbstract class defines the public static methods used by users.
Method Summary
boolean available (string $name)
object Object get (string $name)
object Object getService (string $name)
boolean register (string $name, string $class)
void registerObject (string $name, ref $object)
void registerObjectAsService (string $name, ref $object)
boolean registerService (string $name, string $class)
ref requireService (mixed $service, [boolean $start = true], string $name)
boolean restart (string $name)
boolean restartService (string $name)
boolean running (string $name)
boolean serviceAvailable (string $name)
boolean serviceRunning (string $name)
boolean start (string $name, [optional $args = null])
void startAll ()
boolean startService (string $name, [optional $args = null])
boolean stop (string $name)
void stopAll ()
void stopAllServices ()
boolean stopService (string $name)
Methods
available (line 230)

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

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.

Redefined in descendants as:
get (line 175)

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 get (string $name)
  • string $name: The reference name of the service.

Redefined in descendants as:
  • Services::get() : Returns the service object associated with reference name $name.
getService (line 56)

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.

Redefined in descendants as:
getServices (line 47)

Returns the services object.

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

Redefined in descendants as:
register (line 154)

Registers a new service.

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.

Redefined in descendants as:
  • Services::register() : Registers a new service named $name. Upon starting, a new class of type $class will be instantiated.
registerObject (line 163)

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.

Redefined in descendants as:
registerObjectAsService (line 36)

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.

Redefined in descendants as:
registerService (line 27)

Registers a new service.

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.

Redefined in descendants as:
requireService (line 138)

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.

  • return: object The started service object.
  • deprecated: 2004/07/28 Use startService() and getService() instead.
  • static:
  • access: public
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.

Redefined in descendants as:
restart (line 221)

Attempts to restart the service reference by $name.

Attempts to restart the service reference by $name.

  • return: True on success.
  • access: public
boolean restart (string $name)
  • string $name: The service name.

Redefined in descendants as:
restartService (line 104)

Attempts to restart the service reference by $name.

  • return: True on success.
  • static:
  • access: public
boolean restartService (string $name)
  • string $name: The service name.

Redefined in descendants as:
running (line 239)

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

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.

Redefined in descendants as:
serviceAvailable (line 113)

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.

Redefined in descendants as:
serviceRunning (line 122)

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.

Redefined in descendants as:
start (line 194)

Attempts to start the service referenced by $name.

Attempts to start the service referenced by $name.

  • return: True on success.
  • access: public
boolean start (string $name, [optional $args = null])
  • string $name: The service name.
  • optional $args: mixed $args,... Optional args to pass to the constructor of the service class.

Redefined in descendants as:
startAll (line 201)

Cycles through all registered services and attempts to start them.

  • access: public
void startAll ()

Redefined in descendants as:
startAllServices (line 74)

Cycles through all registered services and attempts to start them.

  • access: public
  • static:
void startAllServices ()

Redefined in descendants as:
startService (line 66)

Attempts to start the service referenced by $name.

  • return: True on success.
  • static:
  • access: public
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.

Redefined in descendants as:
stop (line 212)

Attempts to stop the service reference by $name.

Attempts to stop the service reference by $name.

  • return: True on success.
  • access: public
boolean stop (string $name)
  • string $name: The service name.

Redefined in descendants as:
stopAll (line 182)

Attempts to stop all running services.

  • access: public
void stopAll ()

Redefined in descendants as:
stopAllServices (line 92)

Attempts to stop all running services.

  • access: public
void stopAllServices ()

Redefined in descendants as:
stopService (line 85)

Attempts to stop the service reference by $name.

  • return: True on success.
  • static:
  • access: public
boolean stopService (string $name)
  • string $name: The service name.

Redefined in descendants as:

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