FileDocCategorySizeDatePackage
AutomationInitializer.javaAPI DocphoneME MR2 API (J2ME)3514Wed May 02 18:00:08 BST 2007com.sun.midp.automation

AutomationInitializer

public final class AutomationInitializer extends Object
Initializes Automation API

Fields Summary
private static EventQueue
eventQueue
Event queue
private static MIDletControllerEventProducer
midletControllerEventProducer
MIDletControllerEventProducer instance
private static boolean
isInitialized
whether Automation API has been initialized or not
Constructors Summary
private AutomationInitializer()
Private constructor to prevent creating class instances

    

                
      
    
Methods Summary
static EventQueuegetEventQueue()
Gets event queue.

return
Automation API's isolate event queue
throws
IllegalStateException if Automation API isn't initialized or not permitted to use

            
        guaranteeAutomationInitialized();
        return eventQueue;
    
static MIDletControllerEventProducergetMIDletControllerEventProducer()
Gets MIDletControllerEventProducer.

return
MIDletControllerEventProducer instance
throws
IllegalStateException if Automation API isn't initialized or not permitted to use


        guaranteeAutomationInitialized();
        return midletControllerEventProducer;
    
static voidguaranteeAutomationInitialized()
Guarantees that Automation API is initialized and permitted to use.

throws
IllegalStateException if Automation API isn't initialized or not permitted to use


        if (!isInitialized) {
            throw new IllegalStateException("Automation API not initialized");
        }
    
public static voidinit(EventQueue theEventQueue, MIDletControllerEventProducer theMidletControllerEventProducer)
Initializes Automation API.

param
theEventQueue Automation API's isolate event queue
param
theMidletControllerEventProducer MIDletControllerEventProducer

        
        if (!isInitialized) {
            eventQueue = theEventQueue;
            midletControllerEventProducer = theMidletControllerEventProducer;
            isInitialized = true;
        }