Package chapters.mdc
Class NumberCruncherServer
- java.lang.Object
-
- java.rmi.server.RemoteObject
-
- java.rmi.server.RemoteServer
-
- java.rmi.server.UnicastRemoteObject
-
- chapters.mdc.NumberCruncherServer
-
- All Implemented Interfaces:
NumberCruncher
,Serializable
,Remote
public class NumberCruncherServer extends 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 inherited from class java.rmi.server.RemoteObject
ref
-
-
Constructor Summary
Constructors Constructor Description NumberCruncherServer()
-
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 integernumber
and return its distinct factor's as an integer array.static void
main(String[] args)
-
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
-
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
-
-
-
-
Constructor Detail
-
NumberCruncherServer
public NumberCruncherServer() throws RemoteException
- Throws:
RemoteException
-
-
Method Detail
-
factor
public int[] factor(int number) throws RemoteException
Description copied from interface:NumberCruncher
Factor a positive integernumber
and return its distinct factor's as an integer array.- Specified by:
factor
in interfaceNumberCruncher
- Throws:
RemoteException
-
delay
public static void delay(int millis)
-
main
public static void main(String[] args)
-
-