All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.wizards.tasks.PlatformTask

java.lang.Object
   |
   +----com.sun.wizards.core.Task
           |
           +----com.sun.wizards.tasks.DecoratorTask
                   |
                   +----com.sun.wizards.tasks.PlatformTask

public class PlatformTask
extends DecoratorTask
implements Serializable
The PlatformTask is a task that follows the Decorator design pattern. This object can be used to perform or reverse a task only on a specific platform. It checks if it is currently running on a specified platform, and if so, acts just as the underlying task would. Otherwise, it is ignored. This Task is constructed using the desired platforms. For example, to make a Solaris-specific task (perhaps we want to run the Solaris utility "fsck"), you would use the following:

PlatformTask solarisOnlyTask = new PlatformTask(new Platform(Platform.SOLARIS), fsckTask);
To make it a multiple-platform Task, simply create an array of platforms:

Platform[] myPlatforms = new Platform[] {new Platform(Platform.SOLARIS), new Platform(Platform.MACOS)}; PlatformTask solarisOnlyTask = new PlatformTask(myPlatforms, fsckTask);


Variable Index

 o platforms
The platform(s) that the decorated task should be performed on.

Constructor Index

 o PlatformTask()
Creates a PlatformTask.
 o PlatformTask(Platform, Task)
Creates a Platform task that will perform the specified task on the specified platform.
 o PlatformTask(Platform[], Task)
Creates a Platform task that will perform the specified task on the specified platforms.

Method Index

 o addRuntimeResources(Vector)
Add the runtime class requirements to the specified vector.
 o ignore(boolean)
Returns false if this task does not want to be ignored, or true if this task should be ignored.
 o isTargetPlatform()
Returns true if this object is being executed on one of the target platforms that were specified at buildtime.

Variables

 o platforms
 protected Platform platforms[]
The platform(s) that the decorated task should be performed on.

Constructors

 o PlatformTask
 public PlatformTask()
Creates a PlatformTask.

 o PlatformTask
 public PlatformTask(Platform platform,
                     Task decoratedTask)
Creates a Platform task that will perform the specified task on the specified platform.

Parameters:
platform - The platform the decorated task should perform on.
decoratedTask - The task that is to be performed or reversed.
 o PlatformTask
 public PlatformTask(Platform platforms[],
                     Task decoratedTask)
Creates a Platform task that will perform the specified task on the specified platforms.

Parameters:
platforms - The platform the decorated task should perform on.
decoratedTask - The task that is to be performed or reversed.

Methods

 o isTargetPlatform
 protected boolean isTargetPlatform()
Returns true if this object is being executed on one of the target platforms that were specified at buildtime.

Returns:
true if this object is being executed on one of the target platforms specified at buildtime
 o ignore
 public boolean ignore(boolean direction)
Returns false if this task does not want to be ignored, or true if this task should be ignored. If this Platform task is not executing on one of the platforms specified at buildtime, this method will return true, so this task will be ignored..

Parameters:
direction - Which way we should traverse the product tree if we are ignoring the task
Returns:
true if this task should be ignored; false otherwise.
Overrides:
ignore in class DecoratorTask
 o addRuntimeResources
 public void addRuntimeResources(Vector resourceVector)
Add the runtime class requirements to the specified vector.

Parameters:
resourceVector - The vector containing all runtime resources for this wizard.
Overrides:
addRuntimeResources in class DecoratorTask

All Packages  Class Hierarchy  This Package  Previous  Next  Index