001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: * The Original Software is NetBeans. The Initial Developer of the Original
026: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
027: * Microsystems, Inc. All Rights Reserved.
028: *
029: * If you wish your version of this file to be governed by only the CDDL
030: * or only the GPL Version 2, indicate your decision by adding
031: * "[Contributor] elects to include this software in this distribution
032: * under the [CDDL or GPL Version 2] license." If you do not indicate a
033: * single choice of license, a recipient has the option to distribute
034: * your version of this file under either the CDDL, the GPL Version 2 or
035: * to extend the choice of license to its licensees as provided above.
036: * However, if you add GPL Version 2 code and therefore, elected the GPL
037: * Version 2 license, then the option applies only if the new code is
038: * made subject to such option by the copyright holder.
039: */
040:
041: package org.netbeans.lib.profiler.common.integration;
042:
043: import org.netbeans.lib.profiler.common.AttachSettings;
044: import org.netbeans.lib.profiler.common.integration.exceptions.ModificationException;
045: import org.netbeans.lib.profiler.common.integration.exceptions.RunException;
046: import java.util.List;
047: import java.util.Vector;
048:
049: /**
050: *
051: * @author Tomas Hurka
052: * @author Jaroslav Bachorik
053: */
054: public interface IntegrationProvider {
055: //~ Inner Classes ------------------------------------------------------------------------------------------------------------
056:
057: public class IntegrationHints {
058: //~ Instance fields ------------------------------------------------------------------------------------------------------
059:
060: private List hints;
061: private List steps;
062: private List warnings;
063: private boolean warningsFirst = true;
064:
065: //~ Constructors ---------------------------------------------------------------------------------------------------------
066:
067: public IntegrationHints() {
068: steps = new Vector(10);
069: hints = new Vector(10);
070: warnings = new Vector(10);
071: }
072:
073: //~ Methods --------------------------------------------------------------------------------------------------------------
074:
075: public List getHints() {
076: return copyLock(this .hints);
077: }
078:
079: public List getSteps() {
080: return copyLock(this .steps);
081: }
082:
083: public List getWarnings() {
084: return copyLock(this .warnings);
085: }
086:
087: public void setWarningsFirst(boolean warningsFirst) {
088: this .warningsFirst = warningsFirst;
089: }
090:
091: public boolean isWarningsFirst() {
092: return warningsFirst;
093: }
094:
095: public void addHint(String hint) {
096: this .hints.add(hint);
097: }
098:
099: public void addStep(String step) {
100: this .steps.add(step);
101: }
102:
103: public void addStep(int stepIndex, String step) {
104: this .steps.add(stepIndex, step);
105: }
106:
107: public void addWarning(String warning) {
108: this .warnings.add(warning);
109: }
110:
111: public void clear() {
112: this .hints.clear();
113: this .steps.clear();
114: this .warnings.clear();
115: }
116:
117: public void removeHint(String hint) {
118: this .hints.remove(hint);
119: }
120:
121: public void removeStep(String step) {
122: this .steps.remove(step);
123: }
124:
125: public void removeWarning(String warning) {
126: this .warnings.remove(warning);
127: }
128:
129: private List copyLock(List source) {
130: List immutable = new Vector();
131: immutable.addAll(source);
132:
133: return immutable;
134: }
135: }
136:
137: //~ Methods ------------------------------------------------------------------------------------------------------------------
138:
139: public IntegrationHints getAfterInstallationHints(
140: AttachSettings settings, boolean automation);
141:
142: public IntegrationHints getIntegrationReview(AttachSettings settings);
143:
144: public IntegrationHints getModificationHints(AttachSettings settings);
145:
146: public void setTargetJava(String targetJava);
147:
148: public String getTargetJava();
149:
150: public void setTargetJavaHome(String targetJavaHome);
151:
152: public String getTargetJavaHome();
153:
154: public String getTitle();
155:
156: public void modify(AttachSettings settings)
157: throws ModificationException;
158:
159: public void run(AttachSettings settings) throws RunException;
160:
161: public boolean supportsAutomation();
162:
163: public boolean supportsDirect();
164:
165: public boolean supportsDynamic();
166:
167: public boolean supportsLocal();
168:
169: public boolean supportsManual();
170:
171: public boolean supportsRemote();
172: }
|