FileDocCategorySizeDatePackage
SystemServiceManagerImpl.javaAPI DocphoneME MR2 API (J2ME)3003Wed May 02 18:00:10 BST 2007com.sun.midp.services

SystemServiceManagerImpl

public final class SystemServiceManagerImpl extends SystemServiceManager

Fields Summary
private Hashtable
serviceEntries
Registered service entries
Constructors Summary
SystemServiceManagerImpl()

    
     
        serviceEntries = new Hashtable();
    
Methods Summary
private voidaddService(SystemService service)

        removeService(service.getServiceID());

        SystemServiceEntry entry = new SystemServiceEntry(service);
        serviceEntries.put(service.getServiceID(), entry);
    
public synchronized SystemServicegetService(java.lang.String serviceID)

        SystemServiceEntry entry = 
            (SystemServiceEntry)serviceEntries.get(serviceID);

        if (entry == null) {
            return null;
        }

        if (!entry.isStarted) {
            entry.service.start();
            entry.isStarted = true;
        }

        return entry.service;
    
public synchronized voidregisterService(SystemService service)

        addService(service);
    
private voidremoveAllServices()

        Enumeration e = serviceEntries.keys();
        for(; e.hasMoreElements(); ) {
            String serviceID = (String)e.nextElement();
            removeService(serviceID);
        }
    
private voidremoveService(java.lang.String serviceID)

        SystemServiceEntry entry = 
            (SystemServiceEntry)serviceEntries.get(serviceID);

        if (entry == null) {
            return;
        }

        if (entry.isStarted) {
            entry.service.stop();
            entry.isStarted = false;
        }

        serviceEntries.remove(serviceID);
    
public voidshutdown()

        removeAllServices();