public class ServiceMethodAdaptor extends java.lang.Object implements ServiceAdaptor
ServiceAdaptor that uses a start and stop method.| Constructor and Description |
|---|
ServiceMethodAdaptor(java.lang.Object component,
java.lang.reflect.Method startMethod,
java.lang.reflect.Method stopMethod)
Create a new instance.
|
ServiceMethodAdaptor(java.lang.Object component,
java.lang.reflect.Method startMethod,
java.lang.reflect.Method stopMethod,
java.lang.reflect.Method acceptExceptionListenerMethod)
Create a new instance with stop handle and exception listener.
|
| Modifier and Type | Method and Description |
|---|---|
void |
acceptExceptionListener(java.beans.ExceptionListener exceptionListener)
Accept an exception listener.
|
java.util.Optional<AsyncService> |
asAsync()
Possibly create an
AsyncJob. |
java.lang.Object |
getComponent()
Get the component being adapted.
|
void |
start()
Start the service.
|
void |
stop()
Stop executing.
|
public ServiceMethodAdaptor(java.lang.Object component,
java.lang.reflect.Method startMethod,
java.lang.reflect.Method stopMethod)
component - startMethod - stopMethod - public ServiceMethodAdaptor(java.lang.Object component,
java.lang.reflect.Method startMethod,
java.lang.reflect.Method stopMethod,
java.lang.reflect.Method acceptExceptionListenerMethod)
component - startMethod - stopMethod - acceptExceptionListenerMethod - public void start()
throws java.lang.Exception
Servicepublic void stop()
throws FailedToStopException
Stoppablestop in interface StoppableFailedToStopExceptionpublic void acceptExceptionListener(java.beans.ExceptionListener exceptionListener)
FallibleComponentacceptExceptionListener in interface FallibleComponentpublic java.lang.Object getComponent()
ComponentAdaptergetComponent in interface ComponentAdapterpublic java.util.Optional<AsyncService> asAsync()
ServiceAdaptorAsyncJob.asAsync in interface ServiceAdaptor