Package org.apache.activegroups.command

Examples of org.apache.activegroups.command.MapRequest


     */
    public Serializable broadcastMessageRequest(Object message, long timeout)
            throws JMSException {
        checkStatus();
        Object result = null;
        MapRequest request = new MapRequest();
        String id = this.idGenerator.generateId();
        synchronized (this.messageRequests) {
            this.messageRequests.put(id, request);
        }
        ObjectMessage objMsg = this.stateSession
                .createObjectMessage((Serializable) message);
        objMsg.setJMSReplyTo(this.inboxTopic);
        objMsg.setJMSCorrelationID(id);
        objMsg.setJMSType(MESSAGE_TYPE);
        objMsg.setStringProperty(MEMBER_ID_PROPERTY, this.local.getId());
        this.messageProducer.send(this.messageQueue, objMsg);
        result = request.get(timeout);
        return (Serializable) result;
    }
View Full Code Here


     */
    public Object sendMessageRequest(Member member, Object message, long timeout)
            throws JMSException {
        checkStatus();
        Object result = null;
        MapRequest request = new MapRequest();
        String id = this.idGenerator.generateId();
        synchronized (this.messageRequests) {
            this.messageRequests.put(id, request);
        }
        ObjectMessage objMsg = this.stateSession
                .createObjectMessage((Serializable) message);
        objMsg.setJMSReplyTo(this.inboxTopic);
        objMsg.setJMSCorrelationID(id);
        objMsg.setJMSType(MESSAGE_TYPE);
        objMsg.setStringProperty(MEMBER_ID_PROPERTY, this.local.getId());
        this.messageProducer.send(member.getInBoxDestination(), objMsg);
        result = request.get(timeout);
        return result;
    }
View Full Code Here

        return list;
    }

    Object sendStateRequest(Member member, Serializable payload) {
        Object result = null;
        MapRequest request = new MapRequest();
        String id = this.idGenerator.generateId();
        synchronized (this.stateRequests) {
            this.stateRequests.put(id, request);
        }
        try {
            ObjectMessage objMsg = this.stateSession
                    .createObjectMessage(payload);
            objMsg.setJMSReplyTo(this.inboxTopic);
            objMsg.setJMSCorrelationID(id);
            objMsg.setJMSType(STATE_TYPE);
            this.stateProducer.send(member.getInBoxDestination(), objMsg);
            result = request.get(getHeartBeatInterval());
        } catch (JMSException e) {
            if (this.started.get()) {
                LOG.error("Failed to send request " + payload, e);
            }
        }
View Full Code Here

        return result;
    }

    void sendAsyncStateRequest(AsyncMapRequest asyncRequest, Member member,
            Serializable payload) {
        MapRequest request = new MapRequest();
        String id = this.idGenerator.generateId();
        asyncRequest.add(id, request);
        synchronized (this.stateRequests) {
            this.stateRequests.put(id, request);
        }
View Full Code Here

        }
    }

    void processRequest(String id, Object value) {
        if (id != null) {
            MapRequest result = null;
            synchronized (this.stateRequests) {
                result = this.stateRequests.remove(id);
            }
            if (result != null) {
                result.put(id, value);
            }
        }
    }
View Full Code Here

        Member member = this.members.get(memberId);
        if (member != null) {
            fireMemberMessage(member, replyId, payload);
        }
        if (replyId != null) {
            MapRequest result = null;
            synchronized (this.messageRequests) {
                result = this.messageRequests.remove(replyId);
            }
            if (result != null) {
                result.put(replyId, payload);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.activegroups.command.MapRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.