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