Skip navigation links


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

java.lang.Object
  extended by com.essbase.eas.framework.server.application.DefaultApplicationPart
      extended by com.essbase.eas.framework.server.application.AbstractCommandListener

All Implemented Interfaces:
ApplicationPart, CommandListener
Direct Known Subclasses:
AppManCommandListener, FileDownloadCommandListener, FireAndForgetCommandListener, LoginCommandListener

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<java.lang.String,java.lang.Object> aliasMap
           
protected  java.util.HashMap<java.lang.String,java.lang.reflect.Method> methodMap
           
static java.lang.String RESULT
          Key used by most parts of the app to pass data from command listeners to the response
static java.lang.String THERESULT
           
static java.lang.String UPLOAD
           

 

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(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 buildMethodMap()
           
protected  java.lang.Object convertStringValueToArgument(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.
 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<java.lang.String,java.lang.reflect.Method> methodMap

aliasMap

protected java.util.HashMap<java.lang.String,java.lang.Object> aliasMap

UPLOAD

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

RESULT

public static final java.lang.String RESULT
Key used by most parts of the app to pass data from command listeners to the response
See Also:
Constant Field Values

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
Throws:
ApplicationException

getMethod

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

buildMethodMap

protected void buildMethodMap()

addMethodAlias

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

addMethodAlias

protected void addMethodAlias(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(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.
results - the object that is the result of calling method.invoke()
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 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)

Skip navigation links


Copyright © 2001, 2012, Oracle. All rights reserved.