Ignore:
Timestamp:
10/16/13 16:19:02 (11 years ago)
Author:
stoda
Message:

UID changed to reference
TODO: add UID

Location:
branches/supervisor/src/main/java/omq/client/proxy
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/supervisor/src/main/java/omq/client/proxy/MultiProxymq.java

    r99 r105  
    2525        private static final String multi = "multi#";
    2626
    27         private String uid;
     27        private String reference;
    2828        private Broker broker;
    2929        private Serializer serializer;
     
    3333        private transient String serializerType;
    3434
    35         public MultiProxymq(String uid, Class<?> clazz, Broker broker) throws Exception {
    36                 this.uid = uid;
     35        public MultiProxymq(String reference, Class<?> clazz, Broker broker) throws Exception {
     36                this.reference = reference;
    3737                this.broker = broker;
    3838                serializer = broker.getSerializer();
    3939
    4040                Properties env = broker.getEnvironment();
    41                 exchange = multi + uid;
     41                exchange = multi + reference;
    4242                serializerType = env.getProperty(ParameterQueue.PROXY_SERIALIZER, Serializer.JAVA);
    4343        }
     
    5252
    5353                // Add the correlation ID and create a replyTo property
    54                 BasicProperties props = new BasicProperties.Builder().appId(uid).correlationId(corrId).type(serializerType).build();
     54                BasicProperties props = new BasicProperties.Builder().appId(reference).correlationId(corrId).type(serializerType).build();
    5555
    5656                byte[] bytesRequest = serializer.serialize(serializerType, request);
    5757                broker.publishMessge(exchange, routingkey, props, bytesRequest);
    5858
    59                 logger.debug("Proxymq: " + uid + " invokes " + methodName + ", corrID" + corrId + ", exchange: " + exchange + ", replyQueue: " + replyQueueName
     59                logger.debug("Proxymq: " + reference + " invokes " + methodName + ", corrID" + corrId + ", exchange: " + exchange + ", replyQueue: " + replyQueueName
    6060                                + ", serializerType: " + serializerType + ", multi call: " + request.isMulti() + ", async call: " + request.isAsync());
    6161
  • branches/supervisor/src/main/java/omq/client/proxy/Proxymq.java

    r104 r105  
    4646        private static final String multi = "multi#";
    4747
    48         private String uid;
     48        private String reference;
    4949        private transient String exchange;
    5050        private transient String multiExchange;
     
    7272         * Proxymq Constructor.
    7373         *
    74          * This constructor uses an uid to know which object will call. It also uses
     74         * This constructor uses an reference to know which object will call. It also uses
    7575         * Properties to set where to send the messages
    7676         *
    77          * @param uid
    78          *            The uid represents the unique identifier of a remote object
     77         * @param reference
     78         *            The reference represents the unique identifier of a remote object
    7979         * @param clazz
    8080         *            It represents the real class of the remote object. With this
     
    8585         * @throws Exception
    8686         */
    87         public Proxymq(String uid, Class<?> clazz, Broker broker) throws Exception {
    88                 this.uid = uid;
     87        public Proxymq(String reference, Class<?> clazz, Broker broker) throws Exception {
     88                this.reference = reference;
    8989                this.broker = broker;
    9090                rListener = broker.getResponseListener();
     
    9595                env = broker.getEnvironment();
    9696                exchange = env.getProperty(ParameterQueue.RPC_EXCHANGE, "");
    97                 multiExchange = multi + uid;
     97                multiExchange = multi + reference;
    9898                replyQueueName = env.getProperty(ParameterQueue.RPC_REPLY_QUEUE);
    9999
     
    165165                } else {
    166166                        exchange = this.exchange;
    167                         routingkey = uid;
     167                        routingkey = reference;
    168168                }
    169169
    170170                // Add the correlation ID and create a replyTo property
    171                 BasicProperties props = new BasicProperties.Builder().appId(uid).correlationId(corrId).replyTo(replyQueueName).type(serializerType)
     171                BasicProperties props = new BasicProperties.Builder().appId(reference).correlationId(corrId).replyTo(replyQueueName).type(serializerType)
    172172                                .deliveryMode(deliveryMode).build();
    173173
     
    175175                byte[] bytesRequest = serializer.serialize(serializerType, request);
    176176                broker.publishMessge(exchange, routingkey, props, bytesRequest);
    177                 logger.debug("Proxymq: " + uid + " invokes '" + request.getMethod() + "' , corrID: " + corrId + ", exchange: " + exchange + ", replyQueue: "
     177                logger.debug("Proxymq: " + reference + " invokes '" + request.getMethod() + "' , corrID: " + corrId + ", exchange: " + exchange + ", replyQueue: "
    178178                                + replyQueueName + ", serializerType: " + serializerType + ", multi call: " + request.isMulti() + ", async call: " + request.isAsync()
    179179                                + ", delivery mode: " + deliveryMode);
     
    359359        @Override
    360360        public String getRef() {
    361                 return uid;
     361                return reference;
    362362        }
    363363
Note: See TracChangeset for help on using the changeset viewer.