001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.messaging;
016    
017    import java.util.Set;
018    
019    /**
020     * @author Shuyang Zhou
021     */
022    public class DestinationWrapper implements Destination {
023    
024            public DestinationWrapper(Destination destination) {
025                    this.destination = destination;
026            }
027    
028            @Override
029            public void addDestinationEventListener(
030                    DestinationEventListener destinationEventListener) {
031    
032                    destination.addDestinationEventListener(destinationEventListener);
033            }
034    
035            @Override
036            public void close() {
037                    destination.close();
038            }
039    
040            @Override
041            public void close(boolean force) {
042                    destination.close(force);
043            }
044    
045            @Override
046            public void copyDestinationEventListeners(Destination destination) {
047                    this.destination.copyDestinationEventListeners(destination);
048            }
049    
050            @Override
051            public void copyMessageListeners(Destination destination) {
052                    this.destination.copyMessageListeners(destination);
053            }
054    
055            @Override
056            public DestinationStatistics getDestinationStatistics() {
057                    return destination.getDestinationStatistics();
058            }
059    
060            @Override
061            public int getMessageListenerCount() {
062                    return destination.getMessageListenerCount();
063            }
064    
065            @Override
066            public Set<MessageListener> getMessageListeners() {
067                    return destination.getMessageListeners();
068            }
069    
070            @Override
071            public String getName() {
072                    return destination.getName();
073            }
074    
075            @Override
076            public boolean isRegistered() {
077                    return destination.isRegistered();
078            }
079    
080            @Override
081            public void open() {
082                    destination.open();
083            }
084    
085            @Override
086            public boolean register(MessageListener messageListener) {
087                    return destination.register(messageListener);
088            }
089    
090            @Override
091            public boolean register(
092                    MessageListener messageListener, ClassLoader classloader) {
093    
094                    return destination.register(messageListener, classloader);
095            }
096    
097            @Override
098            public void removeDestinationEventListener(
099                    DestinationEventListener destinationEventListener) {
100    
101                    destination.removeDestinationEventListener(destinationEventListener);
102            }
103    
104            @Override
105            public void removeDestinationEventListeners() {
106                    destination.removeDestinationEventListeners();
107            }
108    
109            @Override
110            public void send(Message message) {
111                    destination.send(message);
112            }
113    
114            @Override
115            public boolean unregister(MessageListener messageListener) {
116                    return destination.unregister(messageListener);
117            }
118    
119            @Override
120            public void unregisterMessageListeners() {
121                    destination.unregisterMessageListeners();
122            }
123    
124            protected Destination destination;
125    
126    }