GemFire 5.5

com.gemstone.gemfire.cache.util
Class GatewayEventCallbackArgument

java.lang.Object
  extended by com.gemstone.gemfire.cache.util.GatewayEventCallbackArgument
All Implemented Interfaces:
DataSerializable, Serializable

public class GatewayEventCallbackArgument
extends Object
implements DataSerializable

Class GatewayEventCallbackArgument is a wrapper on a callback arg plus the id of the GatewayHub making the request. It is created during a batch update request so that the hub id is passed to the GatewayHub so that events are not re-distributed back to the originating GatewayHub, but are distributed to other GatewayHubs. The original callback arg is wrapped by this one and replaced in the event sent to CacheListener, CacheWriter and CacheLoader.

Since:
4.2.1
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.gemstone.gemfire.DataSerializable
DataSerializable.Replaceable
 
Constructor Summary
GatewayEventCallbackArgument()
          No arg constructor for DataSerializable.
GatewayEventCallbackArgument(GatewayEventCallbackArgument geca)
          Creates a copy of the given GatewayEventCallbackArgument that shares invariant state with the original.
GatewayEventCallbackArgument(Object originalCallbackArg)
          Constructor.
GatewayEventCallbackArgument(Object originalCallbackArg, String originatingGatewayHubId, List originalRecipientGateways)
          Constructor.
 
Method Summary
 void fromData(DataInput in)
          Reads the state of this object as primitive data from the given DataInput.
 Object getOriginalCallbackArg()
          Returns the original callback argument.
 String getOriginatingGatewayHubId()
          Returns the id of the originating GatewayHub making the request.
 Set getRecipientGateways()
          Returns the list of Gateway s to which the event has been sent.
 void initializeRecipientGateways(List originalRecipientGateways)
          Initialize the original set of recipient Gateways.
 void setOriginatingGatewayHubId(String originatingGatewayHubId)
          Sets the originating GatewayHub id
 void setRecipientGateways(Set recipientGateways)
          Sets the list of Gateway s to which the event has been sent
 void toData(DataOutput out)
          Writes the state of this object as primitive data to the given DataOutput.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GatewayEventCallbackArgument

public GatewayEventCallbackArgument()
No arg constructor for DataSerializable.


GatewayEventCallbackArgument

public GatewayEventCallbackArgument(Object originalCallbackArg)
Constructor.

Parameters:
originalCallbackArg - The original callback argument set by the caller or null if there was not callback arg

GatewayEventCallbackArgument

public GatewayEventCallbackArgument(Object originalCallbackArg,
                                    String originatingGatewayHubId,
                                    List originalRecipientGateways)
Constructor.

Parameters:
originalCallbackArg - The original callback argument set by the caller or null if there was not callback arg
originatingGatewayHubId - The id of the originating GatewayHub making the request
originalRecipientGateways - The list of Gateway s to which the event has been originally sent

GatewayEventCallbackArgument

public GatewayEventCallbackArgument(GatewayEventCallbackArgument geca)
Creates a copy of the given GatewayEventCallbackArgument that shares invariant state with the original.

Parameters:
geca - the object to be copied
Method Detail

getOriginalCallbackArg

public Object getOriginalCallbackArg()
Returns the original callback argument.

Returns:
the original callback argument

getOriginatingGatewayHubId

public String getOriginatingGatewayHubId()
Returns the id of the originating GatewayHub making the request.

Returns:
the id of the originating GatewayHub making the request

setOriginatingGatewayHubId

public void setOriginatingGatewayHubId(String originatingGatewayHubId)
Sets the originating GatewayHub id

Parameters:
originatingGatewayHubId - The originating GatewayHub id

getRecipientGateways

public Set getRecipientGateways()
Returns the list of Gateway s to which the event has been sent.

Returns:
the list of Gateway s to which the event has been sent

setRecipientGateways

public void setRecipientGateways(Set recipientGateways)
Sets the list of Gateway s to which the event has been sent

Parameters:
recipientGateways - The list of Gateway s to which the event has been sent

initializeRecipientGateways

public void initializeRecipientGateways(List originalRecipientGateways)
Initialize the original set of recipient Gateways.

Parameters:
originalRecipientGateways - The original recipient Gateways.

toData

public void toData(DataOutput out)
            throws IOException
Description copied from interface: DataSerializable
Writes the state of this object as primitive data to the given DataOutput.

Specified by:
toData in interface DataSerializable
Throws:
IOException - A problem occurs while writing to out

fromData

public void fromData(DataInput in)
              throws IOException,
                     ClassNotFoundException
Description copied from interface: DataSerializable
Reads the state of this object as primitive data from the given DataInput.

Specified by:
fromData in interface DataSerializable
Throws:
IOException - A problem occurs while reading from in
ClassNotFoundException - A class could not be loaded while reading from in

toString

public String toString()
Overrides:
toString in class Object

GemFire 5.5

Copyright © 2002-2008 GemStone Systems, Inc. All Rights Reserved.