Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 // Copyright (c) P. Taylor Goetz (ptgoetz@gmail.com)
 
 package backtype.storm.contrib.signals.spout;
 
 import java.util.Map;
 
 import  org.slf4j.Logger;
 import  org.slf4j.LoggerFactory;
 
import  backtype.storm.spout.SpoutOutputCollector;
import  backtype.storm.task.TopologyContext;
import  backtype.storm.topology.OutputFieldsDeclarer;
import  backtype.storm.topology.base.BaseRichSpout;
public abstract class BaseSignalSpout extends BaseRichSpout implements SignalListener {
    private static final Logger LOG = LoggerFactory.getLogger(BaseSignalSpout.class);
    private String name;
    public BaseSignalSpout(String name) {
        this. = name;
    }
    @SuppressWarnings("rawtypes")
    @Override
    public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) {
        try {
            this. = new StormSignalConnection(this.this);
            this..init(conf);
        } catch (Exception e) {
            .error("Error creating SignalConnection."e);
        }
    }
    
    public void sendSignal(String toPathbyte[] signal)throws Exception {
        this..send(toPathsignal);
    }
    @Override
    public void close() {
        super.close();
        this..close();
    }
New to GrepCode? Check out our FAQ X