All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.wizards.core.GenericWizardState

java.lang.Object
   |
   +----com.sun.wizards.core.GenericWizardState

public class GenericWizardState
extends Object
implements WizardState
GenericWizardState is responsible for maintaining data on the server side, and serving WizardTreeManager requests. This class is the core of the wizard server side.


Constructor Index

 o GenericWizardState()
Creates a GenericWizardState that will not instantiate a graphical user interface.
 o GenericWizardState(ArchiveReader, Boolean)
At runtime, the GenericWizardState will be instantiated with an ArchiveReader.

Method Index

 o addChild(String)
Add a child description to the wizard archive.
 o addChildObject(String, ServerObject)
Add a child object to this WizardState.
 o addSequence(String, Sequence)
Add a named sequence of server-side tasks to the WizardState.
 o callClientObjectMethod(Route, String, String[], Object[])
Call a method on the client.
 o callServerObjectMethod(Route, String, String[], Object[])
Call a method on the server.
 o cancelSequence()
Cancel the sequence that is currently being performed or reversed.
 o cleanup(WizardState)
This method is called before exiting to remove temporary files, including the native support.
 o clientIsExiting(int)
This method is called when the client is exiting.
 o closeNamedResourceStream(String)
Close the archive stream associated with the specified name.
 o exit(int)
Requests the server VM to exit with the specified exit code.
 o getAllChildrenRoutes()
Returns routes to all wizard states that are children of this wizard state.
 o getArchiveFilename()
Get the archive filename.
 o getArchivePath()
This method returns path to the class archive containing this state.
 o getArchiveReader()
Get method for the archive reader variable.
 o getChildObject(String)
This method returns the named child object of this WizardState.
 o getChildren()
Get all child states.
 o getChildStateRoute(Route, String)
Get the route for a child WizardState.
 o getChildWizardState(Route, String)
This method returns the named child WizardState.
 o getChildWizardState(String)
This method returns the named child WizardState.
 o getData(Route, String)
Returns the data stored under the specified id in the WizardState object identified by the specified route. Deprecated.
 o getData(String)
Returns the data stored under the specified id in this WizardState object.
 o getDesktopService()
Returns the DesktopService.
 o getDesktopServiceProxy()
Returns the proxy object for the desktop service.
 o getInitializeStatus()
Returns the initialize status.
 o getLogService()
Returns the log service.
 o getLogServiceProxy()
Returns the proxy object for the log service.
 o getName()
This method gets the name of this WizardState.
 o getNamedResource(Route, String, String)
This method returns the bytes of the named resource of the specified type.
 o getNamedResourceStream(String)
Get the archive stream associated with the specified name.
 o getParent()
This method gets the parent of this WizardState.
 o getProgressLabels(String, String, Vector)
Get the progress labels from states with the specified purpose for the progress panel with the specified name.
 o getPurpose()
This method gets the purpose of this WizardState.
 o getRegistryService()
Get the registry service.
 o getRegistryServiceProxy()
Returns the proxy object for the registry service.
 o getRootWizardState()
Get the root of the WizardState tree.
 o getRoute(Route)
Get the server side route for this WizardState.
 o getRuntimeResources()
Get the runtime classes required by this WizardState.
 o getSelectedChildren(Class)
This method returns a list of selected children.
 o getSelectedChildrenRoutes(String)
Returns routes to selected wizards that are children of this wizard and having the specified purpose.
 o getSequence(String)
Get a named sequence of server-side tasks from the WizardState.
 o getSerializedData()
Get the data that represents a serialized version of this WizardState.
 o getWizardState(Route)
Get the GenericWizardState identified by the specified route.
 o getWizardTree(Route, String)
Get the data representing a client subtree.
 o hasGUI()
This method gets the guiMode of this WizardState
 o hasInitialized()
Returns true if the WizardState has been completely initialized; false otherwise.
 o initializationComplete()
This method is called when all of the wizard state initialization is complete.
 o isBuildMode()
Returns true if the WizardState is currently operating in build mode.
 o isBusy()
Returns true if this WizardState object is busy initializing or performing a Sequence.
 o performSequence(Route, String, boolean, String)
Perform the specified sequence of tasks.
 o registerTempFile(String)
Register a temporary file that will be removed when the wizard exits.
 o removeChildWizardState(String)
This method removes the named child.
 o removeTempFile(String)
Remove the specified temporary file now.
 o resumeSequence()
Resume the sequence that is currently being performed or reversed.
 o reverseSequence(Route, String, boolean, String)
Reverse the specified sequence of tasks.
 o setArchiveReader(ArchiveReader)
Set method for the archive reader variable.
 o setBuildMode(boolean)
Sets the mode of this WizardState to build mode if the mode variable is true.
 o setChildren(Vector)
Set all child states.
 o setData(Route, String, Object)
This method sets data into the WizardState identified by the specified route object. Deprecated.
 o setData(String, Object)
This method sets data into the WizardState.
 o setFrameTitle(String)
Set Title of the GUI's Frame
 o setGUIMode(boolean)
Selects the type of user interface.
 o setName(String)
This method sets the name of this WizardState.
 o setParent(WizardState)
This method sets the parent of this WizardState.
 o setProgressLabel(String, Msg)
Sets a progress label for this this state.
 o setPurpose(String)
This method sets the purpose of this WizardState.
 o setSelectedChildren(Vector)
This method sets this WizardState's selected children.
 o setSequenceProgress(Route, int)
Set the progress of the current sequence.
 o setSequenceProgress(WizardState, String, Route, int[])
Propogate the progress up to the highest level WizardState that has the specified purpose.
 o setWizardManager(Object)
Set the wizard manager object.
 o setWizardState(DataInput)
Set up this WizardState from the specified input stream.
 o suspendSequence()
Suspend the sequence that is currently being performed or reversed.

Constructors

 o GenericWizardState
 public GenericWizardState()
Creates a GenericWizardState that will not instantiate a graphical user interface. This method is called by wizard builders to establish a default state for a WizardState and then save that state in a wizard archive.

 o GenericWizardState
 public GenericWizardState(ArchiveReader archiveReader,
                           Boolean startGUI)
At runtime, the GenericWizardState will be instantiated with an ArchiveReader. The ArchiveReader is responsible for getting information out of the wizard archive.

Parameters:
archiveReader - The archiveReader that reads the archive associated with this wizardState.
startGUI - true if this GenericWizardState should start a Graphical User Interface.

Methods

 o setArchiveReader
 protected void setArchiveReader(ArchiveReader archiveReader)
Set method for the archive reader variable.

Parameters:
archiveReader - The ArchiveReader object for this WizardState.
 o getArchiveReader
 protected ArchiveReader getArchiveReader()
Get method for the archive reader variable.

Returns:
The ArchiveReader object used by this WizardState.
 o isBuildMode
 protected boolean isBuildMode()
Returns true if the WizardState is currently operating in build mode.

Returns:
True if this WizardState is executing in build mode.
 o setBuildMode
 protected void setBuildMode(boolean mode)
Sets the mode of this WizardState to build mode if the mode variable is true.

Parameters:
mode - If true, this WizardState will execute in build mode.
 o exit
 public void exit(int exitStatus)
Requests the server VM to exit with the specified exit code. This call results in the wizard client being notified of the exit request.

Parameters:
exitStatus - The exit code.
 o clientIsExiting
 public void clientIsExiting(int exitStatus)
This method is called when the client is exiting. The result of this call is the server VM exits with the specified exit code.

Parameters:
exitStatus - The exit code.
 o cleanup
 protected void cleanup(WizardState wizardState)
This method is called before exiting to remove temporary files, including the native support.

 o isBusy
 public boolean isBusy()
Returns true if this WizardState object is busy initializing or performing a Sequence.

 o setFrameTitle
 public void setFrameTitle(String title)
Set Title of the GUI's Frame

Parameters:
title - The new title.
 o setName
 public void setName(String name)
This method sets the name of this WizardState.

Parameters:
name - The new name for this WizardState.
 o getName
 public String getName()
This method gets the name of this WizardState.

Returns:
The name of this WizardState.
 o setPurpose
 public synchronized void setPurpose(String purpose)
This method sets the purpose of this WizardState. The purpose is an indication of what the WizardState can do, and is used for grouping WizardStates within a tree.

Parameters:
purpose - The purpose of this WizardState.
 o getPurpose
 public String getPurpose()
This method gets the purpose of this WizardState.

Returns:
The purpose of this WizardState.
 o hasGUI
 public synchronized boolean hasGUI()
This method gets the guiMode of this WizardState

 o setGUIMode
 protected void setGUIMode(boolean mode)
Selects the type of user interface. If mode is true, a graphical user interface will be used. If mode is false, a non graphical interface will be used (command line or invisible). This method must be called at WizardState instantiation.

Parameters:
mode - If true, a GUI will be used.
 o setParent
 public void setParent(WizardState parent)
This method sets the parent of this WizardState.

Parameters:
parent - The new parent for this WizardState.
 o getParent
 public WizardState getParent()
This method gets the parent of this WizardState.

Returns:
The parent of this WizardState.
 o getSelectedChildren
 public Vector getSelectedChildren(Class returnClass)
This method returns a list of selected children. The vetor that is returned will have entries of the specified class. Supported classes include WizardState and String. If String is specified, the list of children will be specified by WizardState name.

Parameters:
returnClass - The requested class of the list entries.
Returns:
The currently selected children.
 o setSelectedChildren
 public void setSelectedChildren(Vector selectedChildren)
This method sets this WizardState's selected children.

Parameters:
selectedChildren - The children to be selected.
 o setData
 public void setData(Route route,
                     String id,
                     Object value)
Note: setData() is deprecated. You should now use setData(String, Object).

This method sets data into the WizardState identified by the specified route object. The data objects should implement the Serializable interface if the data will be saved in a wizard archive and be retrieved at runtime. All data being set into the WizardState from the client must be Serializable.

Parameters:
route - The route to the correct WizardState.
id - The data identification. This value will be used to retrieve the data.
value - The data to be saved.
 o setData
 public void setData(String id,
                     Object value)
This method sets data into the WizardState. The data objects should implement the Serializable interface if the data will be saved in a wizard archive and be retrieved at runtime. All data being set into the WizardState from the client must be Serializable.

Parameters:
id - The data identification. This value will be used to retrieve the data.
value - The data to be saved.
 o getData
 public Object getData(Route route,
                       String id)
Note: getData() is deprecated. You should now use getData(String)

Returns the data stored under the specified id in the WizardState object identified by the specified route.

Parameters:
route - The route to the correct WizardState.
id - The data identification.
Returns:
The requested data, or null if the requested data has not been set.
 o getData
 public Object getData(String id)
Returns the data stored under the specified id in this WizardState object.

Parameters:
id - The data identification.
Returns:
The requested data, or null if the requested data has not been set.
 o getProgressLabels
 public Vector getProgressLabels(String purpose,
                                 String progressKey,
                                 Vector childLabels)
Get the progress labels from states with the specified purpose for the progress panel with the specified name.

Parameters:
purpose - The purpose of the wizard state.
progressKey - The key that the progress panel will use to request the label.
childLabels - This should be null.
Returns:
A vector containing all of the progress label strings.
 o setProgressLabel
 public void setProgressLabel(String progressKey,
                              Msg label)
Sets a progress label for this this state. The progress label is indexed by the name of the panel that will request it.

Parameters:
progressKey - The key that the progress panel will use to request the label.
label - The text for the specified progress bar.
 o getRootWizardState
 public WizardState getRootWizardState()
Get the root of the WizardState tree.

Returns:
The root WizardState.
 o getWizardState
 public WizardState getWizardState(Route route)
Get the GenericWizardState identified by the specified route.

Parameters:
route - The route to the desired GenericWizardState.
Returns:
The desired WizardState.
 o getRoute
 public Route getRoute(Route routeInProgress)
Get the server side route for this WizardState.

Parameters:
routeInProgress - This method should be called with routeInProgress = null.
Returns:
The route for this WizardState.
 o getChildStateRoute
 public Route getChildStateRoute(Route route,
                                 String childName)
Get the route for a child WizardState.

Parameters:
route - The route to the parent of the desired WizardState.
childName - The name of the desired child.
Returns:
The route to the desired WizardState.
 o getChildWizardState
 protected WizardState getChildWizardState(String name)
This method returns the named child WizardState.

Parameters:
name - The name of the desired WizardState.
Returns:
The desired WizardState, or null if the named WizardState does not exist.
 o removeChildWizardState
 public void removeChildWizardState(String name)
This method removes the named child.

Parameters:
name - The name of the WizardState child to remove.
 o getChildObject
 public Object getChildObject(String name)
This method returns the named child object of this WizardState.

Parameters:
name - The name of the desired WizardState.
Returns:
The desired WizardState, or null if the named WizardState does not exist.
 o getChildWizardState
 public WizardState getChildWizardState(Route route,
                                        String name)
This method returns the named child WizardState.

Parameters:
route - The route to the parent WizardState.
name - The name of the desired WizardState.
Returns:
The desired WizardState, or null if the named WizardState does not exist.
 o getAllChildrenRoutes
 public Route[] getAllChildrenRoutes()
Returns routes to all wizard states that are children of this wizard state.

 o getSelectedChildrenRoutes
 public Route[] getSelectedChildrenRoutes(String purpose)
Returns routes to selected wizards that are children of this wizard and having the specified purpose.

Parameters:
purpose - The purpose of the desired WizardStates.
 o getArchivePath
 public String getArchivePath()
This method returns path to the class archive containing this state.

Returns:
Path to the class archive containing this state
 o getArchiveFilename
 public String getArchiveFilename()
Get the archive filename.

Returns:
The filename of this archive, including the path.
 o getSerializedData
 public byte[] getSerializedData()
Get the data that represents a serialized version of this WizardState.

Returns:
The byte array representing the serialization of this WizardState.
 o getInitializeStatus
 public int getInitializeStatus()
Returns the initialize status. The value returned is a mask that reports the completion status of the various stages of WizardState initialization.

 o setWizardState
 public synchronized void setWizardState(DataInput in)
Set up this WizardState from the specified input stream.

Parameters:
in - The input stream describing the desired state of this WizardState.
 o initializationComplete
 public void initializationComplete()
This method is called when all of the wizard state initialization is complete. This method will advance to the first client screen.

 o hasInitialized
 public boolean hasInitialized()
Returns true if the WizardState has been completely initialized; false otherwise.

 o addChild
 public void addChild(String relativePath)
Add a child description to the wizard archive. At execution time, if the child is found at the specified relative path, it will be available to the server and client associated with this wizard.

Parameters:
relativePath - The relative path to the child archive.
 o addChildObject
 public void addChildObject(String name,
                            ServerObject childObject)
Add a child object to this WizardState. The child object MUST be Serializable.

Parameters:
name - The name of the object.
childObject - The object to add as a child to this WizardState.
 o getChildren
 public Vector getChildren()
Get all child states.

Returns:
All children of this wizard state.
 o setChildren
 public void setChildren(Vector childWizardStates)
Set all child states.

Parameters:
childWizardStates - All children of this wizard state.
 o getWizardTree
 public byte[] getWizardTree(Route route,
                             String subtreeName)
Get the data representing a client subtree.

Parameters:
route - The route to the responsible WizardState.
subtreeName - The name of the subtree, or null for the entire client tree.
Returns:
The data representing the client tree.
 o getNamedResource
 public byte[] getNamedResource(Route route,
                                String type,
                                String name)
This method returns the bytes of the named resource of the specified type.

Parameters:
route - The route to the correct WizardState.
type - The type of resource.
name - The name of the resource.
Returns:
The byte array representing the requested resource.
 o getNamedResourceStream
 public ResourceSection getNamedResourceStream(String name)
Get the archive stream associated with the specified name.

Parameters:
name - The name of the desired resource.
 o closeNamedResourceStream
 public void closeNamedResourceStream(String name)
Close the archive stream associated with the specified name.

Parameters:
name - The name of the resource used to open the stream.
 o addSequence
 public void addSequence(String sequenceName,
                         Sequence sequence)
Add a named sequence of server-side tasks to the WizardState.

Parameters:
sequenceName - The name that will be used to reference this sequence at runtime.
sequence - The sequence of tasks that will be performed at runtime.
 o getSequence
 public Sequence getSequence(String sequenceName)
Get a named sequence of server-side tasks from the WizardState.

Parameters:
sequenceName - The name of the desired sequence.
Returns:
The desired sequence, or null if the sequence has not been added to this WizardState.
 o performSequence
 public void performSequence(Route route,
                             String sequenceName,
                             boolean waitForCompletion,
                             String sequenceCompleteMethod)
Perform the specified sequence of tasks. Unless the waitForCompletion flag is set to true, this method will return immediately.

Parameters:
route - The route back to the client object that monitors the sequence.
sequenceName - The name of the sequence to perform.
waitForCompletion - If true, this method will not return until the sequence has completed.
sequenceCompleteMethod - The name of the client panel method that should be called when the sequence has completed.
 o reverseSequence
 public void reverseSequence(Route route,
                             String sequenceName,
                             boolean waitForCompletion,
                             String sequenceCompleteMethod)
Reverse the specified sequence of tasks. Unless the waitForCompletion flag is set to true, this method will return immediately.

Parameters:
route - The route back to the client object that monitors the sequence.
sequenceName - The name of the sequence to reverse.
waitForCompletion - If true, this method will not return until the sequence has completed.
sequenceCompleteMethod - The name of the client panel method that should be called when the sequence has completed.
 o setSequenceProgress
 public void setSequenceProgress(Route sequenceRoute,
                                 int progress)
Set the progress of the current sequence.

Parameters:
sequenceRoute - The route to the caller object.
progress - The progress of the current sequence.
 o setSequenceProgress
 public void setSequenceProgress(WizardState childState,
                                 String purpose,
                                 Route progressRoute,
                                 int progress[])
Propogate the progress up to the highest level WizardState that has the specified purpose.

Parameters:
childState - The child WizardState object.
purpose - The WizardState purpose.
progressRoute - The route to the progress panel.
progress - The progress, measured from 0 to 100.
 o suspendSequence
 public void suspendSequence()
Suspend the sequence that is currently being performed or reversed.

 o resumeSequence
 public void resumeSequence()
Resume the sequence that is currently being performed or reversed.

 o cancelSequence
 public void cancelSequence()
Cancel the sequence that is currently being performed or reversed.

 o setWizardManager
 public void setWizardManager(Object wizardManager)
Set the wizard manager object. The wizard manager is a client-side object that is responsible for the creation and navigation of the client tree. This method should only be called by the wizard manager object, and only on the root WizardState.

Parameters:
wizardManager - The wizard manager object.
 o registerTempFile
 public void registerTempFile(String filename)
Register a temporary file that will be removed when the wizard exits.

Parameters:
filename - The absolute path to the file to be removed.
 o removeTempFile
 public void removeTempFile(String filename)
Remove the specified temporary file now.

Parameters:
filename - The absolute path to the temporary file to be removed.
 o getRuntimeResources
 public Vector getRuntimeResources()
Get the runtime classes required by this WizardState.

 o callClientObjectMethod
 public void callClientObjectMethod(Route route,
                                    String methodName,
                                    String argTypes[],
                                    Object args[])
Call a method on the client. The method is sent to the correct object in the Wizard client tree via the specified route object.

Parameters:
route - The route to the desired client object.
methodName - The name of the method to call.
argTypes - The parameter list identifying the correct method.
args - The parameters to pass to the method.
 o callServerObjectMethod
 public Object callServerObjectMethod(Route route,
                                      String methodName,
                                      String argTypes[],
                                      Object args[])
Call a method on the server. The method is sent to the correct object in the Wizard state tree via the specified route object.

Parameters:
route - The route to the desired server object.
methodName - The name of the method to call.
argTypes - The parameter list identifying the correct method.
args - The parameters to pass to the method.
Returns:
The method return value.
 o getRegistryService
 public RegistryService getRegistryService()
Get the registry service.

 o getRegistryServiceProxy
 public RemoteRegistryServiceInt getRegistryServiceProxy()
Returns the proxy object for the registry service.

 o getDesktopService
 public DesktopService getDesktopService()
Returns the DesktopService.

 o getDesktopServiceProxy
 public RemoteDesktopServiceInt getDesktopServiceProxy()
Returns the proxy object for the desktop service.

 o getLogService
 public LogService getLogService()
Returns the log service.

 o getLogServiceProxy
 public RemoteLogServiceInt getLogServiceProxy()
Returns the proxy object for the log service.


All Packages  Class Hierarchy  This Package  Previous  Next  Index