EMMA Coverage Report (generated Wed Apr 19 22:57:21 CEST 2006)
[all classes][com.eaio.nativecall]

COVERAGE SUMMARY FOR SOURCE FILE [Verifiers.java]

nameclass, %method, %block, %line, %
Verifiers.java100% (1/1)75%  (3/4)64%  (37/58)88%  (11,5/13)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Verifiers100% (1/1)75%  (3/4)64%  (37/58)88%  (11,5/13)
Verifiers (): void 0%   (0/1)0%   (0/3)0%   (0/1)
init (): void 100% (1/1)64%  (32/50)94%  (8,5/9)
<static initializer> 100% (1/1)100% (3/3)100% (2/2)
getInstance (): Verifier 100% (1/1)100% (2/2)100% (1/1)

1/* 
2 * Verifiers.java
3 * 
4 * Created on 07.09.2004.
5 *
6 * eaio: NativeCall - calling operating system methods from Java
7 * Copyright (c) 2004-2006 Johann Burkard (<mailto:jb@eaio.com>)
8 * <http://eaio.com>
9 * 
10 * Permission is hereby granted, free of charge, to any person obtaining a
11 * copy of this software and associated documentation files (the "Software"),
12 * to deal in the Software without restriction, including without limitation
13 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 * and/or sell copies of the Software, and to permit persons to whom the
15 * Software is furnished to do so, subject to the following conditions:
16 * 
17 * The above copyright notice and this permission notice shall be included
18 * in all copies or substantial portions of the Software.
19 * 
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
23 * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
24 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
25 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
26 * USE OR OTHER DEALINGS IN THE SOFTWARE.
27 *
28 */
29package com.eaio.nativecall;
30 
31import java.util.Iterator;
32 
33import sun.misc.Service;
34import sun.misc.ServiceConfigurationError;
35 
36/**
37 * Verifiers instantiates the matching {@link com.eaio.nativecall.Verifier} for
38 * the current operating system. 
39 * 
40 * @author <a href="mailto:jb@eaio.com">Johann Burkard</a>
41 * @version $Id: Verifiers.java,v 1.2 2006/01/06 10:58:33 grnull Exp $
42 */
43final class Verifiers {
44 
45    /**
46     * No instances needed.
47     */
48    private Verifiers() {}
49 
50    /**
51     * The Verifier.
52     */
53    private static Verifier v = null;
54 
55    /**
56     * Find the matching Verifier.
57     * 
58     * @throws ServiceConfigurationError
59     * @throws SecurityException
60     */
61    static void init() throws ServiceConfigurationError, SecurityException {
62        Iterator i =
63            Service.providers(Verifier.class, Verifier.class.getClassLoader());
64        Verifier ver = null;
65        while (i.hasNext()) {
66            ver = (Verifier) i.next();
67            if (ver.supports()) {
68                v = ver;
69                break;
70            }
71        }
72    }
73 
74    /**
75     * Returns the Verifier.
76     * 
77     * @return a Verifier or <code>null</code>
78     */
79    static Verifier getInstance() {
80        return v;
81    }
82 
83}

[all classes][com.eaio.nativecall]
EMMA 2.0.4217 (C) Vladimir Roubtsov