org.eclipse.net4j.signal
Class SignalProtocol
java.lang.Object
org.eclipse.net4j.util.event.Notifier
org.eclipse.net4j.util.lifecycle.Lifecycle
org.eclipse.net4j.protocol.Protocol
org.eclipse.net4j.signal.SignalProtocol
- All Implemented Interfaces:
- IBufferHandler, IProtocol, INotifier, INotifier.Introspection, ILifecycle, ILifecycle.Introspection
public abstract class SignalProtocol
- extends Protocol
Methods inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle |
activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, deferredDeactivate, doActivate, doBeforeDeactivate, dump, getLifecycleState, isActive, isDeferredActivation, isDeferredDeactivation |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
NO_TIMEOUT
public static final long NO_TIMEOUT
- See Also:
- Constant Field Values
SignalProtocol
protected SignalProtocol()
getStreamWrapper
public IStreamWrapper getStreamWrapper()
setStreamWrapper
public void setStreamWrapper(IStreamWrapper streamWrapper)
addStreamWrapper
public void addStreamWrapper(IStreamWrapper streamWrapper)
waitForSignals
public boolean waitForSignals(long timeout)
wrapInputStream
public java.io.InputStream wrapInputStream(java.io.InputStream in)
throws java.io.IOException
- Throws:
java.io.IOException
wrapOutputStream
public java.io.OutputStream wrapOutputStream(java.io.OutputStream out)
throws java.io.IOException
- Throws:
java.io.IOException
finishInputStream
public void finishInputStream(java.io.InputStream in)
throws java.io.IOException
- Throws:
java.io.IOException
finishOutputStream
public void finishOutputStream(java.io.OutputStream out)
throws java.io.IOException
- Throws:
java.io.IOException
handleBuffer
public void handleBuffer(IBuffer buffer)
- Description copied from interface:
IBufferHandler
- Handles an
IBuffer
and optionally releases it. The implementor of this method takes over the ownership of
the buffer. Care must be taken to properly release
the buffer if the ownership is not
explicitely passed to some further party.
- Parameters:
buffer
- The buffer to be handled and otionally released.
getInputStreamTimeout
public long getInputStreamTimeout()
toString
public java.lang.String toString()
- Overrides:
toString
in class Lifecycle
provideSignalReactor
protected final SignalReactor provideSignalReactor(short signalID)
createSignalReactor
protected abstract SignalReactor createSignalReactor(short signalID)
- Returns a new signal instance to serve the given signal ID or
null
if the signal ID is invalid/unknown
for this protocol.