Thread::Apartment::Container

SUMMARY: CONSTR | METHOD | DETAIL: CONSTR | METHOD

## Class Thread::Apartment::Container

Inherits from:
  Thread::Queue::Queueable

Provides a non-threads::shared container proxy class for installed objects.

Licensed under the Academic Free License version 2.1, as specified in the License.txt file included in this software package, or at OpenSource.org.

Author:
  D. Arnold
Version:
  0.50
Since:
  2005-12-01

Unless otherwise noted, `$self` is the object instance variable.

Constructor Summary
`new($id, $tac)` Creates a container for an object's ID and TAC

Method Summary
`can($method)` Overload UNIVERSAL::can() to test the available methods of the proxied object
`curse()` Overrides TQQ curse() to return the contained TAC
`debug($level)` Set debug level
`get_queue()` Return the TQD for the proxied object
`get_timeout()` Return current TQD timeout
`isa($class)` Overload UNIVERSAL::isa() to test the class hierarchy of the proxied object
`join()` Wait for the proxied object's apartment thread to exit
`onEnqueue()` Overrides TQQ onEnqueue() to curse() the contained TAC
`run()` Invoke thread governor for installed MuxServer objects
`set_timeout($timeout)` Set TQD timeout
`stop()` Stop the proxied object's apartment thread

Constructor Details

### new

    new($id, $tac)

  Creates a container for an object's ID and TAC.

  Parameters:
    `$id` - ID of proxied object
    `$tac` - TAC of proxied object
  Returns:
    Thread::Apartment::Container object

Method Details

### can

    can($method)

  Overload UNIVERSAL::can() to test the available methods of the proxied object.

  Parameters:
    `$method` - method to check if implemented by the proxied object
  Returns:
    if the proxied object exports $method (or exports AUTOLOAD), the can() result of the proxied object.

### curse

    curse()

  Overrides TQQ curse() to return the contained TAC.

  Returns:
    contained TAC

### debug

    debug($level)

  Set debug level. When set to a "true" value, causes the TAC to emit diagnostic information.

  Parameters:
    `$level` - debug level. zero or undef turns off debugging; all other values enable debugging
  Returns:
    the new level

### get_queue

    get_queue()

  Return the TQD for the proxied object.

  Returns:
    TQD object

### get_timeout

    get_timeout()

  Return current TQD timeout

  Returns:
    TQD timeout in seconds

### isa

    isa($class)

  Overload UNIVERSAL::isa() to test the class hierarchy of the proxied object.

  Parameters:
    `$class` - class to check if implemented by the proxied object
  Returns:
    1 if the proxied object implements $class; undef otherwise

### join

    join()

  Wait for the proxied object's apartment thread to exit.

  Returns:
    1

### onEnqueue

    onEnqueue()

  Overrides TQQ onEnqueue() to curse() the contained TAC.

  Returns:
    ((contained TAC class, contained TAC) )

### run

    run()

  Invoke thread governor for installed MuxServer objects. Note that this method will not return until the proxied object exits the apartment thread.

  Returns:
    1

### set_timeout

    set_timeout($timeout)

  Set TQD timeout

  Parameters:
    `$timeout` - max. number of seconds to wait for TQD responses.
  Returns:
    previous timeout value

### stop

    stop()

  Stop the proxied object's apartment thread.

  Note that this is only useful after an object has been installed, but before its run() method has been called.

Generated by psichedoc on Mon Mar 27 08:51:36 2006