All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.beans.tools.SerLauncher

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----java.applet.Applet
                                   |
                                   +----com.ibm.beans.tools.SerLauncher

public class SerLauncher
extends Applet
implements Serializable
The SerLauncher utility is a simple launcher for serialized beans. Its primary function is to load serialized beans from within a web browser that does not natively know how to launch .ser files. To do so, in the applet tag, specify code=com.ibm.beans.tools.SerLauncher, and specify the name of the .ser file in a param name=SerFile value=x.ser statement in the applet tag.

This utility can also be used as a stand-alone .ser file viewer, by issuing the command java com.ibm.beans.tools.SerLauncher x.ser (the .ser extension is optional).


Constructor Index

 o SerLauncher()
Constructs a new SerLauncher bean, initializing the serName property to null.
 o SerLauncher(String)
Constructs a new SerLauncher bean, initializing the serName property to newSerName.

Method Index

 o getPreferredSize()
Returns the preferredSize property of the embedded component.
 o getSerName()
Retrieves the serName property.
 o init()
Initializes the SerLauncher.
 o main(String[])
Invokes the SerLauncher as a stand-alone application.
 o setSerName(String)
Sets the serName property.
 o start()
Starts the SerLauncher, by deserializing and embedding the serialized component specified by the serName property.

Constructors

 o SerLauncher
 public SerLauncher()
Constructs a new SerLauncher bean, initializing the serName property to null. This is the version of the constructor that will be used when running as an applet. In this case, the serName property will be set when the init() method of this applet is invoked.

See Also:
init
 o SerLauncher
 public SerLauncher(String newSerName)
Constructs a new SerLauncher bean, initializing the serName property to newSerName. This is the version of the constructor that will be used when running as a stand-alone application.

Parameters:
newSerName - The inital value for the serName property.
See Also:
setSerName

Methods

 o init
 public void init()
Initializes the SerLauncher. This method will only be called when the SerLauncher is running as an applet. It will set the serName property to the value returned by getParameter("SerFile").

Overrides:
init in class Applet
See Also:
setSerName
 o start
 public void start()
Starts the SerLauncher, by deserializing and embedding the serialized component specified by the serName property. This method uses the Beans.instantiate() method to deserialize the specified component, casts the returned object to a java.awt.Component, and then invokes the add() method to embed it.

Overrides:
start in class Applet
 o getPreferredSize
 public Dimension getPreferredSize()
Returns the preferredSize property of the embedded component. By overriding this method, the SerLauncher will cause itself to be the same size as its embedded component.

Returns:
A Dimension object containing the preferred width and height.
Overrides:
getPreferredSize in class Container
 o getSerName
 public String getSerName()
Retrieves the serName property.

Returns:
The value of the serName property.
 o setSerName
 public void setSerName(String newSerName)
Sets the serName property. If newSerName has a ".ser" extension, then the extension will be removed; Beans.Instantiate() requires the extension to be absent. If the SerLauncher already contains a deserialized component, then it will be removed, and the start() method will be called again to load and embed the new bean.

Parameters:
newSerName - The new value for the serName property.
See Also:
start
 o main
 public static void main(String argv[])
Invokes the SerLauncher as a stand-alone application. The serialized component to be launched is specified as a parameter.

Parameters:
argv - An array of parameters used to invoke the SerLauncher. This application accepts a single argument, which specifies the location of the .ser file to be loaded. The classpath is searched for the specified .ser file. If the .ser file is package-qualified, then it will look for the .ser file in a directory corresponding to the package name. For instance, if com.ibm.beans.demo.TravelDemo is specified, then a file named TravelDemo.ser in a directory named com/ibm/beans/demo will be launched. This same logic is applied to the SerFile parameter used when the SerLauncher is run as an applet.

All Packages  Class Hierarchy  This Package  Previous  Next  Index