org.wso2.registry.lifecycle
Class DefaultLifecycle

java.lang.Object
  extended by org.wso2.registry.lifecycle.Lifecycle
      extended by org.wso2.registry.lifecycle.DefaultLifecycle

public class DefaultLifecycle
extends Lifecycle


Field Summary
static java.lang.String ACTION
           
static java.lang.String PHASE_CREATED
           
static java.lang.String PHASE_DEPLOYED
           
static java.lang.String PHASE_DEVELOPED
           
static java.lang.String PHASE_PROPERTY
           
static java.lang.String PHASE_TESTED
           
static java.lang.String[] phases
           
 
Fields inherited from class org.wso2.registry.lifecycle.Lifecycle
AVAILABLE_LIFE_CYCLES
 
Constructor Summary
DefaultLifecycle()
           
 
Method Summary
 void associate(Resource resource, Registry registry)
          Associate a new Resource with this lifecycle.
 java.lang.String[] getAvailableActions(RequestContext context)
          Get a list of available actions for the resource in the RequestContext, taking into account current state, user, etc.
 void transition(RequestContext context, java.lang.String action)
          Do something (change state) - action names are lifecycle-specific, and it's up to the implementation to decide if a given transition is allowed, and what to do if so.
 
Methods inherited from class org.wso2.registry.lifecycle.Lifecycle
getName, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PHASE_CREATED

public static final java.lang.String PHASE_CREATED
See Also:
Constant Field Values

PHASE_DEVELOPED

public static final java.lang.String PHASE_DEVELOPED
See Also:
Constant Field Values

PHASE_TESTED

public static final java.lang.String PHASE_TESTED
See Also:
Constant Field Values

PHASE_DEPLOYED

public static final java.lang.String PHASE_DEPLOYED
See Also:
Constant Field Values

phases

public static final java.lang.String[] phases

PHASE_PROPERTY

public static final java.lang.String PHASE_PROPERTY
See Also:
Constant Field Values

ACTION

public static final java.lang.String ACTION
See Also:
Constant Field Values
Constructor Detail

DefaultLifecycle

public DefaultLifecycle()
Method Detail

associate

public void associate(Resource resource,
                      Registry registry)
               throws RegistryException
Description copied from class: Lifecycle
Associate a new Resource with this lifecycle. This could set custom properties, create sub-directories, etc... If this throws an Exception, the association has FAILED.

Specified by:
associate in class Lifecycle
Parameters:
resource - Resource which we want to change the state
registry - Current registry instance
Throws:
RegistryException - If the condition is not met or some thing is wrong

transition

public void transition(RequestContext context,
                       java.lang.String action)
                throws RegistryException
Do something (change state) - action names are lifecycle-specific, and it's up to the implementation to decide if a given transition is allowed, and what to do if so.

Specified by:
transition in class Lifecycle
Parameters:
context - the RequestContext containing all the state about this request
action - action to perform
Throws:
RegistryException - If the condition is not met or some thing is wrong

getAvailableActions

public java.lang.String[] getAvailableActions(RequestContext context)
Description copied from class: Lifecycle
Get a list of available actions for the resource in the RequestContext, taking into account current state, user, etc.

Specified by:
getAvailableActions in class Lifecycle
Parameters:
context - the RequestContext containing info about the Resource, Registry, User, etc.
Returns:
a String[] of the names of valid actions for this lifecycle on the specified resource


Copyright © 2007 Apache Web Services Project. All Rights Reserved.