KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > api > debugger > DebuggerInfo


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.api.debugger;
21
22 import java.util.List JavaDoc;
23
24
25 /**
26  * Contains information needed to start new debugging. Process of starting of
27  * debugger can create one or more {@link Session} and one or more
28  * {@link DebuggerEngine} and register them to {@link DebuggerManager}. For
29  * more information about debugger start process see:
30  * {@link DebuggerManager#startDebugging}.
31  *
32  * @author Jan Jancura
33  */

34 public final class DebuggerInfo {
35
36     private Lookup lookup;
37
38
39     /**
40      * Creates a new instance of DebuggerInfo.
41      *
42      * @param typeID identification of DebuggerInfo type. Is used for
43      * registration of external services.
44      * @param services you can register additional services for this
45      * DebuggerInfo here
46      * @return returns a new instance of DebuggerInfo
47      */

48     public static DebuggerInfo create (
49         String JavaDoc typeID,
50         Object JavaDoc[] services
51     ) {
52         return new DebuggerInfo (
53             typeID,
54             services
55         );
56     }
57     
58     private DebuggerInfo (
59         String JavaDoc typeID,
60         Object JavaDoc[] services
61     ) {
62         Object JavaDoc[] s = new Object JavaDoc [services.length + 1];
63         System.arraycopy (services, 0, s, 0, services.length);
64         s [s.length - 1] = this;
65         lookup = new Lookup.Compound (
66             new Lookup.Instance (s),
67             new Lookup.MetaInf (typeID)
68         );
69     }
70
71     /**
72      * Returns type identification of this session. This parameter is used for
73      * registration of additional services in Meta-inf/debugger.
74      *
75      * @return type identification of this session
76      */

77 // public String getTypeID () {
78
// return typeID;
79
// }
80

81 // /**
82
// * Returns list of services of given type.
83
// *
84
// * @param service a type of service to look for
85
// * @return list of services of given type
86
// */
87
// public List lookup (Class service) {
88
// return lookup.lookup (null, service);
89
// }
90
//
91
// /**
92
// * Returns one service of given type.
93
// *
94
// * @param service a type of service to look for
95
// * @return ne service of given type
96
// */
97
// public Object lookupFirst (Class service) {
98
// return lookup.lookupFirst (null, service);
99
// }
100

101     /**
102      * Returns list of services of given type from given folder.
103      *
104      * @param service a type of service to look for
105      * @return list of services of given type
106      */

107     public List JavaDoc lookup (String JavaDoc folder, Class JavaDoc service) {
108         return lookup.lookup (folder, service);
109     }
110     
111     /**
112      * Returns one service of given type from given folder.
113      *
114      * @param service a type of service to look for
115      * @return ne service of given type
116      */

117     public Object JavaDoc lookupFirst (String JavaDoc folder, Class JavaDoc service) {
118         return lookup.lookupFirst (folder, service);
119     }
120     
121     Lookup getLookup () {
122         return lookup;
123     }
124 }
125
126
Popular Tags