Ignore:
Timestamp:
06/20/13 16:57:39 (11 years ago)
Author:
stoda
Message:

Non static broker
TODO: change all test to see whether the new broker configuration works

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/main/java/omq/server/RemoteObject.java

    r49 r53  
    3939        private String UID;
    4040        private Properties env;
     41        private transient Broker broker;
     42        private transient Serializer serializer;
    4143        private transient RemoteWrapper remoteWrapper;
    4244        private transient Map<String, List<Class<?>>> params;
     
    6062        }
    6163
    62         public void startRemoteObject(String reference, Properties env) throws Exception {
    63                 this.UID = reference;
    64                 this.env = env;
     64        public void startRemoteObject(String reference, Broker broker) throws Exception {
     65                this.broker = broker;
     66                UID = reference;
     67                env = broker.getEnvironment();
     68                serializer = broker.getSerializer();
    6569
    6670                params = new HashMap<String, List<Class<?>>>();
     
    7579                // Get num threads to use
    7680                int numThreads = Integer.parseInt(env.getProperty(ParameterQueue.NUM_THREADS, "1"));
    77                 remoteWrapper = new RemoteWrapper(this, numThreads);
     81                remoteWrapper = new RemoteWrapper(this, numThreads, broker.getSerializer());
    7882
    7983                startQueues();
     
    130134                EventWrapper wrapper = new EventWrapper(event);
    131135                channel.exchangeDeclare(UID, "fanout");
    132                 channel.basicPublish(UID, "", null, Serializer.serialize(wrapper));
     136                channel.basicPublish(UID, "", null, serializer.serialize(wrapper));
    133137        }
    134138
     
    221225
    222226                // Start channel
    223                 channel = Broker.getNewChannel();
     227                channel = broker.getNewChannel();
    224228
    225229                // Declares and bindings
Note: See TracChangeset for help on using the changeset viewer.