FileDocCategorySizeDatePackage
MMEventHandler.javaAPI DocphoneME MR2 API (J2ME)2710Wed May 02 18:00:16 BST 2007com.sun.mmedia

MMEventHandler

public class MMEventHandler extends Object
MMEventHandler is used by BasicPlayer to register an event handler.

Fields Summary
private static SecurityToken
classSecurityToken
This class has a different security domain than the MIDlet suite
private static EventListener
listener
The EventListener to receive the MM events.
Constructors Summary
Methods Summary
public static voidinitSecurityToken(SecurityToken token)
Initializes the security token for this class, so it can perform actions that a normal MIDlet Suite cannot.

param
token security token for this class.


                                  
         
        if (classSecurityToken == null) {
            classSecurityToken = token;
        }
    
static voidsetListener(EventListener l)
Set the Event listener on the event queue.
This method is made package-private so only classes from com.sun.mmedia (BasicPlayer) can access it for security reasons.

param
l EventListener for the MM events.


	// This can only be set once.
	if (listener != null)
	    return;
	listener = l;
	
	EventQueue evtq = EventQueue.getEventQueue(classSecurityToken);
	evtq.registerEventListener(EventTypes.MMAPI_EVENT, listener);