Package org.jcsp.net

Examples of org.jcsp.net.NetChannelInput


* @see com.quickstone.jcsp.lang.CSProcess#run()
*/

    public void run() {
        final NetChannelOutput client2Server = Mobile.createOne2Net(clientServerLocation);
        final NetChannelInput server2Client = Mobile.createNet2One();
        final MeetingData clientData = new MeetingData();
        clientData.setReturnChannel(server2Client.getChannelLocation());
        clientData.setClientId(clientId);
        // read data obtained from User interface into clientData using EventInput(s)
        clientData.setMeetingName((String) meetingNameEvent.read());
        client2Server.write(clientData);
        final MeetingData replyData = (MeetingData) server2Client.read();
        // write data from replyData into User Interface using ConfigureOutput(s)
        if (replyData.getAttendees() == 0) {
            registeredConfigure.write("NOT Registered");
        } else {
            registeredConfigure.write("Registered");
View Full Code Here


        // Get location of server
        final NetChannelLocation serverLoc = CNS.resolve(serviceName);
        // Create output channel to server
        final NetChannelOutput toServer = NetChannelEnd.createOne2Net(serverLoc);
        // Create input channel from server for process
        final NetChannelInput processReceive = Mobile.createNet2One();
        // Write location of input channel to server
        toServer.write(processReceive.getChannelLocation());
        // Receive process and run it;
        final MobileProcess theProcess = (MobileProcess) processReceive.read();
        System.out.println("The client has been received for service: " + eventType);
        new ProcessManager(theProcess).run();
    }
View Full Code Here

            System.out.println("NSCC: retry requested");
            try {
                String processService = "A";
                final NetChannelLocation serverLoc = CNS.resolve(processService);
                final NetChannelOutput toServer = NetChannelEnd.createOne2Net(serverLoc);
                final NetChannelInput processReceive = Mobile.createNet2One();
                toServer.write(processReceive.getChannelLocation());
                final MobileProcess theProcess = (MobileProcess) processReceive.read();
                System.out.println("The access client has been received for service ");
                new ProcessManager(theProcess).run();
                System.out.println("The access client has finished for service ");
            }
            catch (Exception e) {
View Full Code Here


    public void run() {
        System.out.println("New Meeting Client Capability");
        final NetChannelOutput client2Server = Mobile.createOne2Net(clientServerLocation);
        final NetChannelInput server2Client = Mobile.createNet2One();
        MeetingData clientData = new MeetingData();
        clientData.setReturnChannel(server2Client.getChannelLocation());
        clientData.setClientId(clientId);
        // read data obtained from User interface into clientData using EventInput(s)
        clientData.setMeetingName((String) meetingNameEvent.read());
        clientData.setMeetingPlace((String) meetingLocationEvent.read());
        client2Server.write(clientData);
        final MeetingData replyData = (MeetingData) server2Client.read();
        // write data from replyData into User Interface using ConfigureOutput(s)
        if (replyData.getAttendees() == 1) {
            registeredConfigure.write("Registered");
        } else {
            registeredConfigure.write("ALREADY Registered");
View Full Code Here

TOP

Related Classes of org.jcsp.net.NetChannelInput

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.