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
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/supervisor/src/main/java/omq/Remote.java

    r82 r105  
    1717
    1818        /**
    19          * Returns the UID of a RemoteObject
     19         * Returns the reference of a RemoteObject
    2020         *
    21          * @return UID
     21         * @return reference
    2222         */
    2323        public String getRef();
  • 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
  • branches/supervisor/src/main/java/omq/server/InvocationThread.java

    r102 r105  
    3535        // RemoteObject
    3636        private RemoteObject obj;
    37         private String UID;
     37        private String reference;
    3838        private Properties env;
    3939        private boolean idle;
     
    5454        public InvocationThread(RemoteObject obj) throws Exception {
    5555                this.obj = obj;
    56                 this.UID = obj.getRef();
     56                this.reference = obj.getRef();
    5757                this.env = obj.getEnv();
    5858                this.broker = obj.getBroker();
     
    176176                // Get info about which exchange and queue will use
    177177                String exchange = env.getProperty(ParameterQueue.RPC_EXCHANGE, "");
    178                 String queue = UID;
    179                 String routingKey = UID;
     178                String queue = reference;
     179                String routingKey = reference;
    180180
    181181                // RemoteObject default queue
     
    192192                        channel.queueBind(queue, exchange, routingKey);
    193193                }
    194                 logger.info("RemoteObject: " + UID + " declared direct exchange: " + exchange + ", Queue: " + queue + ", Durable: " + durable + ", Exclusive: "
     194                logger.info("RemoteObject: " + reference + " declared direct exchange: " + exchange + ", Queue: " + queue + ", Durable: " + durable + ", Exclusive: "
    195195                                + exclusive + ", AutoDelete: " + autoDelete);
    196196
     
    200200
    201201                // Get info about the multiQueue
    202                 String multiExchange = multi + UID;
    203                 // TODO:String multiExchange = multi + exchange + UID;
     202                String multiExchange = multi + reference;
     203                // TODO:String multiExchange = multi + exchange + reference;
    204204                multiQueue = env.getProperty(ParameterQueue.MULTI_QUEUE_NAME);
    205205
     
    217217                }
    218218                channel.queueBind(multiQueue, multiExchange, "");
    219                 logger.info("RemoteObject: " + UID + " declared fanout exchange: " + multiExchange + ", Queue: " + multiQueue + ", Durable: " + multiDurable
     219                logger.info("RemoteObject: " + reference + " declared fanout exchange: " + multiExchange + ", Queue: " + multiQueue + ", Durable: " + multiDurable
    220220                                + ", Exclusive: " + multiExclusive + ", AutoDelete: " + multiAutoDelete);
    221221
     
    236236
    237237        public void kill() throws IOException {
    238                 logger.info("Killing objectmq: " + UID + " thread id");
     238                logger.info("Killing objectmq: " + reference + " thread id");
    239239                killed = true;
    240240                interrupt();
  • branches/supervisor/src/main/java/omq/server/RemoteObject.java

    r101 r105  
    3030        private static final Logger logger = Logger.getLogger(RemoteObject.class.getName());
    3131
    32         private String UID;
     32        private String reference;
    3333        private Properties env;
    3434        private transient Broker broker;
     
    6161        public void startRemoteObject(String reference, Broker broker, Properties env) throws Exception {
    6262                this.broker = broker;
    63                 this.UID = reference;
     63                this.reference = reference;
    6464                this.env = env;
    6565
     
    8787        @Override
    8888        public String getRef() {
    89                 return UID;
     89                return reference;
    9090        }
    9191
Note: See TracChangeset for help on using the changeset viewer.