Example usage for org.springframework.data.gemfire.listener ContinuousQueryDefinition isDurable

List of usage examples for org.springframework.data.gemfire.listener ContinuousQueryDefinition isDurable

Introduction

In this page you can find the example usage for org.springframework.data.gemfire.listener ContinuousQueryDefinition isDurable.

Prototype

public boolean isDurable() 

Source Link

Document

Determines whether the CQ is durable.

Usage

From source file:org.springframework.data.gemfire.listener.ContinuousQueryListenerContainer.java

private CqQuery addCQuery(ContinuousQueryDefinition def) {
    try {/*from  www. j  a v  a2s  . c  om*/
        CqAttributesFactory caf = new CqAttributesFactory();
        caf.addCqListener(new EventDispatcherAdapter(def.getListener()));
        CqAttributes attr = caf.create();

        CqQuery cq = null;

        if (StringUtils.hasText(def.getName())) {
            cq = queryService.newCq(def.getName(), def.getQuery(), attr, def.isDurable());
        } else {
            cq = queryService.newCq(def.getQuery(), attr, def.isDurable());
        }

        queries.add(cq);
        return cq;
    } catch (RuntimeException ex) {
        throw new GemfireQueryException("Cannot create query ", ex);
    } catch (QueryException ex) {
        throw new GemfireQueryException("Cannot create query ", ex);
    }
}