info.magnolia.commands
Class MgnlCommand

java.lang.Object
  extended by info.magnolia.commands.MgnlCommand
All Implemented Interfaces:
org.apache.commons.chain.Command
Direct Known Subclasses:
BaseRepositoryCommand, FlowCommand, FlushCachesCommand, FlushFromCachesByUUIDCommand, FlushNamedCacheCommand, LogCommand, MessageCommand

public abstract class MgnlCommand
extends Object
implements org.apache.commons.chain.Command

To make the coding of commands as easy as possible the default values set in the config are set and the values of the context are set as properties too if the naming matches. To get a better performance we use an inner object pool. The execution of the command gets a clone from the pool and executes the clone

Version:
$Revision: 45291 $ ($Author: had $)
Author:
Philipp Bracher

Field Summary
static org.slf4j.Logger log
           
 
Fields inherited from interface org.apache.commons.chain.Command
CONTINUE_PROCESSING, PROCESSING_COMPLETE
 
Constructor Summary
MgnlCommand()
           
 
Method Summary
 boolean execute(org.apache.commons.chain.Context ctx)
          Make sure that the context is castable to a magnolia context.
abstract  boolean execute(Context context)
           
protected  boolean isClone()
           
 boolean isEnabled()
           
 void release()
          If a clone is passivated we call this method.
protected  void setClone(boolean isClone)
           
 void setEnabled(boolean isEnabled)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static org.slf4j.Logger log
Constructor Detail

MgnlCommand

public MgnlCommand()
Method Detail

execute

public boolean execute(org.apache.commons.chain.Context ctx)
                throws Exception
Make sure that the context is castable to a magnolia context.

Specified by:
execute in interface org.apache.commons.chain.Command
Returns:
true on success, false otherwise
Throws:
Exception

execute

public abstract boolean execute(Context context)
                         throws Exception
Throws:
Exception

release

public void release()
If a clone is passivated we call this method. Please clean up private properties.


isClone

protected boolean isClone()
Returns:
the isClone

setClone

protected void setClone(boolean isClone)
Parameters:
isClone - the isClone to set

isEnabled

public boolean isEnabled()

setEnabled

public void setEnabled(boolean isEnabled)


Copyright © 2003-2012 Magnolia International Ltd.. All Rights Reserved.