net.agmodel.applet
Class ParameterManager

java.lang.Object
  |
  +--net.agmodel.applet.ParameterManager

public class ParameterManager
extends Object

Configures one or more ServerBeans using parameters passed to an applet and supports applet.getParameterInfo()


Constructor Summary
ParameterManager(Applet anApplet)
          Create a parameter manager for use within an applet.
 
Method Summary
(package private) static void configureServerBean(ServerBean bean, String RMIhost, String HTTPhost, int HTTPport)
          A convenience method allowing an application to set a ServerBean's RMI and HTTP parameters.
 String[][] getParameterInfo()
          Returns a list of parameter details in a form suitable to use with Applet.getParamInfo().
 void parameterizeServerBean(ServerBean bean, String defaultRMIhost, String defaultHTTPhost, int defaultHTTPport)
          Sets a ServerBean's RMI and HTTP parameters by looking for corresponding applet parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParameterManager

public ParameterManager(Applet anApplet)
Create a parameter manager for use within an applet.
One parameter manager can be used for multiple server beans.

Parameters:
anApplet - a reference back to the parent applet used to get parameter values.
Method Detail

getParameterInfo

public String[][] getParameterInfo()
Returns a list of parameter details in a form suitable to use with Applet.getParamInfo().

Returns:
an array with one row for each parameter.

parameterizeServerBean

public void parameterizeServerBean(ServerBean bean,
                                   String defaultRMIhost,
                                   String defaultHTTPhost,
                                   int defaultHTTPport)
Sets a ServerBean's RMI and HTTP parameters by looking for corresponding applet parameters.
The bean methods getRMIHostParamName(), getHTTPHostParamName(), getHTTPPortParamName() provide the applet parameter names.
Adds a reference to the bean to a set which is used to support getParameterInfo().
Only uses the method parameters defaultXXX below if it can't find the appropriate applet parameter.

Parameters:
bean - the bean whose RMI and HTTP settings will be configured.
defaultRMIhost - default server to use when an RMI host parameter value isn't found
defaultHTTPhost - default wrapper servlet host to use when an HTTP host parameter value isn't found
defaultHTTPport - default port to use (usually 80 for web server, 8080 for servlet container)

configureServerBean

static void configureServerBean(ServerBean bean,
                                String RMIhost,
                                String HTTPhost,
                                int HTTPport)
A convenience method allowing an application to set a ServerBean's RMI and HTTP parameters. See parameterizeServerBean() for a more useful method for applets.

Parameters:
bean - the bean whose RMI and HTTP settings will be configured.
RMIhost - the RMI server to use
HTTPhost - the HTTP server (wrapper servlet machine) to use if direct RMI connections are not available
HTTPport - the HTTP port to use (usually 80 for web server, 8080 for servlet container)