com.essbase.eas.framework.server.application
Class AbstractCommandListener

java.lang.Object
  extended bycom.essbase.eas.framework.server.application.DefaultApplicationPart
      extended bycom.essbase.eas.framework.server.application.AbstractCommandListener
All Implemented Interfaces:
ApplicationPart, CommandListener

public abstract class AbstractCommandListener
extends DefaultApplicationPart
implements CommandListener

Since:
6.5.3
Version:
7.0.0
Author:
Hank Cox, Painted Word

Field Summary
protected  java.util.HashMap aliasMap
           
protected  java.util.HashMap methodMap
           
static java.lang.String THERESULT
           
 
Fields inherited from class com.essbase.eas.framework.server.application.DefaultApplicationPart
CHAIN_SEPARATOR, manager, parts, serviceContext, serviceManager, state, STATE_BEFORE_WORKERS_ASSIGNED, STATE_CONSTRUCTED, STATE_DESTROYED, STATE_INITIALIZED, STATE_MANAGED, STATE_NULL, STATE_WORKERS_ASSIGNED, STATE_WORKERS_INITIALIZED, storeService
 
Constructor Summary
AbstractCommandListener()
          Constructs an AbstractCommandListener object.
 
Method Summary
protected  void addMethodAlias(com.essbase.eas.framework.defs.command.CommandDescriptor command)
          adds a mapping to the method map for a command that has been discovered via introspection.
protected  void addMethodAlias(java.lang.String theAlias, java.lang.String theMethodName)
           
 void assignWorkers(ServiceContext context)
           
protected  void buildAliasMap(StoreService store, ServiceContext context)
          Deprecated. as of 6.5.3
protected  void buildAliasMapEx(StoreService store, ServiceContext context)
           
protected  void buildMethodMap()
           
protected  java.lang.Object convertStringValueToArgument(com.essbase.eas.framework.defs.command.CommandArgument argument, java.lang.String value)
          uses a CommandArgument object and a String object to create a value compatible with the requirements.
protected  java.lang.Object[] getArgumentsForCommand(CommandEvent event)
          returns an array of arguments for the requested method.
 com.essbase.eas.framework.defs.command.CommandDescriptor[] getCommands()
          Implementation of the CommandListener.getCommands() method.
protected  java.lang.reflect.Method getMethod(java.lang.String name)
           
protected  java.lang.reflect.Method getMethodForAlias(java.lang.String theAlias)
           
 java.lang.Class[] getRoles()
           
protected  java.lang.Object getSessionObject(ServiceContext theContext, java.lang.Object key)
           
 void handleEvent(CommandEvent command)
           
 void handleEventException(CommandEvent commandEvent, java.lang.Throwable ex)
          implementation of the CommandListener.handleEventException() method.
 void handleEventPost(CommandEvent commandEvent, java.lang.Object result)
          implementation of the CommandListener.handleEventPost() method.
 boolean handleEventPrep(CommandEvent commandEvent)
          implementation of the CommandListener.handleEventPrep() method.
 java.lang.Object init(ServiceContext context)
          Initializes and stores mandatory and optimizing references.
protected  boolean isRequestFromSameServer(CommandEvent theEvent)
           
protected  java.lang.Object removeSessionObject(ServiceContext theContext, java.lang.Object key)
           
protected  void setServiceResult(ServiceContext theContext, java.lang.Object value)
           
protected  void setSessionObject(ServiceContext theContext, java.lang.Object key, java.lang.Object value)
           
 
Methods inherited from class com.essbase.eas.framework.server.application.DefaultApplicationPart
destroy, getManager, getManagerChain, getServiceContext, getServiceManager, getStoreService, initWorkers, requestPart, requestPartPool, setManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.essbase.eas.framework.server.defs.ApplicationPart
destroy, getManager, getServiceContext, getServiceManager, getStoreService, initWorkers, setManager
 

Field Detail

THERESULT

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

methodMap

protected java.util.HashMap methodMap

aliasMap

protected java.util.HashMap aliasMap
Constructor Detail

AbstractCommandListener

public AbstractCommandListener()
Constructs an AbstractCommandListener object.

Method Detail

getRoles

public java.lang.Class[] getRoles()
Specified by:
getRoles in interface ApplicationPart
Returns:

assignWorkers

public void assignWorkers(ServiceContext context)
                   throws ApplicationException
Specified by:
assignWorkers in interface ApplicationPart
Throws:
ApplicationException

init

public java.lang.Object init(ServiceContext context)
                      throws ApplicationException
Description copied from class: DefaultApplicationPart
Initializes and stores mandatory and optimizing references.

Specified by:
init in interface ApplicationPart
Overrides:
init in class DefaultApplicationPart
Parameters:
context - - the ServiceContext object for this context
Returns:
Throws:
ApplicationException

getMethod

protected java.lang.reflect.Method getMethod(java.lang.String name)

buildMethodMap

protected void buildMethodMap()

buildAliasMap

protected void buildAliasMap(StoreService store,
                             ServiceContext context)
                      throws ApplicationException
Deprecated. as of 6.5.3

Creates an alias mapping of commands bound to this command listener. This method handles the entries created during application construction that are in the property file. Takes a binding from the property file and places a link for the unique command name into an internal method map.

Throws:
ApplicationException

buildAliasMapEx

protected void buildAliasMapEx(StoreService store,
                               ServiceContext context)
                        throws ApplicationException
Throws:
ApplicationException

addMethodAlias

protected void addMethodAlias(java.lang.String theAlias,
                              java.lang.String theMethodName)
                       throws ApplicationException
Throws:
ApplicationException

addMethodAlias

protected void addMethodAlias(com.essbase.eas.framework.defs.command.CommandDescriptor command)
                       throws ApplicationException
adds a mapping to the method map for a command that has been discovered via introspection.

Throws:
ApplicationException

convertStringValueToArgument

protected java.lang.Object convertStringValueToArgument(com.essbase.eas.framework.defs.command.CommandArgument argument,
                                                        java.lang.String value)
uses a CommandArgument object and a String object to create a value compatible with the requirements.


getArgumentsForCommand

protected java.lang.Object[] getArgumentsForCommand(CommandEvent event)
returns an array of arguments for the requested method.


getMethodForAlias

protected java.lang.reflect.Method getMethodForAlias(java.lang.String theAlias)

handleEvent

public final void handleEvent(CommandEvent command)
                       throws ApplicationException
Specified by:
handleEvent in interface CommandListener
Throws:
ApplicationException

handleEventPrep

public boolean handleEventPrep(CommandEvent commandEvent)
                        throws ApplicationException
implementation of the CommandListener.handleEventPrep() method. Inheriting classes should override this method if they need to perform any special processing before the method invocation occurs.

Specified by:
handleEventPrep in interface CommandListener
Parameters:
commandEvent - the command event that we are processing.
Returns:
true if Ok to continue, false otherwise
Throws:
ApplicationException

handleEventPost

public void handleEventPost(CommandEvent commandEvent,
                            java.lang.Object result)
                     throws ApplicationException
implementation of the CommandListener.handleEventPost() method. Inheriting classes should override this method if they need to perform some post invocation work on the results of the command.

Specified by:
handleEventPost in interface CommandListener
Parameters:
commandEvent - the command event that we are processing.
Throws:
ApplicationException

handleEventException

public void handleEventException(CommandEvent commandEvent,
                                 java.lang.Throwable ex)
                          throws ApplicationException
implementation of the CommandListener.handleEventException() method. Inheriting classes should override this if they need to do something special when an exception is thrown during the method invocation.

Specified by:
handleEventException in interface CommandListener
Throws:
ApplicationException

getCommands

public com.essbase.eas.framework.defs.command.CommandDescriptor[] getCommands()
Implementation of the CommandListener.getCommands() method. This is an empty implementation and should be overridden by any derived classes that use the new introspection method of discovering commands.

Specified by:
getCommands in interface CommandListener
Returns:
a zero-length array of CommandDescriptor objects.

isRequestFromSameServer

protected boolean isRequestFromSameServer(CommandEvent theEvent)

setServiceResult

protected void setServiceResult(ServiceContext theContext,
                                java.lang.Object value)

setSessionObject

protected void setSessionObject(ServiceContext theContext,
                                java.lang.Object key,
                                java.lang.Object value)

getSessionObject

protected java.lang.Object getSessionObject(ServiceContext theContext,
                                            java.lang.Object key)

removeSessionObject

protected java.lang.Object removeSessionObject(ServiceContext theContext,
                                               java.lang.Object key)


Copyright © 2001 Hyperion Solutions Corporation. All Rights Reserved.