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.v1;
019    
020    import org.apache.activemq.openwire.DataStreamMarshaller;
021    import org.apache.activemq.openwire.OpenWireFormat;
022    
023    /**
024     * MarshallerFactory for Open Wire Format. NOTE!: This file is auto generated -
025     * do not modify! if you need to make a change, please see the modify the groovy
026     * scripts in the under src/gram/script and then use maven openwire:generate to
027     * regenerate this file.
028     * 
029     * 
030     */
031    public final class MarshallerFactory {
032    
033        /**
034         * Creates a Map of command type -> Marshallers
035         */
036        private static final DataStreamMarshaller MARSHALLER[] = new DataStreamMarshaller[256];
037        static {
038    
039            add(new LocalTransactionIdMarshaller());
040            add(new PartialCommandMarshaller());
041            add(new IntegerResponseMarshaller());
042            add(new ActiveMQQueueMarshaller());
043            add(new ActiveMQObjectMessageMarshaller());
044            add(new ConnectionIdMarshaller());
045            add(new ConnectionInfoMarshaller());
046            add(new ProducerInfoMarshaller());
047            add(new MessageDispatchNotificationMarshaller());
048            add(new SessionInfoMarshaller());
049            add(new TransactionInfoMarshaller());
050            add(new ActiveMQStreamMessageMarshaller());
051            add(new MessageAckMarshaller());
052            add(new ProducerIdMarshaller());
053            add(new MessageIdMarshaller());
054            add(new ActiveMQTempQueueMarshaller());
055            add(new RemoveSubscriptionInfoMarshaller());
056            add(new SessionIdMarshaller());
057            add(new DataArrayResponseMarshaller());
058            add(new JournalQueueAckMarshaller());
059            add(new ResponseMarshaller());
060            add(new ConnectionErrorMarshaller());
061            add(new ConsumerInfoMarshaller());
062            add(new XATransactionIdMarshaller());
063            add(new JournalTraceMarshaller());
064            add(new ConsumerIdMarshaller());
065            add(new ActiveMQTextMessageMarshaller());
066            add(new SubscriptionInfoMarshaller());
067            add(new JournalTransactionMarshaller());
068            add(new ControlCommandMarshaller());
069            add(new LastPartialCommandMarshaller());
070            add(new NetworkBridgeFilterMarshaller());
071            add(new ActiveMQBytesMessageMarshaller());
072            add(new WireFormatInfoMarshaller());
073            add(new ActiveMQTempTopicMarshaller());
074            add(new DiscoveryEventMarshaller());
075            add(new ReplayCommandMarshaller());
076            add(new ActiveMQTopicMarshaller());
077            add(new BrokerInfoMarshaller());
078            add(new DestinationInfoMarshaller());
079            add(new ShutdownInfoMarshaller());
080            add(new DataResponseMarshaller());
081            add(new ConnectionControlMarshaller());
082            add(new KeepAliveInfoMarshaller());
083            add(new FlushCommandMarshaller());
084            add(new ConsumerControlMarshaller());
085            add(new JournalTopicAckMarshaller());
086            add(new BrokerIdMarshaller());
087            add(new MessageDispatchMarshaller());
088            add(new ActiveMQMapMessageMarshaller());
089            add(new ActiveMQMessageMarshaller());
090            add(new RemoveInfoMarshaller());
091            add(new ExceptionResponseMarshaller());
092    
093        }
094    
095        private MarshallerFactory() {        
096        }
097    
098        private static void add(DataStreamMarshaller dsm) {
099            MARSHALLER[dsm.getDataStructureType()] = dsm;
100        }
101    
102        public static DataStreamMarshaller[] createMarshallerMap(OpenWireFormat wireFormat) {
103            return MARSHALLER;
104        }
105    }