Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question
0

Data/Domain Object with List

Hello,

I have a data object that I'm writing to space. It has the following properties.

public class Marker {

private Integer partitionNumber ;

public String feederStatus;
public List<String> sessionKeyList;

public String getFeederStatus() {
    return feederStatus;
}

public void setFeederStatus(String feederStatus) {
    this.feederStatus = feederStatus;
}

public List<String> getSessionKeyList() {
    if (sessionKeyList == null) {
        sessionKeyList = new ArrayList<String>();
    }
    return sessionKeyList;
}

public void setSessionKeyList(List<String> sessionKeyList) {
    this.sessionKeyList = sessionKeyList;
}

@SpaceRouting
public Integer getPartitionNumber() {
    return partitionNumber;
}

public void setPartitionNumber(Integer partitionNumber) {
    this.partitionNumber = partitionNumber;
}

}

And my polling container config XML:

<os-events:polling-container id="feederServiceAsyncContainer" giga-space="gigaSpace"> <os-core:template> <bean class="com.processor.marker.Marker"> <property name="feederStatus" value="Marker.KICK_IN_FEEDER"/> </bean> </os-core:template> <os-events:listener> <os-events:annotation-adapter> <os-events:delegate ref="Feeder"/> </os-events:annotation-adapter> </os-events:listener> </os-events:polling-container>

The above Space Data Event (Polling Container) receives the Marker when my client writes to space as long as I don't set the ArrayList to setSessionKeyList(List<string> sessionKeyList).

When I set the sessionKeyList with an ArrayList, the template is not matching and Space Data Event is not receiving any Marker object. Documentaion says null value should match with any value.

Kindly help me to understand the matching behaviour in case of List.

Thanks, Lakshmi

Edited by: Lakshmi Chennuri on Dec 27, 2008 2:29 PM

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=2784]{quote}

asked 2008-12-27 14:27:50 -0600

lakshminc gravatar image

updated 2013-08-08 09:52:00 -0600

jaissefsfex gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

GigaSpaces do not match List data type.
Make sure the template sessionKeyList field will be null. The simplest way is to make its initial value as null and have default no arg constructor. This will make sure the template will match any incoming object which got feederStatus=KICK IN FEEDER.

If u still have problems please post a test case.

Shay

answered 2008-12-27 18:24:19 -0600

shay hassidim gravatar image
edit flag offensive delete link more

Comments

Thanks a lot, Shay!

I added the following no arg constructor to the data object, which did the magic.

public Marker(){ this.partitionNumber = null; this.feederStatus = null; this.sessionKeyList = null; }

Thanks again.

+Lakshmi

lakshminc gravatar imagelakshminc ( 2008-12-27 22:03:02 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2008-12-27 14:27:50 -0600

Seen: 50 times

Last updated: Dec 27 '08