Changeset 74
- Timestamp:
- 07/01/13 12:47:42 (11 years ago)
- Location:
- trunk/src
- Files:
-
- 5 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/main/java/omq/common/broker/Broker.java
r72 r74 162 162 163 163 public void bind(String reference, RemoteObject remote) throws RemoteException { 164 try { 165 remote.startRemoteObject(reference, this); 166 remoteObjs.put(reference, remote); 167 } catch (Exception e) { 168 throw new RemoteException(e); 169 } 170 } 171 172 public void startTriggerEvent(String reference, RemoteObject remote) throws RemoteException { 173 try { 174 remote.startTriggerEvent(reference, this); 164 bind(reference, remote, environment); 165 } 166 167 public void bind(String reference, RemoteObject remote, Properties env) throws RemoteException { 168 try { 169 remote.startRemoteObject(reference, this, env); 175 170 remoteObjs.put(reference, remote); 176 171 } catch (Exception e) { -
trunk/src/main/java/omq/server/RemoteObject.java
r72 r74 58 58 } 59 59 60 public void startRemoteObject(String reference, Broker broker ) throws Exception {60 public void startRemoteObject(String reference, Broker broker, Properties env) throws Exception { 61 61 this.broker = broker; 62 UID = reference;63 multiQueue = UID + System.currentTimeMillis();64 env = broker.getEnvironment();65 66 params = new HashMap<String, List<Class<?>>>();62 this.UID = reference; 63 this.multiQueue = UID + System.currentTimeMillis(); 64 this.env = env; 65 66 this.params = new HashMap<String, List<Class<?>>>(); 67 67 for (Method m : this.getClass().getMethods()) { 68 68 List<Class<?>> list = new ArrayList<Class<?>>(); … … 70 70 list.add(clazz); 71 71 } 72 params.put(m.getName(), list);72 this.params.put(m.getName(), list); 73 73 } 74 74 75 75 // Get num threads to use 76 76 int numThreads = Integer.parseInt(env.getProperty(ParameterQueue.NUM_THREADS, "1")); 77 remoteWrapper = new RemoteWrapper(this, numThreads, broker.getSerializer());77 this.remoteWrapper = new RemoteWrapper(this, numThreads, broker.getSerializer()); 78 78 79 79 startQueues(); … … 227 227 228 228 // Declares and bindings 229 logger.info("RemoteObject: " + UID + " declaring direct exchange: " + exchange + ", Queue: " + queue );229 logger.info("RemoteObject: " + UID + " declaring direct exchange: " + exchange + ", Queue: " + queue + ", Durable: " + durable); 230 230 channel.exchangeDeclare(exchange, "direct"); 231 231 channel.queueDeclare(queue, durable, false, false, null); 232 232 channel.queueBind(queue, exchange, routingKey); 233 233 234 logger.info("RemoteObject: " + UID + " declaring fanout exchange: " + multiExchange + ", Queue: " + multiQueue + ", Durable: " + durable); 234 235 channel.exchangeDeclare(multiExchange, "fanout"); 235 236 channel.queueDeclare(multiQueue, durable, false, false, null); 236 237 channel.queueBind(multiQueue, multiExchange, ""); 237 238 // Declare the event topic fanout239 logger.info("RemoteObject: " + UID + " declaring fanout exchange: " + UID);240 channel.exchangeDeclare(UID, "fanout");241 238 242 239 // Declare a new consumer
Note: See TracChangeset
for help on using the changeset viewer.