Package chapters.mdc

Class NumberCruncherServer

  • All Implemented Interfaces:
    NumberCruncher, java.io.Serializable, java.rmi.Remote

    public class NumberCruncherServer
    extends java.rmi.server.UnicastRemoteObject
    implements NumberCruncher
    A simple NumberCruncher implementation that logs its progress when factoring numbers. The purpose of the whole exercise is to show the use of mapped diagnostic contexts in order to distinguish the log output from different client requests.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) static org.slf4j.Logger logger  
      private static long serialVersionUID  
      • Fields inherited from class java.rmi.server.RemoteObject

        ref
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void delay​(int millis)  
      int[] factor​(int number)
      Factor a positive integer number and return its distinct factor's as an integer array.
      static void main​(java.lang.String[] args)  
      (package private) static void usage​(java.lang.String msg)  
      • Methods inherited from class java.rmi.server.UnicastRemoteObject

        clone, exportObject, exportObject, exportObject, unexportObject
      • Methods inherited from class java.rmi.server.RemoteServer

        getClientHost, getLog, setLog
      • Methods inherited from class java.rmi.server.RemoteObject

        equals, getRef, hashCode, toString, toStub
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • logger

        static org.slf4j.Logger logger
    • Constructor Detail

      • NumberCruncherServer

        public NumberCruncherServer()
                             throws java.rmi.RemoteException
        Throws:
        java.rmi.RemoteException
    • Method Detail

      • factor

        public int[] factor​(int number)
                     throws java.rmi.RemoteException
        Description copied from interface: NumberCruncher
        Factor a positive integer number and return its distinct factor's as an integer array.
        Specified by:
        factor in interface NumberCruncher
        Throws:
        java.rmi.RemoteException
      • usage

        static void usage​(java.lang.String msg)
      • delay

        public static void delay​(int millis)
      • main

        public static void main​(java.lang.String[] args)