Ignore:
Timestamp:
07/08/13 13:29:24 (11 years ago)
Author:
stoda
Message:

J

Location:
trunk/src/main/java/omq/server
Files:
3 edited

Legend:

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

    r63 r83  
    1616
    1717/**
     18 * An invocationThread waits for requests an invokes them.
    1819 *
    1920 * @author Sergi Toda <sergi.toda@estudiants.urv.cat>
  • trunk/src/main/java/omq/server/RemoteObject.java

    r77 r83  
    2323
    2424/**
     25 * A RemoteObject when it's started will be waiting for requests and will invoke
     26 * them. When a RemoteObject is started it listens two queues, the first one has
     27 * the same name as its reference and the second one is its multiqueue -this
     28 * name can be set using a property, be aware to use a name not used by another
     29 * object!!!-.
    2530 *
    2631 * @author Sergi Toda <sergi.toda@estudiants.urv.cat>
     
    5863        }
    5964
     65        /**
     66         * This method starts a remoteObject.
     67         *
     68         * @param reference
     69         *            - broker's binding referece
     70         * @param broker
     71         *            - broker that binds this remoteObject
     72         * @param env
     73         *            - properties of this remoteObject
     74         * @throws Exception
     75         */
    6076        public void startRemoteObject(String reference, Broker broker, Properties env) throws Exception {
    6177                this.broker = broker;
     
    8197                // Start this listener
    8298                this.start();
    83         }
    84 
    85         public void startTriggerEvent(String reference, Broker broker) throws Exception {
    86                 this.broker = broker;
    87                 UID = reference;
    88                 if (channel == null || !channel.isOpen()) {
    89                         channel = broker.getChannel();
    90                 }
    9199        }
    92100
     
    133141        }
    134142
     143        /**
     144         * This method kills all the threads waiting for requests
     145         *
     146         * @throws IOException
     147         *             - If an operation failed.
     148         */
    135149        public void kill() throws IOException {
    136150                logger.warn("Killing objectmq: " + this.getRef());
     
    141155        }
    142156
     157        /**
     158         * This method invokes the method specified by methodName and arguments
     159         *
     160         * @param methodName
     161         * @param arguments
     162         * @return result
     163         * @throws Exception
     164         */
    143165        public Object invokeMethod(String methodName, Object[] arguments) throws Exception {
    144166
     
    149171        }
    150172
     173        /**
     174         * This method loads the method specified by methodName and args
     175         *
     176         * @param methodName
     177         * @param args
     178         * @return method
     179         * @throws NoSuchMethodException
     180         *             - If the method cannot be found
     181         */
    151182        private Method loadMethod(String methodName, Object[] args) throws NoSuchMethodException {
    152183                Method m = null;
     
    171202        }
    172203
     204        /**
     205         * This method loads a method which uses primitives as arguments
     206         *
     207         * @param methodName
     208         *            - name of the method wanted to invoke
     209         * @param argArray
     210         *            - arguments
     211         * @return method
     212         * @throws NoSuchMethodException
     213         *             - If the method cannot be found
     214         */
    173215        private Method loadMethodWithPrimitives(String methodName, Class<?>[] argArray) throws NoSuchMethodException {
    174216                if (argArray != null) {
     
    213255        }
    214256
     257        /**
     258         * This method starts the queues using the information got in the
     259         * environment.
     260         *
     261         * @throws Exception
     262         */
    215263        private void startQueues() throws Exception {
    216264                // Get info about which exchange and queue will use
  • trunk/src/main/java/omq/server/RemoteWrapper.java

    r53 r83  
    1313
    1414/**
     15 * This class is used to encapsulate the invocationThreads under the
     16 * RemoteObject.
    1517 *
    1618 * @author Sergi Toda <sergi.toda@estudiants.urv.cat>
     
    4042        }
    4143
     44        /**
     45         * This method notifies a delivery to an invocationThread using a
     46         * blockingQueue.
     47         *
     48         * @param delivery
     49         *            - delivery which contains a Request to be invoked
     50         * @throws Exception
     51         */
    4252        public void notifyDelivery(Delivery delivery) throws Exception {
    4353                this.deliveryQueue.put(delivery);
    4454        }
    4555
     56        /**
     57         * This method interrups all the invocationThreads under this remoteWrapper
     58         */
    4659        public void stopRemoteWrapper() {
    4760                logger.warn("Stopping Invocation threads vinculed to " + obj.getRef());
Note: See TracChangeset for help on using the changeset viewer.