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.api;
21:
22: /**
23: * Model for maintaining the list of process instances.
24: * Supports notification of process state changes.
25: *
26: * @author Sun Microsystems
27: */
28: public interface ProcessInstancesModel {
29:
30: /**
31: * Returns an array containing one process instance
32: * per process. Similar to getProcessInstanceThreads
33: * except only one process instance is selected to
34: * be in the array for any given process,
35: * and that selection is either the first suspended
36: * instance or the first instance of the process.
37: *
38: * @return
39: */
40: ProcessInstance[] getProcessInstances();
41:
42: ProcessInstance[] getProcessInstances(BpelProcess process);
43:
44: BpelProcess[] getProcesses();
45:
46: /**
47: * Adds a listener to the model.
48: *
49: * @param listener
50: */
51: void addListener(Listener listener);
52:
53: /**
54: * Removes a listener from the model.
55: *
56: * @param listener
57: */
58: void removeListener(Listener listener);
59:
60: /**
61: * Listener for changes to the process instance model.
62: * The listener will be informed of when process instances
63: * have been created/exited. State changes are also fired to listeners.
64: *
65: * @author Sun Microsystems
66: */
67: interface Listener {
68:
69: /**
70: * Process instance exited.
71: *
72: * @param processInstance
73: */
74: void processInstanceRemoved(ProcessInstance processInstance);
75:
76: /**
77: * New process isntance created.
78: *
79: * @param processInstance
80: */
81: void processInstanceAdded(ProcessInstance processInstance);
82:
83: /**
84: * The state of the process instance changed.
85: *
86: * @param processInstance
87: * @param oldState
88: * @param newState
89: */
90: void processInstanceStateChanged(
91: ProcessInstance processInstance, int oldState,
92: int newState);
93:
94: }
95: }
|