Merge pull request #2306 from mitza-oci/warnings
[ACE_TAO.git] / TAO / orbsvcs / examples / Notify / MC / TkMonitor / monitor.pl
blobd9b990ffa731862328849c273d989df9235b7770
1 #!/usr/bin/env perl -w
3 # ************************************************************
4 # Description : Front end for the Notify Service Monitor
5 # Author : Chad Elliott
6 # Create Date : 7/17/2007
7 # ************************************************************
9 # ************************************************************
10 # Subroutine Section
11 # ************************************************************
13 sub BEGIN {
14 if (!defined $ENV{OPALORB_ROOT}) {
15 print STDERR "You must set the OPALORB_ROOT environment variable ",
16 "to the full path of opalORB.\n";
17 exit(1);
21 # ************************************************************
22 # Pragmas
23 # ************************************************************
25 use strict;
26 use FindBin;
27 use File::Spec;
28 use File::Basename;
30 use Tk;
32 use lib "$ENV{OPALORB_ROOT}";
33 use lib "$ENV{OPALORB_ROOT}/Naming";
34 use CORBA;
35 use CosNotification::NotificationServiceMonitorControl;
37 my($basePath) = $FindBin::Bin;
38 if ($^O eq 'VMS') {
39 $basePath = File::Spec->rel2abs(dirname($0)) if ($basePath eq '');
40 $basePath = VMS::Filespec::unixify($basePath);
42 unshift(@INC, $basePath . '/modules');
44 require MonitorControl;
46 # ************************************************************
47 # Main Section
48 # ************************************************************
50 try {
51 my($orb) = CORBA::ORB_init(\@ARGV);
53 my($loc) = 'corbaname:rir:#TAO_MonitorAndControl';
54 $loc = $ARGV[0] if (defined $ARGV[0]);
56 my($monitor) = new MonitorControl($orb, $loc);
57 $monitor->Show();
59 catch CORBA::SystemException with {
60 my($ex) = shift;
61 print STDERR "$ex\n";
63 catch Error::Simple with {
64 my($ex) = shift;
65 print STDERR "Exception: $ex\n";