EMMA Coverage Report (generated Wed Feb 13 07:49:24 ICT 2008)
[all classes][net.sourceforge.hiveboard]

COVERAGE SUMMARY FOR SOURCE FILE [HiveBoard.java]

nameclass, %method, %block, %line, %
HiveBoard.java0%   (0/1)0%   (0/3)0%   (0/36)0%   (0/18)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class HiveBoard0%   (0/1)0%   (0/3)0%   (0/36)0%   (0/18)
HiveBoard (Server): void 0%   (0/1)0%   (0/6)0%   (0/3)
delay (long): void 0%   (0/1)0%   (0/5)0%   (0/4)
shutdown (): void 0%   (0/1)0%   (0/25)0%   (0/11)

1//  Copyright 2004-2007 Jean-Francois Poilpret
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14 
15package net.sourceforge.hiveboard;
16 
17import org.mortbay.jetty.Server;
18import org.mortbay.log.Log;
19 
20import net.sourceforge.hiveboard.pack.HiveBoardPackHandler;
21 
22/**
23 * @author Jean-Francois Poilpret
24 */
25public class HiveBoard
26{
27        static final private long        PENDING_REQUESTS_WAIT        = 500L;
28        static final private long        SYSTEM_EXIT_WAIT                = 500L;
29        
30        public HiveBoard(Server server)
31        {
32                _server = server;
33        }
34        
35        public void                shutdown() throws Exception
36        {
37                Log.info("Shutting down HiveBoard server...");
38                // Graceful shutdown: stop handler
39                HiveBoardPackHandler handler = (HiveBoardPackHandler) _server.getHandler();
40                handler.setShutdown(true);
41                while (handler.getPendingRequests() > 0)
42                {
43                        delay(PENDING_REQUESTS_WAIT);
44                }
45                handler.stop();
46                Log.info("HiveBoard server handler stopped.");
47                delay(SYSTEM_EXIT_WAIT);
48                System.exit(0);
49        }
50        
51        // CSOFF: EmptyBlockCheck
52        static private void        delay(long ms)
53        {
54                try
55                {
56                        Thread.sleep(ms);
57                }
58                catch (InterruptedException e)
59                {
60                        // Intentionally empty
61                }
62        }
63        // CSON: EmptyBlockCheck
64        
65        private final Server        _server;
66}

[all classes][net.sourceforge.hiveboard]
EMMA 2.0.5312 (C) Vladimir Roubtsov