All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.tinkerpop.rexster.client.RexsterClientHandler Maven / Gradle / Ivy

There is a newer version: 2.6.0
Show newest version
package com.tinkerpop.rexster.client;

import com.tinkerpop.rexster.protocol.msg.RexProMessage;
import org.glassfish.grizzly.filterchain.BaseFilter;
import org.glassfish.grizzly.filterchain.FilterChainContext;
import org.glassfish.grizzly.filterchain.NextAction;

import java.io.IOException;

/**
 * @author Stephen Mallette (http://stephen.genoprime.com)
 */
public class RexsterClientHandler extends BaseFilter {
    private RexsterClient client;

    public void setClient(final RexsterClient client) {
         this.client = client;
    }

    public NextAction handleRead(FilterChainContext ctx) throws IOException {
        try {
            client.putResponse((RexProMessage) ctx.getMessage());
        }
        catch (Exception e) {
            e.printStackTrace();
        }

        return ctx.getStopAction();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy