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

SystemServiceIsolate

public class SystemServiceIsolate extends Object
Isolate created in TestSystemService test.

Fields Summary
private static SecurityToken
token
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)


         
          
                
                

        Link[] isolateLinks = LinkPortal.getLinks();
        NamedLinkPortal.receiveLinks(isolateLinks[0]);

        SystemServiceRequestor serviceRequestor = 
            SystemServiceRequestor.getInstance(token);

        SystemServiceConnection con = null;
        con = serviceRequestor.requestService(
                TestSystemService.SERVICE_ID);

        try {
            // receive string from service
            SystemServiceMessage msg = con.receive();
            String testString = msg.getDataInput().readUTF();

            // convert string to upper case and sent it back to service
            msg = SystemServiceMessage.newMessage();
            msg.getDataOutput().writeUTF(testString.toUpperCase());
            con.send(msg);
        } catch (Throwable t) {
            System.err.println("Exception: " + t);
        }