summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/examples/Notify/MC/TkMonitor/monitor.pl
blob: e0e6dceed43ba19d54455afb8dbaf344f7a187b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/perl -w

# ************************************************************
# Description   : Front end for the Notify Service Monitor
# Author        : Chad Elliott
# Create Date   : 7/17/2007
# ************************************************************

# ************************************************************
# Subroutine Section
# ************************************************************

sub BEGIN {
  if (!defined $ENV{OPALORB_ROOT}) {
    print STDERR "You must set the OPALORB_ROOT environment variable ",
                 "to the full path of opalORB.\n";
    exit(1);
  }
}

# ************************************************************
# Pragmas
# ************************************************************

use strict;
use FindBin;
use File::Spec;
use File::Basename;

use Tk;

use lib "$ENV{OPALORB_ROOT}";
use lib "$ENV{OPALORB_ROOT}/Naming";
use CORBA;
use CosNotification::NotificationServiceMonitorControl;

my($basePath) = $FindBin::Bin;
if ($^O eq 'VMS') {
  $basePath = File::Spec->rel2abs(dirname($0)) if ($basePath eq '');
  $basePath = VMS::Filespec::unixify($basePath);
}
unshift(@INC, $basePath . '/modules');

require MonitorControl;

# ************************************************************
# Main Section
# ************************************************************

try {
  my($orb) = CORBA::ORB_init(\@ARGV);

  my($loc) = 'corbaname:rir:#TAO_MonitorAndControl';
  $loc = $ARGV[0] if (defined $ARGV[0]);

  my($monitor) = new MonitorControl($orb, $loc);
  $monitor->Show();
}
catch CORBA::SystemException with {
  my($ex) = shift;
  print STDERR "$ex\n";
}
catch Error::Simple with {
  my($ex) = shift;
  print STDERR "Exception: $ex\n";
};