01: /*
02: * <copyright>
03: * Copyright 1997-2003 BBNT Solutions, LLC
04: * under sponsorship of the Defense Advanced Research Projects Agency (DARPA).
05: *
06: * This program is free software; you can redistribute it and/or modify
07: * it under the terms of the Cougaar Open Source License as published by
08: * DARPA on the Cougaar Open Source Website (www.cougaar.org).
09: *
10: * THE COUGAAR SOFTWARE AND ANY DERIVATIVE SUPPLIED BY LICENSOR IS
11: * PROVIDED 'AS IS' WITHOUT WARRANTIES OF ANY KIND, WHETHER EXPRESS OR
12: * IMPLIED, INCLUDING (BUT NOT LIMITED TO) ALL IMPLIED WARRANTIES OF
13: * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND WITHOUT
14: * ANY WARRANTIES AS TO NON-INFRINGEMENT. IN NO EVENT SHALL COPYRIGHT
15: * HOLDER BE LIABLE FOR ANY DIRECT, SPECIAL, INDIRECT OR CONSEQUENTIAL
16: * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE OF DATA OR PROFITS,
17: * TORTIOUS CONDUCT, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
18: * PERFORMANCE OF THE COUGAAR SOFTWARE.
19: * </copyright>
20: */
21:
22: package org.cougaar.core.thread;
23:
24: import org.cougaar.core.service.ThreadService;
25:
26: /**
27: * This Component provides a very simple, serializing {@link
28: * ThreadService} for its container. The implementation is
29: * SingleThreadServiceProxy.
30: */
31: public class SingleThreadServiceProvider extends
32: TrivialThreadServiceProvider {
33: private SingleThreadServiceProxy proxy;
34:
35: SingleThreadServiceProvider() {
36: super ();
37: }
38:
39: ThreadStatusService makeThreadStatusService() {
40: return new ThreadStatusService() {
41: public int iterateOverStatus(ThreadStatusService.Body body) {
42: return proxy.iterateOverThreads(body);
43: }
44: };
45: }
46:
47: ThreadService makeThreadServiceProxy() {
48: proxy = new SingleThreadServiceProxy();
49: return proxy;
50: }
51:
52: }
|