org.kuali.rice.ksb.messaging
Class MessageServiceInvoker

java.lang.Object
  extended by org.kuali.rice.ksb.messaging.MessageServiceInvoker
All Implemented Interfaces:
Runnable

public class MessageServiceInvoker
extends Object
implements Runnable

Handles invocation of a PersistedMessageBO.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Field Summary
protected static org.apache.log4j.Logger LOG
           
 
Constructor Summary
MessageServiceInvoker(PersistedMessageBO message)
           
 
Method Summary
 PersistedMessageBO getMessage()
           
 AsynchronousCall getMethodCall()
           
protected  Object getQueueService(ServiceConfiguration serviceConfiguration)
          Because this is a queue we just need to grab one.
 Object getService()
           
protected  Object getService(ServiceConfiguration serviceConfiguration)
           
protected  Object getTopicService(ServiceConfiguration serviceConfiguration)
          Get the service as a topic.
protected  Object invokeService(AsynchronousCall methodCall)
          Invokes the AsynchronousCall represented on the methodCall on the service contained in the ServiceInfo object on the AsynchronousCall.
protected  void notifyGlobalCallbacks(AsynchronousCall methodCall, Object callResult)
           
protected  void notifyOnCallback(AsynchronousCall methodCall, AsynchronousCallback callback, Object callResult)
           
protected  void notifyOnCallback(AsynchronousCall methodCall, Object callResult)
          Used in case the thread that dumped this work into the queue is waiting for the work to be done to continue processing.
protected  void placeInExceptionRouting(Throwable t, AsynchronousCall call, Object service)
          Executed when an exception is encountered during message invocation.
 void run()
           
 void setMessage(PersistedMessageBO message)
           
 void setMethodCall(AsynchronousCall methodCall)
           
 void setService(Object service)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static final org.apache.log4j.Logger LOG
Constructor Detail

MessageServiceInvoker

public MessageServiceInvoker(PersistedMessageBO message)
Method Detail

run

public void run()
Specified by:
run in interface Runnable

placeInExceptionRouting

protected void placeInExceptionRouting(Throwable t,
                                       AsynchronousCall call,
                                       Object service)
Executed when an exception is encountered during message invocation. Attempts to call the ExceptionHandler for the message, if that fails it will attempt to set the status of the message in the queue to "EXCEPTION".


invokeService

protected Object invokeService(AsynchronousCall methodCall)
                        throws Exception
Invokes the AsynchronousCall represented on the methodCall on the service contained in the ServiceInfo object on the AsynchronousCall.

Throws:
Exception

getService

protected Object getService(ServiceConfiguration serviceConfiguration)

getTopicService

protected Object getTopicService(ServiceConfiguration serviceConfiguration)
Get the service as a topic. This means we want to contact every service that is a part of this topic. We've grabbed all the services that are a part of this topic and we want to make sure that we get everyone of them = that is we want to circumvent loadbalancing and therefore not ask for the service by it's name but the url to get the exact service we want.

Parameters:
serviceInfo -
Returns:

getQueueService

protected Object getQueueService(ServiceConfiguration serviceConfiguration)
Because this is a queue we just need to grab one.

Parameters:
serviceInfo -
Returns:

notifyOnCallback

protected void notifyOnCallback(AsynchronousCall methodCall,
                                Object callResult)
Used in case the thread that dumped this work into the queue is waiting for the work to be done to continue processing.

Parameters:
callback -

notifyGlobalCallbacks

protected void notifyGlobalCallbacks(AsynchronousCall methodCall,
                                     Object callResult)

notifyOnCallback

protected void notifyOnCallback(AsynchronousCall methodCall,
                                AsynchronousCallback callback,
                                Object callResult)

getMessage

public PersistedMessageBO getMessage()

setMessage

public void setMessage(PersistedMessageBO message)

getService

public Object getService()

getMethodCall

public AsynchronousCall getMethodCall()

setMethodCall

public void setMethodCall(AsynchronousCall methodCall)

setService

public void setService(Object service)


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.