KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > proactive > Service


1 /*
2 * ################################################################
3 *
4 * ProActive: The Java(TM) library for Parallel, Distributed,
5 * Concurrent computing with Security and Mobility
6 *
7 * Copyright (C) 1997-2002 INRIA/University of Nice-Sophia Antipolis
8 * Contact: proactive-support@inria.fr
9 *
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or any later version.
14 *
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23 * USA
24 *
25 * Initial developer(s): The ProActive Team
26 * http://www.inria.fr/oasis/ProActive/contacts.html
27 * Contributor(s):
28 *
29 * ################################################################
30 */

31 package org.objectweb.proactive;
32
33 import org.objectweb.proactive.core.body.request.BlockingRequestQueue;
34 import org.objectweb.proactive.core.body.request.Request;
35 import org.objectweb.proactive.core.body.request.RequestFilter;
36 import org.objectweb.proactive.core.body.request.RequestProcessor;
37
38
39 /**
40  * <P>
41  * Service is a utility class that provides many useful methods to serve requests.
42  * It is usually instantiated once at the begining of the runActivity() method of
43  * an active object in order to be used for serving requests. For instance :
44  * </P><P>
45  * <pre>
46  * public void runActivity(org.objectweb.proactive.Body body) {
47  * org.objectweb.proactive.Service service = new org.objectweb.proactive.Service(body);
48  * ...
49  * }
50  * </pre>
51  * For intance the live method of the bounded buffer example :
52  * <pre>
53  * public void runActivity(org.objectweb.proactive.Body body) {
54  * org.objectweb.proactive.Service service = new org.objectweb.proactive.Service(body);
55  * while (body.isActive()) {
56  * if (count == 0) {
57  * // if the buffer is empty
58  * service.blockingServeOldest("put"); // Serve the first buffer.put call
59  * } else if (count == size) {
60  * // if the buffer is full
61  * service.blockingServeOldest("get"); // Serve the first buffer.get call
62  * } else {
63  * // if the buffer is neither empty nor full
64  * service.blockingServeOldest(); // Serve the first buffer.xxx call
65  * }
66  * }
67  * }
68  * </pre>
69  *
70  * </P>
71  * @author ProActive Team
72  * @version 1.0, 2001/10/23
73  * @since ProActive 0.9
74  * @see RunActive
75  *
76  */

77 public class Service {
78   
79   //
80
// -- PROTECTED MEMBERS -----------------------------------------------
81
//
82

83   protected Body body;
84   protected BlockingRequestQueue requestQueue;
85
86
87   //
88
// -- CONSTRUCTORS -----------------------------------------------
89
//
90

91   /**
92    * Creates a new intance of Service based on the given body.
93    * @param body the body that helper service is for.
94    */

95   public Service(Body body) {
96     this.body = body;
97     this.requestQueue = body.getRequestQueue();
98   }
99   
100   
101   //
102
// -- PUBLIC METHODS -----------------------------------------------
103
//
104

105
106   /**
107    * Serves the request given in parameter
108    * @param request the request to be served
109    */

110   public String JavaDoc toString() {
111     return "Service\n Body="+body.toString()+"\n RequestQueue="+requestQueue.toString();
112   }
113
114
115   /**
116    * Serves the request given in parameter
117    * @param request the request to be served
118    */

119   public void serve(Request request) {
120     body.serve(request);
121   }
122
123
124   /**
125    * Invoke the default FIFO policy to pick up the requests from the request queue.
126    * This does not return until the body terminate, as the active thread enters in
127    * an infinite loop for processing the request in the FIFO order.
128    */

129   public void fifoServing() {
130     while (body.isActive()) {
131       blockingServeOldest();
132     }
133   }
134
135
136   /**
137    * Invoke the LIFO policy to pick up the requests from the request queue.
138    * This does not return until the body terminate, as the active thread enters in
139    * an infinite loop for processing the request in the LIFO order.
140    */

141   public void lifoServing() {
142     while (body.isActive()) {
143       blockingServeYoungest();
144     }
145   }
146
147
148   // -- Serve Oldest ---------------------------------------------------
149

150   /**
151    * Serves the oldest request in the request queue.
152    * The method blocks if there is no request until one request is
153    * received or until the body terminates.
154    */

155   public void blockingServeOldest() {
156     body.serve(requestQueue.blockingRemoveOldest());
157   }
158
159
160   /**
161    * Serves the oldest request in request queue.
162    * The method blocks if there is no request until one request is
163    * received or until the body terminates. The method does not block
164    * more than the given timeout.
165    * @param timeout how long the thread can be blocked for.
166    */

167   public void blockingServeOldest(long timeout) {
168     body.serve(requestQueue.blockingRemoveOldest(timeout));
169   }
170
171
172   /**
173    * Serves the oldest request for a method of name <code>methodName</code>.
174    * The method blocks if there is no matching request until one
175    * matching request is received or until the body terminates.
176    * @param methodName The name of the request to serve
177    */

178   public void blockingServeOldest(String JavaDoc methodName) {
179     body.serve(requestQueue.blockingRemoveOldest(methodName));
180   }
181
182
183   /**
184    * Serves the oldest request matching the criteria given be the filter.
185    * The method blocks if there is no matching request until one
186    * matching request is received or until the body terminates.
187    * @param requestFilter The request filter accepting the request
188    */

189   public void blockingServeOldest(RequestFilter requestFilter) {
190     body.serve(requestQueue.blockingRemoveOldest(requestFilter));
191   }
192
193
194   /**
195    * Serves the oldest request in the request queue. If there is no
196    * request, the method returns with no effect.
197    */

198   public void serveOldest() {
199     body.serve(requestQueue.removeOldest());
200   }
201
202
203   /**
204    * Serves the oldest request for a method of name methodName.
205    * If no matching request is found, the method returns with no effect.
206    * @param methodName The name of the request to serve
207    */

208   public void serveOldest(String JavaDoc methodName) {
209     body.serve(requestQueue.removeOldest(methodName));
210   }
211
212
213   /**
214    * Serves the oldest request matching the criteria given be the filter.
215    * If no matching request is found, the method returns with no effect.
216    * @param requestFilter The request filter accepting the request
217    */

218   public void serveOldest(RequestFilter requestFilter) {
219     body.serve(requestQueue.removeOldest(requestFilter));
220   }
221
222   
223
224   // -- Serve Youngest ---------------------------------------------------
225

226   /**
227    * Serves the youngest request in the request queue.
228    * The method blocks if there is no request until one request is
229    * received or until the body terminates.
230    */

231   public void blockingServeYoungest() {
232     body.serve(requestQueue.blockingRemoveYoungest());
233   }
234
235
236   /**
237    * Serves the youngest request in request queue.
238    * The method blocks if there is no request until one request is
239    * received or until the body terminates. The method does not block
240    * more than the given timeout.
241    * @param timeout how long the thread can be blocked for.
242    */

243   public void blockingServeYoungest(long timeout) {
244     body.serve(requestQueue.blockingRemoveYoungest(timeout));
245   }
246
247
248   /**
249    * Serves the youngest request for a method of name <code>methodName</code>.
250    * The method blocks if there is no matching request until one
251    * matching request is received or until the body terminates.
252    * @param methodName The name of the request to serve
253    */

254   public void blockingServeYoungest(String JavaDoc methodName) {
255     body.serve(requestQueue.blockingRemoveYoungest(methodName));
256   }
257
258
259   /**
260    * Serves the youngest request matching the criteria given be the filter.
261    * The method blocks if there is no matching request until one
262    * matching request is received or until the body terminates.
263    * @param requestFilter The request filter accepting the request
264    */

265   public void blockingServeYoungest(RequestFilter requestFilter) {
266     body.serve(requestQueue.blockingRemoveYoungest(requestFilter));
267   }
268
269
270   /**
271    * Serves the youngest request in the request queue. If there is no
272    * request, the method returns with no effect.
273    */

274   public void serveYoungest() {
275     body.serve(requestQueue.removeYoungest());
276   }
277
278
279   /**
280    * Serves the youngest request for a method of name methodName.
281    * If no matching request is found, the method returns with no effect.
282    * @param methodName The name of the request to serve
283    */

284   public void serveYoungest(String JavaDoc methodName) {
285     body.serve(requestQueue.removeYoungest(methodName));
286   }
287
288
289   /**
290    * Serves the youngest request matching the criteria given be the filter.
291    * If no matching request is found, the method returns with no effect.
292    * @param requestFilter The request filter accepting the request
293    */

294   public void serveYoungest(RequestFilter requestFilter) {
295     body.serve(requestQueue.removeYoungest(requestFilter));
296   }
297   
298
299
300   // -- Serve All ---------------------------------------------------
301

302   /**
303    * Serves all requests for the method named <code>methodName</code>.
304    * If there is no request matching the method name,
305    * no request is served.
306    * All served requests are removed from the RequestQueue.
307    * @param methodName The name of the request to serve
308    */

309   public void serveAll(String JavaDoc methodName) {
310     serveAll(new RequestFilterOnMethodName(methodName));
311   }
312
313
314   /**
315    * Serves all requests accepted by the given filter.
316    * All served requests are removed from the RequestQueue.
317    * @param requestFilter The request filter accepting the request
318    */

319   public void serveAll(RequestFilter requestFilter) {
320     requestQueue.processRequests(new ServingRequestProcessor(requestFilter), body);
321   }
322   
323
324
325   // -- Serve And Flush Youngest ---------------------------------------------------
326

327   /**
328    * Serves the youngest request and discard all other requests.
329    * After the call the youngest request is served and the request
330    * queue is empty.
331    * If the request queue is already empty before the call the method
332    * has no effect
333    */

334   public void flushingServeYoungest() {
335     flushingServeYoungest(new AcceptAllRequestFilter());
336   }
337
338
339   /**
340    * Serves the most recent request (youngest) for the method named <code>methodName</code>
341    * and discards all the other requests of the same name. The most recent
342    * request is the one served.
343    * If there is no match, no request is served or removed.
344    * All requests of method name <code>methodName</code> are removed from the
345    * request queue.
346    * @param methodName The name of the request to serve and flush
347    */

348   public void flushingServeYoungest(String JavaDoc methodName) {
349     flushingServeYoungest(new RequestFilterOnMethodName(methodName));
350   }
351
352
353   /**
354    * Serves the most recent request (youngest) accepted by the given filter
355    * and discards all the other requests also accepted by this sasme filter.
356    * The most recent request is the one served.
357    * If there is no match, no request is served or removed.
358    * All requests accepted by the filter are removed from the request queue.
359    * @param requestFilter The request filter accepting requests
360    */

361   public void flushingServeYoungest(RequestFilter requestFilter) {
362     requestQueue.processRequests(new FlushingServeYoungestRequestProcessor(requestFilter), body);
363   }
364
365
366
367   // -- Serve And Flush Oldest ---------------------------------------------------
368

369   /**
370    * Serves the oldest request and discard all other requests.
371    * After the call the oldest request is served and the request
372    * queue is empty.
373    * If the request queue is already empty before the call the method
374    * has no effect
375    */

376   public void flushingServeOldest() {
377     flushingServeOldest(new AcceptAllRequestFilter());
378   }
379
380
381   /**
382    * Serves the oldest request for the method named <code>methodName</code>
383    * and discards all the other requests of the same name. The oldest
384    * request is the one served.
385    * If there is no match, no request is served or removed.
386    * All requests of method name <code>methodName</code> are removed from the
387    * request queue.
388    * @param methodName The name of the request to serve and flush
389    */

390   public void flushingServeOldest(String JavaDoc methodName) {
391     flushingServeOldest(new RequestFilterOnMethodName(methodName));
392   }
393
394
395   /**
396    * Serves the oldest request accepted by the given filter
397    * and discards all the other requests also accepted by this sasme filter.
398    * The oldest request is the one served.
399    * If there is no match, no request is served or removed.
400    * All requests accepted by the filter are removed from the request queue.
401    * @param requestFilter The request filter accepting requests
402    */

403   public void flushingServeOldest(RequestFilter requestFilter) {
404     requestQueue.processRequests(new FlushingServeOldestRequestProcessor(requestFilter), body);
405   }
406
407
408
409   // -- Other helpers methods ---------------------------------------------------
410

411   /**
412    * blocks until a request is available or until the body terminate
413    */

414   public void waitForRequest() {
415     requestQueue.waitForRequest();
416   }
417
418   
419   /**
420    * true if and only if at least one request is available
421    * @return true if a request is available, false else.
422    */

423   public boolean hasRequestToServe() {
424     return ! requestQueue.isEmpty();
425   }
426   
427
428   /**
429    * Returns the number of request(s) in the queue
430    * @return the number of request(s) in the queue.
431    */

432   public int getRequestCount() {
433     return requestQueue.size();
434   }
435
436
437   /**
438    * Removes all request from the queue. No request is served.
439    */

440   public void flushAll() {
441     requestQueue.clear();
442   }
443   
444
445   //
446
// -- getOldests ---------------------------------------------------
447
//
448

449   /**
450    * Returns the oldest request from the queue or null if the queue is empty
451    * The request queue is unchanged by this call
452    * @return the oldest request or null
453    */

454   public Request getOldest() {
455     return requestQueue.getOldest();
456   }
457
458
459   /**
460    * Returns the oldest request whose method name is s or null if no match
461    * The request queue is unchanged by this call
462    * @param methodName the name of the method to look for
463    * @return the oldest matching request or null
464    */

465   public Request getOldest(String JavaDoc methodName) {
466     return requestQueue.getOldest(methodName);
467   }
468
469
470   /**
471    * Returns the oldest request that matches the criteria defined by the given filter
472    * The request queue is unchanged by this call
473    * @param requestFilter the filter accepting request on a given criteria
474    * @return the oldest matching request or null
475    */

476   public Request getOldest(RequestFilter requestFilter) {
477     return requestQueue.getOldest(requestFilter);
478   }
479
480
481
482   /**
483    * Returns the oldest request from the queue
484    * If no request is available the method block until one request can be returned
485    * The request queue is unchanged by this call
486    * @return the oldest request or null
487    */

488   public Request blockingGetOldest() {
489     Request request = null;
490     while (request == null && ! requestQueue.isDestroyed()) {
491       waitForRequest();
492       request = requestQueue.getOldest();
493     }
494     return request;
495   }
496
497
498   //
499
// -- getYoungests ---------------------------------------------------
500
//
501

502   /**
503    * Returns the youngest request from the queue or null if the queue is empty
504    * The request queue is unchanged by this call
505    * @return the youngest request or null
506    */

507   public Request getYoungest() {
508     return requestQueue.getYoungest();
509   }
510
511
512   /**
513    * Returns the youngest request whose method name is s or null if no match
514    * The request queue is unchanged by this call
515    * @param methodName the name of the method to look for
516    * @return the youngest matching request or null
517    */

518   public Request getYoungest(String JavaDoc methodName) {
519     return requestQueue.getYoungest(methodName);
520   }
521
522
523   /**
524    * Returns the youngest request that matches the criteria defined by the given filter
525    * The request queue is unchanged by this call
526    * @param requestFilter the filter accepting request on a given criteria
527    * @return the youngest matching request or null
528    */

529   public Request getYoungest(RequestFilter requestFilter) {
530     return requestQueue.getYoungest(requestFilter);
531   }
532
533
534   /**
535    * Returns the oldest request from the queue
536    * If no request is available the method block until one request can be returned
537    * The request queue is unchanged by this call
538    * @return the oldest request or null
539    */

540   public Request blockingGetYoungest() {
541     Request request = null;
542     while (request == null && ! requestQueue.isDestroyed()) {
543       waitForRequest();
544       request = requestQueue.getYoungest();
545     }
546     return request;
547   }
548
549
550
551   //
552
// -- blockingRemoveOldests ---------------------------------------------------
553
//
554

555
556   /**
557    * Blocks the calling thread until there is a request that can be accepted
558    * be the given RequestFilter.
559    * Returns immediately if there is already one. The request returned is non
560    * null unless the thread has been asked not to wait anymore.
561    * @param requestFilter the request filter that select the request to be returned
562    * @return the oldest request found in the queue that is accepted by the filter.
563    */

564   public Request blockingRemoveOldest(RequestFilter requestFilter) {
565     return requestQueue.blockingRemoveOldest(requestFilter);
566   }
567
568   /**
569    * Blocks the calling thread until there is a request of name methodName
570    * Returns immediately if there is already one. The request returned is non
571    * null unless the thread has been asked not to wait anymore.
572    * @param methodName the name of the method to wait for
573    * @return the oldest request of name methodName found in the queue.
574    */

575   public Request blockingRemoveOldest(String JavaDoc methodName) {
576     return requestQueue.blockingRemoveOldest(methodName);
577   }
578
579   /**
580    * Blocks the calling thread until there is a request available
581    * Returns immediately if there is already one. The request returned is non
582    * null unless the thread has been asked not to wait anymore.
583    * @return the oldest request found in the queue.
584    */

585   public Request blockingRemoveOldest() {
586     return requestQueue.blockingRemoveOldest();
587   }
588
589   /**
590    * Blocks the calling thread until there is a request available but try
591    * to limit the time the thread is blocked to timeout.
592    * Returns immediately if there is already one. The request returned is non
593    * null if a request has been found during the given time.
594    * @return the oldest request found in the queue or null.
595    */

596   public Request blockingRemoveOldest(long timeout) {
597     return requestQueue.blockingRemoveOldest(timeout);
598   }
599
600
601
602   //
603
// -- blockingRemoveYoungests ---------------------------------------------------
604
//
605

606   /**
607    * Blocks the calling thread until there is a request that can be accepted
608    * be the given RequestFilter.
609    * Returns immediately if there is already one. The request returned is non
610    * null unless the thread has been asked not to wait anymore.
611    * @param requestFilter the request filter that select the request to be returned
612    * @return the youngest request found in the queue that is accepted by the filter.
613    */

614   public Request blockingRemoveYoungest(RequestFilter requestFilter) {
615     return requestQueue.blockingRemoveYoungest(requestFilter);
616   }
617
618   /**
619    * Blocks the calling thread until there is a request of name methodName
620    * Returns immediately if there is already one. The request returned is non
621    * null unless the thread has been asked not to wait anymore.
622    * @param methodName the name of the method to wait for
623    * @return the youngest request of name methodName found in the queue.
624    */

625   public Request blockingRemoveYoungest(String JavaDoc methodName) {
626     return requestQueue.blockingRemoveYoungest(methodName);
627   }
628
629   /**
630    * Blocks the calling thread until there is a request available
631    * Returns immediately if there is already one. The request returned is non
632    * null unless the thread has been asked not to wait anymore.
633    * @return the youngest request found in the queue.
634    */

635   public Request blockingRemoveYoungest() {
636     return requestQueue.blockingRemoveYoungest();
637   }
638
639   /**
640    * Blocks the calling thread until there is a request available but try
641    * to limit the time the thread is blocked to timeout.
642    * Returns immediately if there is already one. The request returned is non
643    * null if a request has been found during the given time.
644    * @return the youngest request found in the queue or null.
645    */

646   public Request blockingRemoveYoungest(long timeout) {
647     return requestQueue.blockingRemoveYoungest(timeout);
648   }
649
650
651   //
652
// -- INNER CLASSES -----------------------------------------------
653
//
654

655
656   /**
657    * ServingRequestProcessor is a simple RequestProcessor that serves and removes
658    * all requests accepted by a given RequestFilter
659    *
660    * @author ProActive Team
661    * @version 1.0, 2001/10/23
662    * @since ProActive 0.9
663    * @see RequestProcessor
664    *
665    */

666   protected class ServingRequestProcessor implements RequestProcessor {
667   
668     /** the filter*/
669     private RequestFilter selectorRequestFilter;
670     
671     public ServingRequestProcessor(RequestFilter selectorRequestFilter) {
672       this.selectorRequestFilter = selectorRequestFilter;
673     }
674     
675     /**
676      * Processes the request and returns true if the request can be discarded
677      * after processing.
678      * @param request the request to process
679      * @return true if the request can be discarded (removed from the
680      * container it is stored), false if it has to be kept.
681      */

682     public int processRequest(Request request) {
683       if (selectorRequestFilter.acceptRequest(request)) {
684         return REMOVE_AND_SERVE;
685       } else {
686         return KEEP;
687       }
688     }
689   } // end inner class ServingRequestProcessor
690

691
692
693
694
695   /**
696    * FlushingServeYoungestRequestProcessor is a RequestProcessor that serves
697    * only the youngest request accepted by the given RequestFilter and removes
698    * all other requests accepted by that same Filter
699    *
700    * @author ProActive Team
701    * @version 1.0, 2001/10/23
702    * @since ProActive 0.9
703    * @see RequestProcessor
704    *
705    */

706   protected class FlushingServeYoungestRequestProcessor implements RequestProcessor {
707     private RequestFilter selectorRequestFilter;
708     private Request requestToServe;
709     private int counter;
710     private int numberOfRequests;
711     
712     public FlushingServeYoungestRequestProcessor(RequestFilter selectorRequestFilter) {
713       this.selectorRequestFilter = selectorRequestFilter;
714     }
715     
716     /**
717      * Processes the request and returns true if the request can be discarded
718      * after processing.
719      * @param request the request to process
720      * @return true if the request can be discarded (removed from the
721      * container it is stored), false if it has to be kept.
722      */

723     public int processRequest(Request request) {
724       if (counter == 0) {
725         // first call
726
numberOfRequests = requestQueue.size();
727       }
728       counter++;
729       int shouldRemove;
730       if (selectorRequestFilter.acceptRequest(request)) {
731         requestToServe = request;
732         shouldRemove = REMOVE;
733       } else {
734         shouldRemove = KEEP;
735       }
736       if (counter == numberOfRequests && requestToServe != null) {
737         if (request == requestToServe) {
738             return REMOVE_AND_SERVE; // serve current request
739
} else {
740             body.serve(requestToServe); // serve an already removed request
741
}
742       }
743       return shouldRemove;
744     }
745   } // end inner class FlushingServeYoungestRequestProcessor
746

747
748
749   /**
750    * FlushingServeOldestRequestProcessor is a RequestProcessor that serves
751    * only the oldest request accepted by the given RequestFilter and removes
752    * all other requests accepted by that same Filter
753    *
754    * @author ProActive Team
755    * @version 1.0, 2001/10/23
756    * @since ProActive 0.9
757    * @see RequestProcessor
758    *
759    */

760   protected class FlushingServeOldestRequestProcessor implements RequestProcessor {
761     private RequestFilter selectorRequestFilter;
762     private boolean hasServed;
763     
764     public FlushingServeOldestRequestProcessor(RequestFilter selectorRequestFilter) {
765       this.selectorRequestFilter = selectorRequestFilter;
766     }
767     
768     /**
769      * Processes the request and returns true if the request can be discarded
770      * after processing.
771      * @param request the request to process
772      * @return true if the request can be discarded (removed from the
773      * container it is stored), false if it has to be kept.
774      */

775     public int processRequest(Request request) {
776       if (selectorRequestFilter.acceptRequest(request)) {
777         if (!hasServed) {
778           hasServed = true;
779           return REMOVE_AND_SERVE;
780         }
781         return REMOVE;
782       } else {
783         return KEEP;
784       }
785     }
786   } // end inner class FlushingServeYoungestRequestProcessor
787

788
789
790   /**
791    * RequestFilterOnMethodName is a RequestFilter that matches
792    * only request of a given method name.
793    *
794    * @author ProActive Team
795    * @version 1.0, 2001/10/23
796    * @since ProActive 0.9
797    * @see RequestFilter
798    *
799    */

800   protected class RequestFilterOnMethodName implements RequestFilter {
801     private String JavaDoc methodName;
802     public RequestFilterOnMethodName(String JavaDoc methodName) {
803       this.methodName = methodName;
804     }
805     /**
806      * Returns true if and only if the given request can be accepted.
807      * @param request the request to test
808      * @return true if the request can be accepted, false else.
809      */

810     public boolean acceptRequest(Request request) {
811       return methodName.equals(request.getMethodName());
812     }
813   } // end inner class RequestFilterOnMethodName
814

815
816
817   /**
818    * AcceptAllRequestFilter is a RequestFilter that matches any request
819    *
820    * @author ProActive Team
821    * @version 1.0, 2001/10/23
822    * @since ProActive 0.9
823    * @see RequestFilter
824    *
825    */

826   protected class AcceptAllRequestFilter implements RequestFilter {
827     /**
828      * Returns true if and only if the given request can be accepted.
829      * @param request the request to test
830      * @return true if the request can be accepted, false else.
831      */

832     public boolean acceptRequest(Request request) {
833       return true;
834     }
835   } // end inner class AcceptAllRequestFilter
836

837
838
839 }
840
Popular Tags