com.opera.core.systems.runner.launcher
Class OperaLauncherProtocol

java.lang.Object
  extended by com.opera.core.systems.runner.launcher.OperaLauncherProtocol

public class OperaLauncherProtocol
extends Object

Implements the launcher protocol.

Author:
Jan Vidar Krey

Nested Class Summary
static class OperaLauncherProtocol.MessageType
           
 class OperaLauncherProtocol.ResponseEncapsulation
           
 
Constructor Summary
OperaLauncherProtocol(Socket socket)
           
 
Method Summary
 OperaLauncherProtocol.ResponseEncapsulation sendRequest(OperaLauncherProtocol.MessageType type, byte[] body)
          Send a request and receive a result.
 void sendRequestWithoutResponse(OperaLauncherProtocol.MessageType type, byte[] body)
          Send a request without a response.
 void shutdown()
          Shuts down the connection to the launcher.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OperaLauncherProtocol

public OperaLauncherProtocol(Socket socket)
                      throws SocketException
Throws:
SocketException
Method Detail

shutdown

public void shutdown()
              throws IOException
Shuts down the connection to the launcher.

Throws:
IOException - if the socket is already closed

sendRequest

public OperaLauncherProtocol.ResponseEncapsulation sendRequest(OperaLauncherProtocol.MessageType type,
                                                               byte[] body)
                                                        throws IOException
Send a request and receive a result.

Parameters:
type - the request type to be sent
body - the serialized request payload
Returns:
the response
Throws:
IOException - if socket read error or protocol parse error

sendRequestWithoutResponse

public void sendRequestWithoutResponse(OperaLauncherProtocol.MessageType type,
                                       byte[] body)
                                throws IOException
Send a request without a response. Used for shutdown.

Parameters:
type - the request type to be sent
body - the serialized request payload
Throws:
IOException - if socket read error or protocol parse error


Copyright © 2012. All Rights Reserved.