Writing a client program to use COS Naming

The following example shows a client program, Gambler.java, that works with the RouletteWheel bean developed in Coding a session bean. When a bean reference is obtained from a COS Naming namespace, there are a number of operations that must be performed before the client can use that reference. These operations are the same for the majority of client programs, so they are collected in the utility class EJBUtils. This utility class is used by the client program Gambler.