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

IsolateSystemServiceRequestHandler

public final class IsolateSystemServiceRequestHandler extends Object implements SystemServiceRequestListener

Fields Summary
private Isolate
serviceIsolate
private Isolate
clientIsolate
private SystemServiceManager
serviceManager
private SystemService
requestedService
private SystemServiceConnectionLinks
sendReceiveLinks
private SystemServiceRequestProtocolAMS
serviceRequestProtocol
Constructors Summary
IsolateSystemServiceRequestHandler(SystemServiceManager serviceManager, Isolate clientIsolate)


      
              

        this.serviceIsolate = Isolate.currentIsolate();
        this.clientIsolate = clientIsolate;
        this.serviceManager = serviceManager;

        Link sendLink = Link.newLink(serviceIsolate, clientIsolate);
        Link receiveLink = Link.newLink(clientIsolate, serviceIsolate);      
        this.sendReceiveLinks = new SystemServiceConnectionLinks(
                sendLink, receiveLink);

        serviceRequestProtocol = new SystemServiceRequestProtocolAMS(this);
    
Methods Summary
SystemServiceConnectionLinksgetSendReceiveLinks()

        return sendReceiveLinks;
    
voidhandleServiceRequest()


        serviceRequestProtocol.handleServiceRequest(sendReceiveLinks);
    
public voidonLinksPassedToClient(SystemServiceConnectionLinks connectionLinks)


        if (connectionLinks == null || requestedService == null) {
            throw new IllegalStateException();
        }

        SystemServiceConnection serviceConnection = 
            new SystemServiceConnectionImpl(connectionLinks);
            
        synchronized (requestedService) {
            requestedService.acceptConnection(serviceConnection);
        }

        requestedService = null;
    
public SystemServiceConnectionLinksonServiceRequest(java.lang.String serviceID)

        requestedService = serviceManager.getService(serviceID);
        if (requestedService == null) {
            return null;
        }

        Link serviceToClient = Link.newLink(serviceIsolate, clientIsolate);
        Link clientToService = Link.newLink(clientIsolate, serviceIsolate);
        SystemServiceConnectionLinks connectionLinks = 
            new SystemServiceConnectionLinks(serviceToClient, clientToService);

        return connectionLinks;