Package net.sf.basedb.clients.web.util
Class SimpleSignalProgressReporter
java.lang.Object
net.sf.basedb.core.SimpleProgressReporter
net.sf.basedb.clients.web.util.SimpleSignalProgressReporter
- All Implemented Interfaces:
ProgressReporter
,SignalReceiver
This class can be used to report progress and hold signal receiver
for those export plugins that download immediately.
There can only be one SignalHandler registerd at a time to this class.
- Version:
- 2.8
- Author:
- Martin
-
Field Summary
Modifier and TypeFieldDescriptionprivate SignalHandler
private static final Logger
Log signals processing.private Thread
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close
(int wait) Close the receiver.Class<? extends SignalTransporter>
This class does not need any signal transporter.void
Nothing need to be initilized.registerSignalHandler
(SignalHandler handler) This return null when there is no need for a global id.void
sendToAll
(SignalSender sender) Let the signal sender send one or more signals to all registered signal handlers on this reciever.void
unregisterSignalHandler
(SignalHandler handler) Unregister a signal handler from this receiever.Methods inherited from class net.sf.basedb.core.SimpleProgressReporter
append, display, getError, getMessage, getPercent, setError
-
Field Details
-
logger
Log signals processing. -
handler
-
notifyThread
-
-
Constructor Details
-
SimpleSignalProgressReporter
-
-
Method Details
-
close
public void close(int wait) Description copied from interface:SignalReceiver
Close the receiver. The receiver should close and cleanup any opened resources, unregister itself if neccesary and stop listening for signals.- Specified by:
close
in interfaceSignalReceiver
- Parameters:
wait
- If the value is zero or positive, theSignal.ABORT
should be sent to all registered signal handlers. The signal receiver should then wait at most the specified number of milliseconds for all signal handlers to get unregistered. If the timeout expires before all signal handlers has processed the signal, the signal receiver should continue it's shutdown.
-
getSignalTransporterClass
This class does not need any signal transporter.- Specified by:
getSignalTransporterClass
in interfaceSignalReceiver
- Returns:
- A class objects that must be a subclass of
SignalTransporter
- See Also:
-
init
Nothing need to be initilized.- Specified by:
init
in interfaceSignalReceiver
- Parameters:
receiverId
- Parameters needed to initialise the receiver- See Also:
-
registerSignalHandler
This return null when there is no need for a global id.- Specified by:
registerSignalHandler
in interfaceSignalReceiver
- Parameters:
handler
- The signal handler that should receive signals through this receiver- Returns:
- A string that allows a transporter instance locate and send a signal to the given signal handler
- See Also:
-
sendToAll
Description copied from interface:SignalReceiver
Let the signal sender send one or more signals to all registered signal handlers on this reciever.- Specified by:
sendToAll
in interfaceSignalReceiver
- Parameters:
sender
- A signal sender implementation
-
unregisterSignalHandler
Description copied from interface:SignalReceiver
Unregister a signal handler from this receiever. After this method returns, the receiver must not send any more signals to the specified handler.- Specified by:
unregisterSignalHandler
in interfaceSignalReceiver
- Parameters:
handler
- The handler to unregister
-