Java/C++ eExceptions and Message Logging Language-independent exception definition/handling and general message logging. (Adventures in Middleware) Ron.

Slides:



Advertisements
Similar presentations
Chapter 17 Failures and exceptions. This chapter discusses n Failure. n The meaning of system failure. n Causes of failure. n Handling failure. n Exception.
Advertisements

COM vs. CORBA.
Yoshi
Exception Handling. Background In a perfect world, users would never enter data in the wrong form, files they choose to open would always exist, and code.
Exceptions Don’t Frustrate Your User – Handle Errors KR – CS 1401 Spring 2005 Picture – sysprog.net.
Java Card Technology Ch06: Exception and Exception Handling Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Computer.
Exceptions1 Syntax, semantics, and pragmatics. Exceptions2 Syntax, semantics, pragmatics Syntax –How it looks, i.e. how we have to program to satisfy.
EXCEPTIONS. What’s an exception?? Change the flow of control when something important happens ideally - we catch errors at compile time doesn’t happen.
Exceptions1 Syntax, semantics, and pragmatics. Exceptions2 Syntax, semantics, pragmatics Syntax –How it looks, i.e. how we have to program to satisfy.
Java Exceptions. Types of exceptions  Checked exceptions: A checked exception is an exception that is typically a user error or a problem that cannot.
Java/C++ Exceptions and Message Logging Language-independent exception definition/handling and general message logging. (Adventures in Middleware) Ron.
Exception Handling.  What are errors?  What does exception handling allow us to do?  Where are exceptions handled?  What does exception handling facilitate?
1 Frameworks. 2 Framework Set of cooperating classes/interfaces –Structure essential mechanisms of a problem domain –Programmer can extend framework classes,
Remote Method Invocation Chin-Chih Chang. Java Remote Object Invocation In Java, the object is serialized before being passed as a parameter to an RMI.
CORBA Case Study By Jeffrey Oliver March March 17, 2003CORBA Case Study by J. T. Oliver2 History The CORBA (Common Object Request Broker Architecture)
Exceptions Used to signal errors or unexpected situations to calling code Should not be used for problems that can be dealt with reasonably within local.
C#.NET C# language. C# A modern, general-purpose object-oriented language Part of the.NET family of languages ECMA standard Based on C and C++
Java Exceptions. Intro to Exceptions  What are exceptions? –Events that occur during the execution of a program that interrupt the normal flow of control.
Scripting Languages For Virtual Worlds. Outline Necessary Features Classes, Prototypes, and Mixins Static vs. Dynamic Typing Concurrency Versioning Distribution.
II. Middleware for Distributed Systems
Copyright © Stanford Linear Accelerator Center 2002 All rights reserved Copyright © Stanford Linear Accelerator Center 2002 All rights reserved Accelerator.
Java Exceptions. Intro to Exceptions  What are exceptions? –Events that occur during the execution of a program that interrupt the normal flow of control.
G51FSE Version Control Naisan Benatar. Lecture 5 - Version Control 2 On today’s menu... The problems with lots of code and lots of people Version control.
Exceptions. Many problems in code are handled when the code is compiled, but not all Some are impossible to catch before the program is run  Must run.
1 Web Based Programming Section 6 James King 12 August 2003.
Common Object Request Broker Architecture (CORBA) CS-328.
1 Exceptions and error handling. 2 Java exception mechanism when an error or exceptional condition occurs, you throw an exception which is caught by an.
Exception Handling in Java Exception Handling Introduction: After completing this chapter, you will be able to comprehend the nature and kinds.
COMPUTER PROGRAMMING 2 Exceptions. What are Exceptions? Unexpected events that happen when the code is executing (during runtime). Exceptions are types.
COM vs. CORBA Computer Science at Azusa Pacific University September 19, 2015 Azusa Pacific University, Azusa, CA 91702, Tel: (800) Department.
ACS Error System Using it in JAVA Sohaila Lucero NRAO.
Remote Procedure Call Andrew Whitaker CSE451. Remote Procedure Call RPC exposes a programming interface across machines: interface PriceService { Price.
Exceptions1 Syntax, semantics, and pragmatics. Exception create If (some error){ throw new SomeException(”some message”); } Exceptions2.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
1 Distributed Systems Distributed Objects & Remote Invocation II (CORBA VS DCOM) Dr. Sunny Jeong. With Thanks to.
Exceptions Handling Exceptionally Sticky Problems.
Jan Hatje, DESY CSS ITER March 2009: Technology and Interfaces XFEL The European X-Ray Laser Project X-Ray Free-Electron Laser 1 CSS – Control.
JSP Exception Handling 20-Oct-15. JSP - E XCEPTION H ANDLING When you are writing JSP code, a programmer may leave a coding errors which can occur at.
1 Cisco Unified Application Environment Developers Conference 2008© 2008 Cisco Systems, Inc. All rights reserved.Cisco Public Introduction to Etch Scott.
Abhishek Bachchan Vishal Patangia
ACS Error System APIs: C++ Bogdan Jeram European Southern Observatory July 2005ESO.
CSE 232: C++ debugging in Visual Studio and emacs C++ Debugging (in Visual Studio and emacs) We’ve looked at programs from a text-based mode –Shell commands.
Conveying Information to Users. Outline Types of information in GridChem Inconsistency = confusion Appropriate UI for different information types Examples.
Topic 1 Object Oriented Programming. 1-2 Objectives To review the concepts and terminology of object-oriented programming To discuss some features of.
Stacks The content for these slides was originally created by Gerard Harrison. Ported to C# by Mike Panitz.
Fall 2002CS 150: Intro. to Computing1 Streams and File I/O (That is, Input/Output) OR How you read data from files and write data to files.
Exceptions and Assertions Chapter 15 – CSCI 1302.
January 25, 2016 First experiences with CORBA Niko Neufeld.
DISTRIBUTED OBJECTS AND REMOTE INVOCATION 1. 2 Topics  Middleware  Remote Method Invocation  Remote Procedure Call.
Programming & Debugging. Key Programming Issues Modularity Modifiability Ease of Use Fail-safe programming Style Debugging.
1 Distributed Programming low level: sending data among distributed computations higher level: supporting invocations among distributed computations network.
JavaScript Introduction and Background. 2 Web languages Three formal languages HTML JavaScript CSS Three different tasks Document description Client-side.
Lecture10 Exception Handling Jaeki Song. Introduction Categories of errors –Compilation error The rules of language have not been followed –Runtime error.
And other languages…. must remember to check return value OR, must pass label/exception handler to every function Caller Function return status Caller.
Chapter 9: Continuing Classes By Matt Hirsch. Table Of Contents 1.Static Fields and Methods 2.Inheritance I. Recycle Code with Inheritance II. Overriding.
Exception testing Aistis Karkauskas, IFM-2/2. Introduction  Exceptions – anomalous or exceptional events requiring special processing – often changing.
Distributed Web Systems Distributed Objects and Remote Method Invocation Lecturer Department University.
Object Throwable ErrorException RuntimeException.
Stacks The content for these slides was originally created by Gerard Harrison. Ported to C# by Mike Panitz.
Handling Exceptionally Sticky Problems
Software Development Handing Errors and Creating Documentation
What is RMI? Remote Method Invocation
PHP / MySQL Introduction
Exceptions Problems in a Java program may cause exceptions or errors representing unusual or invalid processing. An exception is an object that defines.
Tango in a Nutshell 31/12/2018.
Java Exceptions Dan Fleck CS211.
Handling Exceptionally Sticky Problems
Nominal Technologies for Modelling and High Level Applications of LCLS
System Models Bina Ramamurthy 9/7/2019 B.Ramamurthy.
Presentation transcript:

Java/C++ eExceptions and Message Logging Language-independent exception definition/handling and general message logging. (Adventures in Middleware) Ron MacKenzie, Greg White

Why is this important? Highly distributed control system with thousands of instances of programs. Coherent and Reliable message logging is essential for keeping the system running. It is necessary to convey the context in which an exception was thrown in distributed multitiered environment. –Call Stack often lost (by serialization) –Layered application context needed. –Solution: Exception Chaining provides context.

Distributed Network

Features Language Independence (Java and C++) Define the exceptions that C++ and Java apps throw all in one place. Standard High level set of Exceptions (like DataNotFound). Corba IDL is used for exception definition Encapsulate details when exceptions occur. More details can be successively added while logging. Informational and Slow Speed Data logging are other uses in addition to exception logging. Corba Event Service is used for transport. IONA Orbacus is the ORB (distributed Objects++).

Data Flow Data Flow

Features (cont) Message logging will never block the application. Err.log is resilient. –If Err.log can’t connect to Event Service, message will simply be logged to stderr. –If Event Service is bounced, Err.log will reconnect on next log call.

ErrClient and Loggers ErrClient is a Corba Pull Consumer ErrClient and CmLogger are pure java. It is easy to plug in other logger classes.

ErrClient and Logger auto-reconnect. If the event service is down, ErrClient process reconnects automatically when the event service is brought back up. When the message destination (e.g. CMLOG) is down, the CmLogger process reconnects automatically when it is brought back up.

IDL Defined Structure Exception Transporter is a simple structure. Send it across the Event Service. #ifndef EXTRANS_IDL #define EXTRANS_IDL /** * IDL for exTrans. This is the Error Transporter object (structure). * 10-May-2003, Ronm. */ #pragma prefix "slac.stanford.edu" module err { struct ExceptionTransporter { string destination; // Which logger this msg is going to. string name; string suppl; long time; // IDL long is java int. string facility; string host; }; #endif

Part II Application Programmer’s Perspective Err and Except Classes

Except Class (definitions) All exceptions defined in one file –For example: except.idl –To add new exceptions Cvs checkout, add the exception, cvs commit Gmake Presto! Java and C++ include files created. –IDL Examples exception UnableToGetDataException {}; exception NameLookupException {}; exception MonitorStartupException {};

Using the Err class Include/Import –JAVA –import {java incl path}.except.*; // exceptions –import {java incl path}.err.*; // Err logger –C++ –#include "except.h" –#include "err.h"

Using the Err class (cont) Instantiate –JAVA –Err err("AIDA Magnet Server"); Instantiate with facility name –C++ –Err err("AIDA Magnet Server"); *Err is singleton design pattern

The Err class and exception chaining A logged exception consists of three strings which are concatenated to form the logged message – EXCEPTION_NAME + REASON STRING + SUPPLEMENTAL STRING new NoDataSourceException ("for PB60:LUMVAL"); err.log (ex, "while acquiring the Luminosity Value"); Logged Message: –"NoDataSourceException for PB60:LUMVAL while acquiring the Luminosity Value“ A form of Exception Chaining!

Using the Err class (cont) These exceptions are sub-classed from the Java Throwable class, so they are thrown and caught like other Java exceptions. try {... throw new NoDataSourceException("for PB60:LUMVAL"); } catch (Exception ex) { err.log(ex, "when attempting to acquire the Luminosity Value" ); } Logged Message: "NoDataSourceException for PB60:LUMVAL when attempting to acquire the Luminosity Value"

Using the Err class (cont) Err.log returns an exception, so you can log and throw an exception in one statement like this: throw err.log(new NoDataSourceException("for PB60:LUMVAL"), " when starting ca service");

Deliverables Requirements/Design document Programmer’s guide System Administrator’s guide Javadoc Test and Example programs All tied together on web page

Project Status Delivered and in production! AIDA Application (PEPII) currently using Err. Planning for LCLS applications to use Err. me to obtain the source

An outline the use of “Any” Exception Transporter struct defined in IDL –ExceptionTransporter et = new ExceptionTransporter (fill fields here); Push the Corba Any –Any any = orb.create_any(); –ExceptionTransporterHelper.insert(any, et); –pushMessage( any ); Pull the Corba Any –ExceptionTransporter et = new ExceptionTransporter(); –Any any = null; –any = supplier.pull(); –et = ExceptionTransporterHelper.extract(any);

Development Tools Formal internal review with action items tracked. Emacs, IDL Gmake (GNU) / Unix Dev Environment(UDE) Gdb (C++ debug) CVS, CVS-WEB UDE Process management (shell scripts / ssh).