com.opera.core.systems.scope.stp
Class StpConnection
java.lang.Object
com.opera.core.systems.scope.stp.StpConnection
- All Implemented Interfaces:
- SocketListener
public class StpConnection
- extends java.lang.Object
- implements SocketListener
|
Method Summary |
boolean |
canRead(java.nio.channels.SelectableChannel channel)
|
boolean |
canWrite(java.nio.channels.SelectableChannel channel)
|
void |
close()
Switches the wait state and wakes up the selector to process. |
boolean |
isConnected()
|
void |
parseServiceList(java.lang.String message)
Processes an incoming message and passes it to event handler if needed, the following events
are to our interest: Runtime-Started : ecmascript runtime starts in Opera (that we can inject
to) Runtime-Stopped : ecmascript runtime stops (not used, buggy) Message: fired from console
log event Updated-Window: a window is updated OR created (opener-id=0) Active-Window: window
focus changed Window-Closed: self explanatory If message matches none it is added to the
response queue (probably response to command). |
void |
send(UmsProtos.Command command)
Queues up an STP/1 message sent from another thread and wakes up selector to register it to the
key. |
void |
sendEnableStp1()
|
void |
sendQuit()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StpConnection
public StpConnection(java.nio.channels.SocketChannel socket,
IConnectionHandler handler,
AbstractEventHandler eventHandler,
SocketMonitor monitor)
throws java.io.IOException
- Initializes variables in object scope, sets 'count known' to false to read byte count (STP/0).
- Throws:
java.io.IOException
isConnected
public boolean isConnected()
send
public void send(UmsProtos.Command command)
- Queues up an STP/1 message sent from another thread and wakes up selector to register it to the
key.
- Parameters:
command - to add to the request queue
sendEnableStp1
public void sendEnableStp1()
sendQuit
public void sendQuit()
canRead
public boolean canRead(java.nio.channels.SelectableChannel channel)
throws java.io.IOException
- Specified by:
canRead in interface SocketListener
- Returns:
- true if more reading is expected.
- Throws:
java.io.IOException
canWrite
public boolean canWrite(java.nio.channels.SelectableChannel channel)
throws java.io.IOException
- Specified by:
canWrite in interface SocketListener
- Returns:
- true if more writing is needed.
- Throws:
java.io.IOException
close
public void close()
- Switches the wait state and wakes up the selector to process.
parseServiceList
public void parseServiceList(java.lang.String message)
- Processes an incoming message and passes it to event handler if needed, the following events
are to our interest: Runtime-Started : ecmascript runtime starts in Opera (that we can inject
to) Runtime-Stopped : ecmascript runtime stops (not used, buggy) Message: fired from console
log event Updated-Window: a window is updated OR created (opener-id=0) Active-Window: window
focus changed Window-Closed: self explanatory If message matches none it is added to the
response queue (probably response to command).
Copyright © 2011. All Rights Reserved.