org.ow2.shelbie.core.internal.handler
Class CommandHandler

java.lang.Object
  extended by org.apache.felix.ipojo.Handler
      extended by org.apache.felix.ipojo.PrimitiveHandler
          extended by org.ow2.shelbie.core.internal.handler.CommandHandler
All Implemented Interfaces:
org.apache.felix.ipojo.ConstructorInjector, org.apache.felix.ipojo.FieldInterceptor, org.apache.felix.ipojo.MethodInterceptor, org.apache.felix.service.command.Function, org.ow2.shelbie.core.ICompletable, org.ow2.shelbie.core.registry.supply.InfoSupplier

public class CommandHandler
extends org.apache.felix.ipojo.PrimitiveHandler
implements org.apache.felix.service.command.Function, org.ow2.shelbie.core.ICompletable, org.ow2.shelbie.core.registry.supply.InfoSupplier

This Handler manages the link between the iPOJO component (implementing the Action interface) and the shell runtime.


Field Summary
static String COMMAND_ELEMENT
          Name of the 'command' element.
static String NAMESPACE
          The handler Namespace.
static String TYPE_ATTRIBUTE
          Name of the 'type' attribute.
 
Fields inherited from class org.apache.felix.ipojo.PrimitiveHandler
HANDLER_TYPE
 
Fields inherited from class org.apache.felix.ipojo.Handler
HANDLER_LEVEL_PROPERTY, HANDLER_NAME_PROPERTY, HANDLER_NAMESPACE_PROPERTY, HANDLER_TYPE_PROPERTY, m_instance, m_isValid
 
Constructor Summary
CommandHandler()
           
 
Method Summary
 void bindActionPreparator(org.apache.felix.gogo.commands.basic.ActionPreparator preparator)
           
 void bindCompleter(jline.console.completer.Completer completer, Map reference)
           
 void configure(org.apache.felix.ipojo.metadata.Element element, Dictionary dictionary)
           
 Object execute(org.apache.felix.service.command.CommandSession commandSession, List<Object> objects)
          Simply wraps the inner command.
 List<jline.console.completer.Completer> getCompleters()
           
 org.apache.felix.ipojo.architecture.HandlerDescription getDescription()
          Returns the current handler description.
 Collection<org.ow2.shelbie.core.registry.info.ScopeInfo> getScopeInfo()
           
 void invalidate()
          Called when the handler's instance (not the instance managed by the handler) is becoming invalid.
 void start()
           
 void stop()
           
 void unbindCompleter(jline.console.completer.Completer completer)
           
 void validate()
          Called when the handler's instance (not the instance managed by the handler) is really OK.
 
Methods inherited from class org.apache.felix.ipojo.PrimitiveHandler
attach, getConstructorParameter, getConstructorParameterType, getFactory, getHandler, getInstanceManager, getLogger, getPojoMetadata, onCreation, onEntry, onError, onExit, onFinally, onGet, onSet, setFactory
 
Methods inherited from class org.apache.felix.ipojo.Handler
debug, error, error, getHandlerManager, getValidity, info, initializeComponentFactory, isValid, reconfigure, setValidity, stateChanged, warn, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAMESPACE

public static final String NAMESPACE
The handler Namespace.

See Also:
Constant Field Values

TYPE_ATTRIBUTE

public static final String TYPE_ATTRIBUTE
Name of the 'type' attribute.

See Also:
Constant Field Values

COMMAND_ELEMENT

public static final String COMMAND_ELEMENT
Name of the 'command' element.

See Also:
Constant Field Values
Constructor Detail

CommandHandler

public CommandHandler()
Method Detail

configure

public void configure(org.apache.felix.ipojo.metadata.Element element,
                      Dictionary dictionary)
               throws org.apache.felix.ipojo.ConfigurationException
Specified by:
configure in class org.apache.felix.ipojo.Handler
Throws:
org.apache.felix.ipojo.ConfigurationException

bindActionPreparator

public void bindActionPreparator(org.apache.felix.gogo.commands.basic.ActionPreparator preparator)

bindCompleter

public void bindCompleter(jline.console.completer.Completer completer,
                          Map reference)

unbindCompleter

public void unbindCompleter(jline.console.completer.Completer completer)

execute

public Object execute(org.apache.felix.service.command.CommandSession commandSession,
                      List<Object> objects)
               throws Exception
Simply wraps the inner command.

Specified by:
execute in interface org.apache.felix.service.command.Function
Throws:
Exception

getCompleters

public List<jline.console.completer.Completer> getCompleters()
Specified by:
getCompleters in interface org.ow2.shelbie.core.ICompletable

start

public void start()
Specified by:
start in class org.apache.felix.ipojo.Handler

validate

public void validate()
Called when the handler's instance (not the instance managed by the handler) is really OK.


invalidate

public void invalidate()
Called when the handler's instance (not the instance managed by the handler) is becoming invalid.


stop

public void stop()
Specified by:
stop in class org.apache.felix.ipojo.Handler

getScopeInfo

public Collection<org.ow2.shelbie.core.registry.info.ScopeInfo> getScopeInfo()
Specified by:
getScopeInfo in interface org.ow2.shelbie.core.registry.supply.InfoSupplier

getDescription

public org.apache.felix.ipojo.architecture.HandlerDescription getDescription()
Returns the current handler description. The simplest description contains only the name and the validity of the handler. If the handler override this method, it can customize the description. By default, this method returns the simplest description.

Overrides:
getDescription in class org.apache.felix.ipojo.Handler
Returns:
the description of the handler.


Copyright © 2013 OW2 Consortium. All Rights Reserved.