Ignore:
Timestamp:
10/18/13 16:09:36 (11 years ago)
Author:
stoda
Message:

abans que la segueixi liant...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/supervisor/src/main/java/omq/common/broker/Broker.java

    r99 r106  
    240240        }
    241241
     242        public void bind(String reference, String UID, RemoteObject remote) throws RemoteException, AlreadyBoundException {
     243                bind(reference, UID, remote, environment);
     244        }
     245
    242246        /**
    243247         * Binds the reference to the specified remote object. This function uses
     
    264268                try {
    265269                        remote.startRemoteObject(reference, this, env);
     270                        remoteObjs.put(reference, remote);
     271                } catch (Exception e) {
     272                        throw new RemoteException(e);
     273                }
     274        }
     275
     276        public void bind(String reference, String UID, RemoteObject remote, Properties env) throws RemoteException, AlreadyBoundException {
     277                if (remoteObjs.containsKey(reference)) {
     278                        throw new AlreadyBoundException(reference);
     279                }
     280                // Try to start the remtoeObject listeners
     281                try {
     282                        remote.startRemoteObject(reference, UID, this, env);
    266283                        remoteObjs.put(reference, remote);
    267284                } catch (Exception e) {
     
    400417         * Supervisor
    401418         */
    402         public void setSupervisor(String supervisorName, String brokerName) throws Exception {
     419        public void setSupervisor(String supervisorName, String brokerSet, String brokerName) throws Exception {
    403420                // Create a RemoteBrokerImpl
    404                 bind(brokerName, new RemoteBrokerImpl());
     421                bind(brokerSet, brokerName, new RemoteBrokerImpl());
    405422                // Subscribe broker
    406423                supervisor = lookup(supervisorName, Supervisor.class);
    407                 supervisor.subscribe(brokerName);
    408                 logger.info("Supervisor set: " + supervisorName + ", BrokerName: " + brokerName);
     424                supervisor.subscribe(brokerSet, brokerName);
     425                logger.info("Supervisor set: " + supervisorName + ", BrokerSet: " + brokerSet + ", BrokerName: " + brokerName);
    409426        }
    410427
Note: See TracChangeset for help on using the changeset viewer.