01: /*
02: *
03: *
04: * Copyright 1990-2007 Sun Microsystems, Inc. All Rights Reserved.
05: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
06: *
07: * This program is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU General Public License version
09: * 2 only, as published by the Free Software Foundation.
10: *
11: * This program is distributed in the hope that it will be useful, but
12: * WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * General Public License version 2 for more details (a copy is
15: * included at /legal/license.txt).
16: *
17: * You should have received a copy of the GNU General Public License
18: * version 2 along with this work; if not, write to the Free Software
19: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA
21: *
22: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
23: * Clara, CA 95054 or visit www.sun.com if you need additional
24: * information or have any questions.
25: */
26:
27: package com.sun.midp.automation;
28:
29: import java.util.*;
30: import java.io.*;
31:
32: /**
33: * Represents MIDlets suite.
34: */
35: public abstract class AutoSuiteDescriptor {
36: /**
37: * Gets name of the suite.
38: *
39: * @return name of the suite as specified in jar/jad
40: */
41: public abstract String getSuiteName() throws IllegalStateException;
42:
43: /**
44: * Gets MIDlet which should be started by default for this
45: * suite, if any.
46: *
47: * @return AutoMIDletDescriptor representing default
48: * MIDlet
49: */
50: public abstract AutoMIDletDescriptor getInitialMIDlet()
51: throws IllegalStateException;
52:
53: /**
54: * Gets suite's MIDlets.
55: *
56: * @return vector of AutoMIDletDescriptor objects representing
57: * suite's MIDlets,
58: * null if there is no default MIDlet for this suite
59: */
60: public abstract Vector getSuiteMIDlets()
61: throws IllegalStateException;
62:
63: /**
64: * Starts this suite's initial MIDlet.
65: *
66: * @param args MIDlet's arguments
67: * @return AutoMIDlet representing started MIDlet
68: * @throws RuntimeException if MIDlet couldn't be started
69: */
70: abstract public AutoMIDlet start(String[] args);
71:
72: /**
73: * Gets descriptor of internal suite
74: *
75: * @param className suite's MIDlet class name
76: * @return internal suite descriptor
77: */
78: public final static AutoSuiteDescriptor getInternalSuite(
79: String className) throws IOException {
80: return AutoSuiteDescriptorImpl
81: .getInstanceByClassName(className);
82: }
83: }
|