org.rhq.enterprise.communications.command.impl.stream
Class RemoteInputStreamCommand

java.lang.Object
  extended by org.rhq.enterprise.communications.command.AbstractCommand
      extended by org.rhq.enterprise.communications.command.impl.stream.RemoteInputStreamCommand
All Implemented Interfaces:
Serializable, Command

public class RemoteInputStreamCommand
extends AbstractCommand

The command to be sent when a remote invocation on an input stream is to be made.

Author:
John Mazzitelli
See Also:
Serialized Form

Field Summary
static CommandType COMMAND_TYPE
          command type constant identifying this type of command
static ParameterDefinition PARAM_INVOCATION
          the required command parameter name containing the NameBasedInvocation object to describe what method to invoke on the remote stream.
static ParameterDefinition PARAM_STREAM_ID
          the required command parameter name containing the opaque identification object used to specify the particular input stream that is to be invoked.
 
Constructor Summary
RemoteInputStreamCommand()
          Constructor for RemoteInputStreamCommand.
RemoteInputStreamCommand(Command commandToTransform)
          Constructor for RemoteInputStreamCommand.
RemoteInputStreamCommand(Map<String,Object> commandParameters)
          Constructor for RemoteInputStreamCommand.
 
Method Summary
protected  CommandType buildCommandType()
          Builds the command type of this command.
protected  ParameterDefinition[] buildParameterDefinitions()
          Builds the set of parameter definitions that this command will use.
 org.jboss.remoting.invocation.NameBasedInvocation getNameBasedInvocation()
          Gets the invocation information that describes what needs to be invoked on the remote POJO.
 Long getStreamId()
          Get the opaque ID object used to identify the input stream that is being invoked by this command.
 boolean isCommandInResponse()
          The RemoteInputStreamCommandResponse must have the command in it in order to support its mimicing of pass-by-reference semantics since the command contains the byte buffer that will contain the bytes when reading the stream.
 void setCommandInResponse(boolean flag)
          The RemoteInputStreamCommandResponse must have the command in it in order to support its mimicing of pass-by-reference semantics since the command contains the byte buffer that will contain the bytes when reading the stream.
 void setNameBasedInvocation(org.jboss.remoting.invocation.NameBasedInvocation invocation)
          Sets the invocation information that describes what needs to be invoked on the remote POJO.
 void setStreamId(Long id)
          Sets the opaque ID object used to identify the input stream that is being invoked by this command.
 
Methods inherited from class org.rhq.enterprise.communications.command.AbstractCommand
allowAnyParameter, checkParameterValidity, convertParameters, getCommandType, getConfiguration, getParameterDefinition, getParameterDefinitions, getParameterValue, getParameterValues, getParameterValuesInternalMap, hasParameterValue, initializeMetadata, removeParameterValue, removeParameterValues, setParameterValue, setParameterValuesInternalMap, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COMMAND_TYPE

public static final CommandType COMMAND_TYPE
command type constant identifying this type of command


PARAM_INVOCATION

public static final ParameterDefinition PARAM_INVOCATION
the required command parameter name containing the NameBasedInvocation object to describe what method to invoke on the remote stream.


PARAM_STREAM_ID

public static final ParameterDefinition PARAM_STREAM_ID
the required command parameter name containing the opaque identification object used to specify the particular input stream that is to be invoked.

Constructor Detail

RemoteInputStreamCommand

public RemoteInputStreamCommand()
                         throws IllegalArgumentException,
                                InvalidParameterDefinitionException
Constructor for RemoteInputStreamCommand.

Throws:
IllegalArgumentException
InvalidParameterDefinitionException
See Also:
AbstractCommand.AbstractCommand()

RemoteInputStreamCommand

public RemoteInputStreamCommand(Map<String,Object> commandParameters)
                         throws IllegalArgumentException,
                                InvalidParameterDefinitionException
Constructor for RemoteInputStreamCommand.

Throws:
IllegalArgumentException
InvalidParameterDefinitionException
See Also:
AbstractCommand.AbstractCommand(Map)

RemoteInputStreamCommand

public RemoteInputStreamCommand(Command commandToTransform)
Constructor for RemoteInputStreamCommand.

See Also:
AbstractCommand.AbstractCommand(Command)
Method Detail

getNameBasedInvocation

public org.jboss.remoting.invocation.NameBasedInvocation getNameBasedInvocation()
Gets the invocation information that describes what needs to be invoked on the remote POJO.

Returns:
the invocation information

setNameBasedInvocation

public void setNameBasedInvocation(org.jboss.remoting.invocation.NameBasedInvocation invocation)
Sets the invocation information that describes what needs to be invoked on the remote POJO.

Parameters:
invocation - the invocation information

getStreamId

public Long getStreamId()
Get the opaque ID object used to identify the input stream that is being invoked by this command.

Returns:
stream identifier

setStreamId

public void setStreamId(Long id)
Sets the opaque ID object used to identify the input stream that is being invoked by this command.

Parameters:
id - stream identifier

isCommandInResponse

public boolean isCommandInResponse()
The RemoteInputStreamCommandResponse must have the command in it in order to support its mimicing of pass-by-reference semantics since the command contains the byte buffer that will contain the bytes when reading the stream. Therefore, this method forces its return value to be true always.

Specified by:
isCommandInResponse in interface Command
Overrides:
isCommandInResponse in class AbstractCommand
Returns:
true
See Also:
Command.isCommandInResponse()

setCommandInResponse

public void setCommandInResponse(boolean flag)
The RemoteInputStreamCommandResponse must have the command in it in order to support its mimicing of pass-by-reference semantics since the command contains the byte buffer that will contain the bytes when reading the stream. Therefore, this method forces the command-in-response flag to true, no matter that flag's value is.

Specified by:
setCommandInResponse in interface Command
Overrides:
setCommandInResponse in class AbstractCommand
Parameters:
flag - true to get this object returned with the command response.
See Also:
AbstractCommand.setCommandInResponse(boolean)

buildCommandType

protected CommandType buildCommandType()
Description copied from class: AbstractCommand
Builds the command type of this command. It must not be null.

This method is called by the command's constructors.

Specified by:
buildCommandType in class AbstractCommand
Returns:
the command's type definition; must not be null
See Also:
AbstractCommand.buildCommandType()

buildParameterDefinitions

protected ParameterDefinition[] buildParameterDefinitions()
Description copied from class: AbstractCommand
Builds the set of parameter definitions that this command will use. Parameter definitions define what parameters this command accepts. Implementors must return one of the following:

This method is called by the command's constructors.

Specified by:
buildParameterDefinitions in class AbstractCommand
Returns:
an array of parameter definitions or null
See Also:
AbstractCommand.buildParameterDefinitions()


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.