SDSU CS 580 Client-Server Programming
Fall Semester, 2000
Concurrent Server Issues
Previous    Lecture Notes Index    Next    
© 2000, All Rights Reserved, SDSU & Roger Whitney
San Diego State University -- This page last updated 02-Oct-00

Contents of Doc 10, Concurrent Server Issues


References

Client-Server Software Testing on the Desktop and the Web, Mosley, Prentice Hall, 2000

Previous SDSU Client-Server Programming lecture notes

SDSU Java library


Doc 10, Concurrent Server Issues Slide # 2

Concurrent Server Issues


Issues:



Doc 10, Concurrent Server Issues Slide # 3

Separation of Responsibilities


Decompose server into parts

Separate parts:


Testing


Testing is important because:





Some testers claim client-server projects require one tester per programmer


Doc 10, Concurrent Server Issues Slide # 4

Why logging?




What should be logged?

Normally a log entry contains several pieces of information:



How should clients and servers log?

Basic choices:



Doc 10, Concurrent Server Issues Slide # 5
Simple appending problems

This simplistic approach can cause problems with the following:


Some solutions:



Doc 10, Concurrent Server Issues Slide # 6
SDSU Logger

import sdsu.logging.*;
public class LoggingExample
   {
   public static void main(String[] args ) throws LoggerCreationException {
      FileLogger.register( "MyLog");
      LoggingExample test = new LoggingExample();
      test.bar();
      test.foo();
   }
   
   public void foo() {
      Logger.log( "foo called");
   }
   
   public void bar(){
      try {
         Logger.log( "bar called");
         int a = 1;
         int b = 0;
         int c = a/b;
      }
      catch (Exception error ) {
         Logger.error( "Error in bar");
         Logger.error( error);
      }
   }
}
MyLog.log contents
time='2:47:57 PM';date=10/2/00;type=Log;message='bar called';
time='2:47:57 PM';date=10/2/00;type=Error;message='Error in bar';
time='2:47:57 PM';date=10/2/00;type=Error;message='java.lang.ArithmeticException: / by zero';
time='2:47:57 PM';date=10/2/00;type=Log;message='foo called';

Doc 10, Concurrent Server Issues Slide # 7
Types of Loggers

FileLogger - Sends log messages to file
NullLogger - Ignores log messages
ScreenLogger - Sends log messages to screen

SelectiveLogger - allows you to turn off types of messages


Types of Log messages

debug
error
log
warning


Debug Class

Allows debug states to be turned off/on

Debug messages contain line number if JIT is off

Output can be sent to file or screen

Doc 10, Concurrent Server Issues Slide # 8

Configuration


Servers are complex

Difference sites/customers require different settings

Commercial clients and servers are configurable


Error Handling


Servers should not crash or stop operating


Thread Management


Maintain a pool of thread to handle

Several ways to hand set of threads:



Copyright ©, All rights reserved.
2000 SDSU & Roger Whitney, 5500 Campanile Drive, San Diego, CA 92182-7700 USA.
OpenContent license defines the copyright on this document.

Previous    visitors since 02-Oct-00    Next