org.apache.sling.installer.api.tasks
Class InstallTask

java.lang.Object
  extended by org.apache.sling.installer.api.tasks.InstallTask
All Implemented Interfaces:
Comparable<InstallTask>

public abstract class InstallTask
extends Object
implements Comparable<InstallTask>

Base class for tasks that can be executed by the OsgiInstaller.


Constructor Summary
InstallTask(TaskResourceGroup erl)
          Constructor for the task
 
Method Summary
 int compareTo(InstallTask o)
          All comparisons are based on getSortKey().
 boolean equals(Object o)
           
abstract  void execute(InstallationContext ctx)
          This is the heart of the task - it performs the actual task.
 TaskResource getResource()
          Return the corresponding resource - depending on the task this might be null.
 TaskResourceGroup getResourceGroup()
          Return the corresponding resource - depending on the task this might be null.
abstract  String getSortKey()
          Tasks are sorted according to this key.
 int hashCode()
           
 void setFinishedState(ResourceState state)
          Set the finished state for the resource.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InstallTask

public InstallTask(TaskResourceGroup erl)
Constructor for the task

Parameters:
erl - The resource group or null.
Method Detail

getResource

public TaskResource getResource()
Return the corresponding resource - depending on the task this might be null.


getResourceGroup

public TaskResourceGroup getResourceGroup()
Return the corresponding resource - depending on the task this might be null.


execute

public abstract void execute(InstallationContext ctx)
This is the heart of the task - it performs the actual task.

Parameters:
ctx - The installation context.

getSortKey

public abstract String getSortKey()
Tasks are sorted according to this key. Therefore this key must uniquely identify this task. A typical sort key contains the entity id of the resource in execution.


setFinishedState

public void setFinishedState(ResourceState state)
Set the finished state for the resource.

Parameters:
state - The new state.

toString

public String toString()
Overrides:
toString in class Object

equals

public final boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public final int hashCode()
Overrides:
hashCode in class Object

compareTo

public final int compareTo(InstallTask o)
All comparisons are based on getSortKey().

Specified by:
compareTo in interface Comparable<InstallTask>


Copyright © 2007-2011 The Apache Software Foundation. All Rights Reserved.