org.springframework.yarn.integration
Class IntegrationAppmasterService<T>

java.lang.Object
  extended by org.springframework.yarn.support.LifecycleObjectSupport
      extended by org.springframework.yarn.integration.support.IntegrationObjectSupport
          extended by org.springframework.yarn.integration.IntegrationAppmasterService<T>
All Implemented Interfaces:
Aware, BeanFactoryAware, InitializingBean, Lifecycle, Phased, SmartLifecycle, org.springframework.yarn.am.AppmasterService
Direct Known Subclasses:
MindAppmasterService

public abstract class IntegrationAppmasterService<T>
extends IntegrationObjectSupport
implements org.springframework.yarn.am.AppmasterService

Base implementation of AppmasterService using Spring Integration Ip channels as a communication link.

Author:
Janne Valkealahti

Constructor Summary
IntegrationAppmasterService()
           
 
Method Summary
protected  void doStart()
           
protected  void doStop()
           
 String getHost()
           
 int getPort()
           
abstract  org.springframework.yarn.am.RpcMessage<T> handleMessageInternal(org.springframework.yarn.am.RpcMessage<T> message)
          Implementor need to write this method to process incoming messages.
 boolean hasPort()
           
 void setMessageChannel(SubscribableChannel messageChannel)
          Sets the message channel where messages are dispatched.
 void setSocketSupport(PortExposingTcpSocketSupport socketSupport)
          Sets the socket support for this service.
 
Methods inherited from class org.springframework.yarn.integration.support.IntegrationObjectSupport
getConversionService, setConversionService
 
Methods inherited from class org.springframework.yarn.support.LifecycleObjectSupport
afterPropertiesSet, getBeanFactory, getPhase, getTaskExecutor, getTaskScheduler, getYarnEventPublisher, isAutoStartup, isRunning, onInit, setAutoStartup, setBeanFactory, setPhase, setTaskExecutor, setTaskScheduler, setYarnEventPublisher, start, stop, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntegrationAppmasterService

public IntegrationAppmasterService()
Method Detail

doStart

protected void doStart()
Overrides:
doStart in class org.springframework.yarn.support.LifecycleObjectSupport

doStop

protected void doStop()
Overrides:
doStop in class org.springframework.yarn.support.LifecycleObjectSupport

getPort

public int getPort()
Specified by:
getPort in interface org.springframework.yarn.am.AppmasterService

getHost

public String getHost()
Specified by:
getHost in interface org.springframework.yarn.am.AppmasterService

hasPort

public boolean hasPort()
Specified by:
hasPort in interface org.springframework.yarn.am.AppmasterService

handleMessageInternal

public abstract org.springframework.yarn.am.RpcMessage<T> handleMessageInternal(org.springframework.yarn.am.RpcMessage<T> message)
Implementor need to write this method to process incoming messages.

Parameters:
message - the rpc message wrapping a protocol content
Returns:
a reply rpc message

setMessageChannel

public void setMessageChannel(SubscribableChannel messageChannel)
Sets the message channel where messages are dispatched.

Parameters:
messageChannel - the message channel

setSocketSupport

public void setSocketSupport(PortExposingTcpSocketSupport socketSupport)
Sets the socket support for this service.

Parameters:
socketSupport - the socket support