Java Reference
In-Depth Information
L ISTING 6.5 An Example Of The BankServer Download Policies File
#—-Bank Server download Policies file—-
This property file states that regarding the “ client0 ”client application, whenever it issues
another CHECK command, the files listed at line 2 have to be sent to its cache when there are
versions newer than 1.0 (that is recorded as the currently installed one). The main class to be
launched the next time the application helper is executed is specified in line 5. This is quite a
simplistic and unrealistic approach to resolution (as described in Chapter 2). Nevertheless, it
gives a concrete idea of how servers could keep track of client-deployed configurations, allow-
ing for total control over client applications.
Now let's have a look at what new applications will look like. Given our implementation, all
old code still runs on our application helper (that is, the OldBankClient class in Listing 6.1)
while newly designed applications are more rationally organized in a service provider class,
BankClientManager (detailed in Listing 6.6) and various transaction-oriented classes as the
one shown in Listing 6.7.
L ISTING 6.6 The BankClientManager Class
import java.lang.reflect.Method;
import java.lang.reflect.Constructor;
* Chapter 6 - This class encapsulates business-related utility services
* @author Mauro Marinilli
* @version 1.0
public class BankClientManager {
private String[] arguments;
private Socket socket = null;
private DataOutputStream out = null;
private DataInputStream in = null;
Search WWH ::

Custom Search