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

SystemServiceRequestorRemote

public final class SystemServiceRequestorRemote extends SystemServiceRequestor

Fields Summary
private SystemServiceConnectionLinks
sendReceiveLinks
private SystemServiceRequestProtocolClient
requestProtocol
Constructors Summary
SystemServiceRequestorRemote(SystemServiceConnectionLinks sendReceiveLinks)


    
              

        this.sendReceiveLinks = sendReceiveLinks;
        if (sendReceiveLinks != null) {
            this.requestProtocol = 
                new SystemServiceRequestProtocolClient(sendReceiveLinks);
        }
    
Methods Summary
private SystemServiceConnectiondoRequestService(java.lang.String serviceID)

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

        try {
            // send empty message to kick a session 
            Link sendLink = sendReceiveLinks.getSendLink();
            LinkMessage emptyMsg = LinkMessage.newStringMessage("");
            sendLink.send(emptyMsg);

            requestProtocol.requestService(serviceID);
            SystemServiceConnectionLinks connectionLinks = 
                requestProtocol.getSystemServiceConnectionLinks();

            if (connectionLinks != null) {
                return new SystemServiceConnectionImpl(connectionLinks);
            } else {
                return null;
            }
        } catch (ClosedLinkException e) {
            sendReceiveLinks.close();
            sendReceiveLinks = null;

            return null;
        } catch (InterruptedIOException e) {
            sendReceiveLinks.close();
            sendReceiveLinks = null;

            return null;
        } catch (IOException e) {
            sendReceiveLinks.close();
            sendReceiveLinks = null;

            return null;            
        } catch (IllegalStateException e) {
            sendReceiveLinks.close();
            sendReceiveLinks = null;

            return null;            
        }
    
public SystemServiceConnectionrequestService(java.lang.String serviceID)

        synchronized (this) {
            return doRequestService(serviceID);
        }