org.eclipse.net4j.signal
Class SignalProtocol

java.lang.Object
  extended by org.eclipse.net4j.util.event.Notifier
      extended by org.eclipse.net4j.util.lifecycle.Lifecycle
          extended by org.eclipse.net4j.protocol.Protocol
              extended by org.eclipse.net4j.signal.SignalProtocol
All Implemented Interfaces:
IBufferHandler, IProtocol, INotifier, INotifier.Introspection, ILifecycle, ILifecycle.Introspection

public abstract class SignalProtocol
extends Protocol


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle
ILifecycle.Introspection
 
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier
INotifier.Introspection
 
Field Summary
static long NO_TIMEOUT
           
 
Fields inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle
USE_LABEL
 
Constructor Summary
protected SignalProtocol()
           
 
Method Summary
 void addStreamWrapper(IStreamWrapper streamWrapper)
           
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.
 void finishInputStream(java.io.InputStream in)
           
 void finishOutputStream(java.io.OutputStream out)
           
 long getInputStreamTimeout()
           
 IStreamWrapper getStreamWrapper()
           
 void handleBuffer(IBuffer buffer)
          Handles an IBuffer and optionally releases it.
protected  SignalReactor provideSignalReactor(short signalID)
           
 void setStreamWrapper(IStreamWrapper streamWrapper)
           
 java.lang.String toString()
           
 boolean waitForSignals(long timeout)
           
 java.io.InputStream wrapInputStream(java.io.InputStream in)
           
 java.io.OutputStream wrapOutputStream(java.io.OutputStream out)
           
 
Methods inherited from class org.eclipse.net4j.protocol.Protocol
doBeforeActivate, doDeactivate, getBufferProvider, getChannel, getExecutorService, getInfraStructure, setBufferProvider, setChannel, setExecutorService, setInfraStructure
 
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 org.eclipse.net4j.util.event.Notifier
addListener, fireEvent, getListeners, hasListeners, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.net4j.protocol.IProtocol
getType
 

Field Detail

NO_TIMEOUT

public static final long NO_TIMEOUT
See Also:
Constant Field Values
Constructor Detail

SignalProtocol

protected SignalProtocol()
Method Detail

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.


Copyright (c) 2004 - 2008 Eike Stepper, Germany.
All Rights Reserved.