001    /**
002     * Licensed to the Apache Software Foundation (ASF) under one or more
003     * contributor license agreements.  See the NOTICE file distributed with
004     * this work for additional information regarding copyright ownership.
005     * The ASF licenses this file to You under the Apache License, Version 2.0
006     * (the "License"); you may not use this file except in compliance with
007     * the License.  You may obtain a copy of the License at
008     *
009     *      http://www.apache.org/licenses/LICENSE-2.0
010     *
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS,
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     * See the License for the specific language governing permissions and
015     * limitations under the License.
016     */
017    
018    package org.apache.activemq.openwire.v2;
019    
020    import org.apache.activemq.openwire.DataStreamMarshaller;
021    import org.apache.activemq.openwire.OpenWireFormat;
022    
023    /**
024     * MarshallerFactory for Open Wire Format.
025     *
026     *
027     * NOTE!: This file is auto generated - do not modify!
028     *        if you need to make a change, please see the modify the groovy scripts in the
029     *        under src/gram/script and then use maven openwire:generate to regenerate 
030     *        this file.
031     *
032     * 
033     */
034    public final class MarshallerFactory {
035    
036        /**
037         * Creates a Map of command type -> Marshallers
038         */
039        private static final DataStreamMarshaller MARSHALLER[] = new DataStreamMarshaller[256];
040        static {
041    
042            add(new ActiveMQBytesMessageMarshaller());
043            add(new ActiveMQMapMessageMarshaller());
044            add(new ActiveMQMessageMarshaller());
045            add(new ActiveMQObjectMessageMarshaller());
046            add(new ActiveMQQueueMarshaller());
047            add(new ActiveMQStreamMessageMarshaller());
048            add(new ActiveMQTempQueueMarshaller());
049            add(new ActiveMQTempTopicMarshaller());
050            add(new ActiveMQTextMessageMarshaller());
051            add(new ActiveMQTopicMarshaller());
052            add(new BrokerIdMarshaller());
053            add(new BrokerInfoMarshaller());
054            add(new ConnectionControlMarshaller());
055            add(new ConnectionErrorMarshaller());
056            add(new ConnectionIdMarshaller());
057            add(new ConnectionInfoMarshaller());
058            add(new ConsumerControlMarshaller());
059            add(new ConsumerIdMarshaller());
060            add(new ConsumerInfoMarshaller());
061            add(new ControlCommandMarshaller());
062            add(new DataArrayResponseMarshaller());
063            add(new DataResponseMarshaller());
064            add(new DestinationInfoMarshaller());
065            add(new DiscoveryEventMarshaller());
066            add(new ExceptionResponseMarshaller());
067            add(new FlushCommandMarshaller());
068            add(new IntegerResponseMarshaller());
069            add(new JournalQueueAckMarshaller());
070            add(new JournalTopicAckMarshaller());
071            add(new JournalTraceMarshaller());
072            add(new JournalTransactionMarshaller());
073            add(new KeepAliveInfoMarshaller());
074            add(new LastPartialCommandMarshaller());
075            add(new LocalTransactionIdMarshaller());
076            add(new MessageAckMarshaller());
077            add(new MessageDispatchMarshaller());
078            add(new MessageDispatchNotificationMarshaller());
079            add(new MessageIdMarshaller());
080            add(new MessagePullMarshaller());
081            add(new NetworkBridgeFilterMarshaller());
082            add(new PartialCommandMarshaller());
083            add(new ProducerIdMarshaller());
084            add(new ProducerInfoMarshaller());
085            add(new RemoveInfoMarshaller());
086            add(new RemoveSubscriptionInfoMarshaller());
087            add(new ReplayCommandMarshaller());
088            add(new ResponseMarshaller());
089            add(new SessionIdMarshaller());
090            add(new SessionInfoMarshaller());
091            add(new ShutdownInfoMarshaller());
092            add(new SubscriptionInfoMarshaller());
093            add(new TransactionInfoMarshaller());
094            add(new WireFormatInfoMarshaller());
095            add(new XATransactionIdMarshaller());
096    
097        }
098    
099        private MarshallerFactory() {        
100        }
101    
102        private static void add(DataStreamMarshaller dsm) {
103            MARSHALLER[dsm.getDataStructureType()] = dsm;
104        }
105        
106        public static DataStreamMarshaller[] createMarshallerMap(OpenWireFormat wireFormat) {
107            return MARSHALLER;
108        }
109    }