// Path: porcupine/src/main/java/com/airhacks/porcupine/execution/entity/Rejection.java
// @XmlRootElement
// @XmlAccessorType(XmlAccessType.FIELD)
// public class Rejection {
// 
//     private Statistics statistics;
//     private String taskClass;
// 
//     public Rejection(Statistics statistics, String taskClass) {
//         this.statistics = statistics;
//         this.taskClass = taskClass;
//     }
// 
//     public Rejection() {
//     }
// 
//     public Statistics getStatistics() {
//         return statistics;
//     }
// 
//     public String getTaskClass() {
//         return taskClass;
//     }
// 
//     @Override
//     public String toString() {
//         return "Rejection{" + "statistics=" + statistics + ", taskClass=" + taskClass + '}';
//     }
// }


import com.airhacks.porcupine.execution.entity.Rejection;
import javax.ejb.Singleton;
import javax.enterprise.event.Observes;
import javax.websocket.OnClose;
import javax.websocket.OnOpen;
import javax.websocket.Session;
import javax.websocket.server.ServerEndpoint;
package com.airhacks.threading.statistics.boundary;


/**
 *
 * @author airhacks.com
 */
@Singleton
@ServerEndpoint("/rejections")
public class RejectionsNotifier {

    private Session session;

    @OnOpen
    public void open(Session session) {
        this.session = session;
    }

    @OnClose
    public void close() {
        this.session = null;
    }

// Path: porcupine/src/main/java/com/airhacks/porcupine/execution/entity/Rejection.java
// @XmlRootElement
// @XmlAccessorType(XmlAccessType.FIELD)
// public class Rejection {
// 
//     private Statistics statistics;
//     private String taskClass;
// 
//     public Rejection(Statistics statistics, String taskClass) {
//         this.statistics = statistics;
//         this.taskClass = taskClass;
//     }
// 
//     public Rejection() {
//     }
// 
//     public Statistics getStatistics() {
//         return statistics;
//     }
// 
//     public String getTaskClass() {
//         return taskClass;
//     }
// 
//     @Override
//     public String toString() {
//         return "Rejection{" + "statistics=" + statistics + ", taskClass=" + taskClass + '}';
//     }
// }


// Path: porcupine-sample/src/main/java/com/airhacks/threading/statistics/boundary/RejectionsNotifier.java
import com.airhacks.porcupine.execution.entity.Rejection;
import javax.ejb.Singleton;
import javax.enterprise.event.Observes;
import javax.websocket.OnClose;
import javax.websocket.OnOpen;
import javax.websocket.Session;
import javax.websocket.server.ServerEndpoint;

package com.airhacks.threading.statistics.boundary;


/**
 *
 * @author airhacks.com
 */
@Singleton
@ServerEndpoint("/rejections")
public class RejectionsNotifier {

    private Session session;

    @OnOpen
    public void open(Session session) {
        this.session = session;
    }

    @OnClose
    public void close() {
        this.session = null;
    }

    public void onNewRejection(@Observes Rejection rejectedTask) {