01: /*
02: * The contents of this file are subject to the terms of the Common Development
03: * and Distribution License (the License). You may not use this file except in
04: * compliance with the License.
05: *
06: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
07: * or http://www.netbeans.org/cddl.txt.
08: *
09: * 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-2007 Sun
17: * Microsystems, Inc. All Rights Reserved.
18: */
19:
20: package org.netbeans.modules.bpel.debugger;
21:
22: import org.netbeans.api.debugger.DebuggerEngine;
23: import org.netbeans.api.debugger.Session;
24: import org.netbeans.spi.debugger.ContextProvider;
25: import org.netbeans.spi.debugger.DebuggerEngineProvider;
26:
27: /**
28: *
29: * @author Alexander Zgursky
30: */
31: public class BpelDebuggerEngineProvider extends DebuggerEngineProvider {
32:
33: public static final String ID = "netbeans-BpelEngine"; // NOI18N
34:
35: private DebuggerEngine.Destructor myDesctuctor;
36: private Session mySession;
37:
38: /**
39: * Creates a new instance of BpelEngineProvider.
40: *
41: * @param contextProvider provides context for the BPEL debugger engine
42: */
43: public BpelDebuggerEngineProvider(ContextProvider contextProvider) {
44: mySession = contextProvider.lookupFirst(null, Session.class);
45: }
46:
47: public String[] getLanguages() {
48: return new String[] { "BPEL" }; // NOI18N
49: }
50:
51: public String getEngineTypeID() {
52: return ID;
53: }
54:
55: public Object[] getServices() {
56: return new Object[0];
57: }
58:
59: public void setDestructor(DebuggerEngine.Destructor desctuctor) {
60: myDesctuctor = desctuctor;
61: }
62:
63: /**
64: * Returns destructor to be used when finishing debug session.
65: * @return destructor
66: */
67: public DebuggerEngine.Destructor getDestructor() {
68: return myDesctuctor;
69: }
70:
71: /**
72: * Returns the debug session in the context of which this debugger engine
73: * operates.
74: *
75: * @return debug session
76: */
77: public Session getSession() {
78: return mySession;
79: }
80: }
|