# System.pm: Class Used to Interface the Operating System package RDA::Target::System; # $Id: System.pm,v 1.8 2015/05/05 13:08:42 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/RDA/Target/System.pm,v 1.8 2015/05/05 13:08:42 RDA Exp $ # # Change History # 20150505 MSC Improve the documentation. =head1 NAME RDA::Target::System - Class Used to Interface the Operating System =head1 SYNOPSIS require RDA::Target::System; =head1 DESCRIPTION The objects of the C class are used to interface with the operating system. It is a subclass of L. The following methods are available: =cut use strict; BEGIN { use Exporter; use RDA::Text qw(get_string); use RDA::Object; use RDA::Object::Rda; use RDA::Object::Target; } # Define the global public variables use vars qw($STRINGS $VERSION @DUMP @ISA %SDCL); $VERSION = sprintf('%d.%02d', q$Revision: 1.8 $ =~ /(\d+)\.(\d+)/); @DUMP = ( hsh => {'RDA::Target::Base' => 1, 'RDA::Target::Common' => 1, 'RDA::Target::Database' => 1, 'RDA::Target::Db' => 1, 'RDA::Target::Dbi' => 1, 'RDA::Target::Domain' => 1, 'RDA::Target::Home' => 1, 'RDA::Target::Instance' => 1, 'RDA::Target::MwHome' => 1, 'RDA::Target::System' => 1, 'RDA::Target::WlHome' => 1, }, ); @ISA = qw(RDA::Object::Target RDA::Object Exporter); %SDCL = ( inc => [qw(RDA::Object::Target RDA::Object)], ); # Define the global private constants # Define the global private variables # Report the package version sub Version { return $VERSION; } =head2 S<$h = RDA::Target::System-Enew($oid,$col,$def,$par[,$edt])> The object constructor. It takes the object identifier, the collector object reference, the definition item reference, the parent target reference, and an optional initial attribute hash reference as arguments. Do not use this constructor directly. Create all targets using L methods. C is represented by a blessed hash reference. The following special keys are used: =over 12 =item S< B<'col' > > Reference to the collector object =item S< B<'oid' > > Object identifier =item S< B<'par' > > Reference to the parent target =item S< B<'_abr'> > Symbol definition hash =item S< B<'_bkp'> > Backup of environment variables =item S< B<'_chg'> > Symbol change hash =item S< B<'_chl'> > List of the child keys =item S< B<'_def'> > Reference to the target definition item =item S< B<'_dft'> > Default indicator =item S< B<'_env'> > Environment specifications =item S< B<'_prs'> > Symbol detection parse tree =item S< B<'_shr'> > Share indicator =item S< B<'_typ'> > Target type =back Internal keys are prefixed by an underscore. =cut sub new { my ($cls, $oid, $col, $def, $par, $edt) = @_; my ($key, $slf, $sys, $val); # Create the system object $slf = bless { col => $col, oid => $par->get_unique($oid), par => $par, _chl => [], _def => $def, _dft => $def->get_first('B_DEFAULT'), _env => {}, _shr => $def->get_first(['B_DEDICATED_SYSTEM','B_DEDICATED']) ? 0 : 1, _typ => 'SYS', }, ref($cls) || $cls; # Add the initial attributes if ($edt) { foreach my $key (keys(%{$edt})) { $slf->{$key} = $edt->{$key}; } } # Perform extra initialization unless (RDA::Object::Rda->is_vms) { # Create a default environment if ($slf->{'_dft'}) { $val = RDA::Object::Rda->get_separator; $sys = $slf->get_top('sys'); $slf->{'_env'}->{'PATH'} = join($val, $sys->get_list('pth')); $slf->{'_env'}->{$key} = join($val, $sys->get_list('shl')) if defined($key = RDA::Object::Rda->get_shlib); } # Initiate the symbol management when applicable $slf->{'_abr'} = {}; } # Return the object reference return $slf; } =head2 S<$h-Eget_env> This method returns the environment variable specifications as a hash reference. =cut sub get_env { return shift->{'_env'}; } 1; __END__ =head1 SEE ALSO L, L, L, L, L, L, L, L =head1 COPYRIGHT NOTICE Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. =head1 TRADEMARK NOTICE Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. =cut