The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Solaris::ProcessContract::Contract - Manage a Solaris process contract instance via libcontract

SYNOPSIS

  # Get the latest contract created in the scope of our process
  my $contract = $pc->get_latest_contract();
  
  # Get the id of this contract
  print $contract->id();

  # Abandon the process contract
  $contract->control->abandon();

  # Adopt the process contract
  $contract->control->adopt();

DESCRIPTION

This class allows you to query and control a specific solaris process contract.

METHODS

new

Use the "get_contract" in Solaris::ProcessContract or "get_latest_contract" in Solaris::ProcessContract methods to create a new instance of this object instead of calling this yourself.

  # Get the most recently created contract in the scope of our process
  my $contract = $pc->get_latest_contract();
  
  # Get a specific contract by id, if we have permission to do so
  my $contract = $pc->get_contract( 12345 );

id

Arguments: none

Returns: $id

Returns the id of this contract.

  print $contract->id();

control

Arguments: none

Returns: $control

Provides access to the Solaris::ProcessContract::Contract::Control object for this contract.

  # Access the control object the easy way
  $contract->control->abandon();

  # Access the control object by reference
  my $control = $contract->control();
  $control->abandon();

This allows you to use the libcontract control functions to make changes to this contract.

SEE ALSO

Solaris::ProcessContract
Solaris::ProcessContract::Contract::Control
Solaris::ProcessContract::Exceptions
libcontract(3)
contract(4)
process(4)

AUTHOR

Danny Warren