2009-01-09 1.2.0

org.eclipse.soda.dk.command
Class MethodCommand

java.lang.Object
  extended by org.eclipse.soda.dk.core.EscObject
      extended by org.eclipse.soda.dk.device.Control
          extended by org.eclipse.soda.dk.command.Command
              extended by org.eclipse.soda.dk.command.MethodCommand
All Implemented Interfaces:
CommandService, ControlService, DeviceControl, MeasurementListener, MultiplexMeasurementListener, MultiplexSignalListener, SignalListener, ErrorListener

public class MethodCommand
extends Command
implements DeviceControl

Since:
1.0
Version:
1.2.0

Field Summary
protected  DeviceService device
          Define the device (DeviceService) field.
static int EXECUTE_OPERATION
          Define the execute operation (int) constant.
static java.lang.String HANDLE_METHOD
          Define the handle execute (String) constant.
protected  boolean isMultiplexMethod
          Define the is multiplex method (boolean) field.
protected  java.lang.reflect.Method method
          Define the method (Method) field.
 
Fields inherited from class org.eclipse.soda.dk.device.Control
EXCEPTION_READ_FAILED_RESOURCE, SET_VALUE_EXCEPTION_RESOURCE
 
Fields inherited from class org.eclipse.soda.dk.core.EscObject
CLONE_EXCEPTION_RESOURCE, EMPTY_BYTES, EMPTY_STRING, ERROR_OCCURRED_EXCEPTION_RESOURCE, ID_FILTER_KEY, ID_KEY, ID_KEY_ANY, ID_NAME_KEY, INTEGER_TABLE, INTEGER_TABLE_SIZE, KEY_KEY, LOG_DEBUG, LOG_DEFAULT, LOG_ERROR, LOG_INFO, LOG_LEVEL_KEY, LOG_TRACE, LOG_WARNING, LONG_TABLE, LONG_TABLE_SIZE, PREFIX_KEY, READONLY_EMPTY_COLLECTION, READONLY_EMPTY_LIST, READONLY_EMPTY_MAP, RESOURCE_BUNDLE, SLEEP_EXCEPTION_RESOURCE, SYSTEM_INFO_RESOURCE, TO_STRING_CONFIGURATION_KEYS, TRACE_LEVEL_HIGH, TRACE_LEVEL_LOW, TRACE_LEVEL_MAX, TRACE_LEVEL_MIN, TRACE_LEVEL_NONE, TRACE_LEVEL_NORMAL, TRACELEVEL_KEY, UNKNOWN_ERROR_RESOURCE, Unmodifiable
 
Constructor Summary
MethodCommand(java.lang.String key)
          Constructs an instance of this class from the specified key parameter.
MethodCommand(java.lang.String key, java.lang.reflect.Method method)
          Constructs an instance of this class from the specified key and method parameters.
 
Method Summary
 java.lang.Object callMethod(int code, ChannelService channel, java.lang.Object data)
          Call method with the specified code, channel and data parameters and return the Object result.
 java.lang.Object callMethod(int code, java.lang.Object data)
          Call method with the specified code and data parameters and return the Object result.
 void execute(ChannelService channel)
          Execute with the specified channel parameter.
 void execute(ChannelService channel, java.lang.Object data)
          Execute with the specified channel and data parameters.
 DeviceService getDevice()
          Gets the device (DeviceService) value.
 void setDevice(DeviceService device)
          Sets the device value.
 
Methods inherited from class org.eclipse.soda.dk.command.Command
addCommandListener, execute, execute, fireCommandExecuted, fireCommandExecuted, fireCommandExecuted, fireCommandExecuted, fireErrorOccurred, fireErrorOccurred, getCommandListener, measurementChanged, measurementChanged, removeCommandListener, reportError, setCommandListener, signalOccurred, signalOccurred
 
Methods inherited from class org.eclipse.soda.dk.device.Control
attemptRecoveryFromError, equalsValue, errorOccurred, findMethod, getCodeKey, getErrorSeverity, getKey, getQualifiedKey, getResource, setKey, setQualifiedKey, toString
 
Methods inherited from class org.eclipse.soda.dk.core.EscObject
createBoolean, createDefaultLogService, createException, createException, createInteger, createIntegerTable, createLong, createLongTable, createNumber, format, getBoolean, getByte, getChar, getConfigurationService, getCurrentTimestamp, getDefaultLogService, getDefaultResource, getDouble, getFloat, getId, getIdName, getInt, getLoadLibraryName, getLogDetails, getLogDetails, getLogDetails0, getLogDetails1, getLogDetails2, getLogDetails3, getLogDetails4, getLogDetails5, getLogDetails6, getLogDetails7, getLogLevel, getLogService, getLong, getObject, getOutputName, getReadOnlyEmptyCollection, getReadOnlyEmptyList, getReadOnlyEmptyMap, getShort, getSimpleClassName, getStaticBoolean, getStaticByte, getStaticChar, getStaticDouble, getStaticFloat, getStaticInt, getStaticLong, getStaticObject, getStaticShort, getStaticString, getString, getTraceLevel, getVmLibraryVersion, handleError, handleError, handleError, handleError, handleErrorInternal, handleStaticError, handleStaticException, isBackward, isDebug, isLogging, isTrace, isUnmodifiable, loadService, log, log, log, report, report, report, report, report, report, report, reportSystemInfo, setBackward, setDebug, setDefaultLogService, setLogService, setTraceLevel, setUnmodifiable, shouldLog, sleep, startupEscStatic, toStringConfigurationKeys, toStringInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.soda.dk.device.service.ControlService
getKey
 
Methods inherited from interface org.eclipse.soda.dk.transport.service.ErrorListener
errorOccurred
 
Methods inherited from interface org.eclipse.soda.dk.transport.service.ErrorListener
errorOccurred
 

Field Detail

HANDLE_METHOD

public static final java.lang.String HANDLE_METHOD
Define the handle execute (String) constant.

See Also:
Constant Field Values

EXECUTE_OPERATION

public static final int EXECUTE_OPERATION
Define the execute operation (int) constant.

See Also:
Constant Field Values

method

protected java.lang.reflect.Method method
Define the method (Method) field.


isMultiplexMethod

protected boolean isMultiplexMethod
Define the is multiplex method (boolean) field.

Since:
1.2

device

protected DeviceService device
Define the device (DeviceService) field.

Constructor Detail

MethodCommand

public MethodCommand(java.lang.String key)
Constructs an instance of this class from the specified key parameter.

Parameters:
key - The key (String) parameter.
See Also:
MethodCommand(String,Method)

MethodCommand

public MethodCommand(java.lang.String key,
                     java.lang.reflect.Method method)
Constructs an instance of this class from the specified key and method parameters.

Parameters:
key - The key (String) parameter.
method - The method (Method) parameter.
See Also:
MethodCommand(String)
Method Detail

callMethod

public java.lang.Object callMethod(int code,
                                   ChannelService channel,
                                   java.lang.Object data)
Call method with the specified code, channel and data parameters and return the Object result.

Parameters:
code - The code (int) parameter.
channel - The channel (ChannelService) parameter.
data - The data (Object) parameter.
Returns:
Results of the call method (Object) value.
Since:
1.2
See Also:
callMethod(int,Object)

callMethod

public java.lang.Object callMethod(int code,
                                   java.lang.Object data)
Call method with the specified code and data parameters and return the Object result.

Parameters:
code - The code (int) parameter.
data - The data (Object) parameter.
Returns:
Results of the call method (Object) value.
See Also:
callMethod(int,ChannelService,Object)

execute

public void execute(ChannelService channel)
Execute with the specified channel parameter.

Specified by:
execute in interface CommandService
Overrides:
execute in class Command
Parameters:
channel - The channel (ChannelService) parameter.
See Also:
execute(ChannelService,Object)

execute

public void execute(ChannelService channel,
                    java.lang.Object data)
Execute with the specified channel and data parameters.

Specified by:
execute in interface CommandService
Overrides:
execute in class Command
Parameters:
channel - The channel (ChannelService) parameter.
data - The data (Object) parameter.
See Also:
execute(ChannelService)

getDevice

public DeviceService getDevice()
Gets the device (DeviceService) value.

Specified by:
getDevice in interface DeviceControl
Returns:
The device (DeviceService) value.
See Also:
setDevice(DeviceService)

setDevice

public void setDevice(DeviceService device)
Sets the device value.

Specified by:
setDevice in interface DeviceControl
Parameters:
device - The device (DeviceService) parameter.
See Also:
getDevice()

2009-01-09 1.2.0

Copyright (c) 2009 IBM. See license in Legal section.