Examples of MessageRecoveryListener


Examples of org.apache.activemq.store.MessageRecoveryListener

    public Message[] browse() {
        final Set<Message> result = new CopyOnWriteArraySet<Message>();
        try {
            if (topicStore != null) {
                topicStore.recover(new MessageRecoveryListener() {
                    public boolean recoverMessage(Message message) throws Exception {
                        result.add(message);
                        return true;
                    }
View Full Code Here

Examples of org.apache.activemq.store.MessageRecoveryListener

        this.longTermStore = checkpointStore;
    }
   
    public void recoverSubscription(String clientId, String subscriptionName, final MessageRecoveryListener listener) throws Exception {
        this.peristenceAdapter.checkpoint(true, true);
        longTermStore.recoverSubscription(clientId, subscriptionName, new MessageRecoveryListener() {
            public void recoverMessage(Message message) throws Exception {
                throw new IOException("Should not get called.");
            }
            public void recoverMessageReference(String messageReference) throws Exception {
                RecordLocation loc = toRecordLocation(messageReference);
View Full Code Here

Examples of org.apache.activemq.store.MessageRecoveryListener

    }
   
    public void recoverNextMessages(String clientId,String subscriptionName,MessageId lastMessageId, int maxReturned,final MessageRecoveryListener listener) throws Exception{
        this.peristenceAdapter.checkpoint(true, true);
        longTermStore.recoverNextMessages(clientId, subscriptionName, lastMessageId,maxReturned,new MessageRecoveryListener() {
            public void recoverMessage(Message message) throws Exception {
                throw new IOException("Should not get called.");
            }
            public void recoverMessageReference(String messageReference) throws Exception {
                RecordLocation loc = toRecordLocation(messageReference);
View Full Code Here

Examples of org.apache.activemq.store.MessageRecoveryListener

     * @param listener
     * @throws Exception
     */
    public void recover(final MessageRecoveryListener listener) throws Exception {
        peristenceAdapter.checkpoint(true, true);
        longTermStore.recover(new MessageRecoveryListener() {
            public void recoverMessage(Message message) throws Exception {
                throw new IOException("Should not get called.");
            }
            public void recoverMessageReference(String messageReference) throws Exception {
                RecordLocation loc = toRecordLocation(messageReference);
View Full Code Here

Examples of org.apache.activemq.store.MessageRecoveryListener

        PersistenceAdapter adapter = ((DestinationFactoryImpl)destinationFactory).getPersistenceAdapter();
        final List result=new ArrayList();
        try{
            ActiveMQTopic topic=new ActiveMQTopic(view.getDestinationName());
            TopicMessageStore store=adapter.createTopicMessageStore(topic);
            store.recover(new MessageRecoveryListener(){
                public void recoverMessage(Message message) throws Exception{
                    result.add(message);
                }

                public void recoverMessageReference(String messageReference) throws Exception{}
View Full Code Here

Examples of org.apache.activemq.store.MessageRecoveryListener

        PersistenceAdapter adapter = ((DestinationFactoryImpl)destinationFactory).getPersistenceAdapter();
        final List<Message> result = new ArrayList<Message>();
        try {
            ActiveMQTopic topic = new ActiveMQTopic(view.getDestinationName());
            TopicMessageStore store = adapter.createTopicMessageStore(topic);
            store.recover(new MessageRecoveryListener() {
                public boolean recoverMessage(Message message) throws Exception {
                    result.add(message);
                    return true;
                }
View Full Code Here

Examples of org.apache.activemq.store.MessageRecoveryListener

            }
   
            final MessageEvaluationContext msgContext = new MessageEvaluationContext();
            msgContext.setDestination(destination);
            if(subscription.isRecoveryRequired()){
                store.recoverSubscription(clientId,subscriptionName,new MessageRecoveryListener(){
                    public void recoverMessage(Message message) throws Exception{
                        message.setRegionDestination(Topic.this);
                        try{
                            msgContext.setMessageReference(message);
                            if(subscription.matches(message,msgContext)){
View Full Code Here

Examples of org.apache.activemq.store.MessageRecoveryListener

   
    public Message[] browse(){
        final Set result=new CopyOnWriteArraySet();
        try{
            if(store!=null){
                store.recover(new MessageRecoveryListener(){
                    public void recoverMessage(Message message) throws Exception{
                        result.add(message);
                    }

                    public void recoverMessageReference(String messageReference) throws Exception{}
View Full Code Here

Examples of org.apache.activemq.store.MessageRecoveryListener

    }
   
    public void initialize() throws Exception {
        if (store != null) {
            // Restore the persistent messages.
            store.recover(new MessageRecoveryListener() {
                public void recoverMessage(Message message) {
                    message.setRegionDestination(Queue.this);
                    MessageReference reference = createMessageReference(message);
                    synchronized (messages) {
                        try{
View Full Code Here

Examples of org.apache.activemq.store.MessageRecoveryListener

            messages.setMaxAuditDepth(getMaxAuditDepth());
            messages.setMaxProducersToAudit(getMaxProducersToAudit());
            messages.setUseCache(isUseCache());
            messages.setMemoryUsageHighWaterMark(getCursorMemoryHighWaterMark());
            if (messages.isRecoveryRequired()) {
                store.recover(new MessageRecoveryListener() {

                    public boolean recoverMessage(Message message) {
                        // Message could have expired while it was being
                        // loaded..
                        if (message.isExpired()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.