org.oddjob.framework
Class ServiceMethodAdaptor

java.lang.Object
  extended by org.oddjob.framework.ServiceMethodAdaptor
All Implemented Interfaces:
ComponentAdapter, Service, ServiceAdaptor, Stoppable

public class ServiceMethodAdaptor
extends Object
implements ServiceAdaptor

A ServiceAdaptor that uses a start and stop method.

Author:
rob

Constructor Summary
ServiceMethodAdaptor(Object component, Method startMethod, Method stopMethod)
           
 
Method Summary
 Object getComponent()
          The component being adapted.
 void start()
           
 void stop()
          Stop executing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceMethodAdaptor

public ServiceMethodAdaptor(Object component,
                            Method startMethod,
                            Method stopMethod)
Method Detail

start

public void start()
           throws Exception
Specified by:
start in interface Service
Throws:
Exception

stop

public void stop()
          throws FailedToStopException
Description copied from interface: Stoppable
Stop executing. This method should not return until the Stoppable has actually stopped.

Specified by:
stop in interface Stoppable
Throws:
FailedToStopException

getComponent

public Object getComponent()
Description copied from interface: ServiceAdaptor
The component being adapted.

Specified by:
getComponent in interface ComponentAdapter
Specified by:
getComponent in interface ServiceAdaptor
Returns:
The component.