org.eclipse.net4j.signal
Class RequestWithConfirmation<RESULT>

java.lang.Object
  extended by org.eclipse.net4j.signal.Signal
      extended by org.eclipse.net4j.signal.SignalActor
          extended by org.eclipse.net4j.signal.RequestWithConfirmation<RESULT>
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
RequestWithMonitoring

public abstract class RequestWithConfirmation<RESULT>
extends SignalActor

Represents the sender side of a two-way signal, i.e., one with a response.


Field Summary
 
Fields inherited from class org.eclipse.net4j.signal.Signal
NO_TIMEOUT
 
Constructor Summary
RequestWithConfirmation(SignalProtocol<?> protocol, Enum<?> literal)
           
RequestWithConfirmation(SignalProtocol<?> protocol, short signalID)
           
RequestWithConfirmation(SignalProtocol<?> protocol, short id, String name)
           
 
Method Summary
protected abstract  RESULT confirming(ExtendedDataInputStream in)
          Important Note: The confirmation must not be empty, i.e. the stream must be used at least to read a boolean.
protected  ExecutorService getAsyncExecutorService()
           
protected abstract  void requesting(ExtendedDataOutputStream out)
           
 RESULT send()
           
 RESULT send(long timeout)
           
 Future<RESULT> sendAsync()
           
 
Methods inherited from class org.eclipse.net4j.signal.SignalActor
execute
 
Methods inherited from class org.eclipse.net4j.signal.Signal
finishInputStream, finishOutputStream, flush, getBufferInputStream, getBufferOutputStream, getCorrelationID, getCurrentInputStream, getCurrentOutputStream, getID, getName, getProtocol, run, toString, wrapInputStream, wrapOutputStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RequestWithConfirmation

public RequestWithConfirmation(SignalProtocol<?> protocol,
                               short id,
                               String name)
Since:
2.0

RequestWithConfirmation

public RequestWithConfirmation(SignalProtocol<?> protocol,
                               short signalID)
Since:
2.0

RequestWithConfirmation

public RequestWithConfirmation(SignalProtocol<?> protocol,
                               Enum<?> literal)
Since:
2.0
Method Detail

sendAsync

public Future<RESULT> sendAsync()
Since:
2.0

send

public RESULT send()
            throws Exception,
                   RemoteException
Throws:
Exception
RemoteException
Since:
2.0

send

public RESULT send(long timeout)
            throws Exception,
                   RemoteException
Throws:
Exception
RemoteException
Since:
2.0

getAsyncExecutorService

protected ExecutorService getAsyncExecutorService()
Since:
2.0

requesting

protected abstract void requesting(ExtendedDataOutputStream out)
                            throws Exception
Throws:
Exception

confirming

protected abstract RESULT confirming(ExtendedDataInputStream in)
                              throws Exception
Important Note: The confirmation must not be empty, i.e. the stream must be used at least to read a boolean. Otherwise synchronization problems will result!

Throws:
Exception


Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.