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.lang.Object |
getComponent()
Get the component being adapted.
|
void |
start() |
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
- acceptStopHandleMethod
- acceptExceptionListenerMethod
- public void start() throws java.lang.Exception
public void stop() throws FailedToStopException
Stoppable
stop
in interface Stoppable
FailedToStopException
public void acceptExceptionListener(java.beans.ExceptionListener exceptionListener)
FallibleComponent
acceptExceptionListener
in interface FallibleComponent
public java.lang.Object getComponent()
ComponentAdapter
getComponent
in interface ComponentAdapter