org.apache.servicemix.bean
Class BeanEndpoint

java.lang.Object
  extended by org.apache.servicemix.common.endpoints.AbstractEndpoint
      extended by org.apache.servicemix.common.endpoints.SimpleEndpoint
          extended by org.apache.servicemix.common.endpoints.ProviderEndpoint
              extended by org.apache.servicemix.bean.BeanEndpoint
All Implemented Interfaces:
Endpoint, org.springframework.context.ApplicationContextAware

public class BeanEndpoint
extends ProviderEndpoint
implements org.springframework.context.ApplicationContextAware

Represents a bean endpoint which consists of a together with a MethodInvocationStrategy so that JBI message exchanges can be invoked on the bean.

Version:
$Revision: $

Nested Class Summary
protected  class BeanEndpoint.PojoChannel
           
protected  class BeanEndpoint.PojoContext
           
 
Field Summary
 
Fields inherited from class org.apache.servicemix.common.endpoints.AbstractEndpoint
definition, description, endpoint, interfaceName, logger, service, serviceUnit
 
Constructor Summary
BeanEndpoint()
           
BeanEndpoint(BeanComponent component, javax.jbi.servicedesc.ServiceEndpoint serviceEndpoint)
           
 
Method Summary
protected  void checkEndOfRequest(Request request, Object corId)
           
protected  Object createBean()
           
protected  MethodInvocationStrategy createMethodInvocationStrategy()
           
protected  void evaluateCallbacks(Request req)
           
 org.springframework.context.ApplicationContext getApplicationContext()
           
 Object getBean()
           
 String getBeanClassName()
           
 BeanInfo getBeanInfo()
           
 String getBeanName()
           
 Class<?> getBeanType()
           
protected  Object getCorrelation(javax.jbi.messaging.MessageExchange exchange)
           
 org.apache.servicemix.expression.Expression getCorrelationExpression()
           
 MethodInvocationStrategy getMethodInvocationStrategy()
           
protected  Request getOrCreateCurrentRequest(javax.jbi.messaging.MessageExchange exchange)
           
protected  void injectBean(Object target)
          A strategy method to allow implementations to perform some custom JBI based injection of the POJO
protected  void onConsumerExchange(javax.jbi.messaging.MessageExchange exchange)
           
protected  void onProviderExchange(javax.jbi.messaging.MessageExchange exchange)
           
 void process(javax.jbi.messaging.MessageExchange exchange)
           
 Future<javax.jbi.messaging.NormalizedMessage> send(String uri, javax.jbi.messaging.NormalizedMessage message)
          Used by POJOs acting as a consumer
 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
           
 void setBean(Object bean)
           
 void setBeanClassName(String beanClassName)
           
 void setBeanInfo(BeanInfo beanInfo)
           
 void setBeanName(String beanName)
           
 void setBeanType(Class<?> beanType)
           
 void setCorrelationExpression(org.apache.servicemix.expression.Expression correlationExpression)
           
 void setMethodInvocationStrategy(MethodInvocationStrategy methodInvocationStrategy)
           
 void start()
           
 void stop()
           
 
Methods inherited from class org.apache.servicemix.common.endpoints.ProviderEndpoint
activate, deactivate, getRole, processInOnly, processInOut
 
Methods inherited from class org.apache.servicemix.common.endpoints.SimpleEndpoint
done, fail, getChannel, getContext, getExchangeFactory, send, sendSync
 
Methods inherited from class org.apache.servicemix.common.endpoints.AbstractEndpoint
getDefinition, getDescription, getEndpoint, getInterfaceName, getKey, getService, getServiceUnit, isExchangeOkay, prepareExchange, setDefinition, setDescription, setEndpoint, setInterfaceName, setService, setServiceUnit, toString, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BeanEndpoint

public BeanEndpoint()

BeanEndpoint

public BeanEndpoint(BeanComponent component,
                    javax.jbi.servicedesc.ServiceEndpoint serviceEndpoint)
Method Detail

start

public void start()
           throws Exception
Specified by:
start in interface Endpoint
Overrides:
start in class SimpleEndpoint
Throws:
Exception

stop

public void stop()
          throws Exception
Specified by:
stop in interface Endpoint
Overrides:
stop in class SimpleEndpoint
Throws:
Exception

getApplicationContext

public org.springframework.context.ApplicationContext getApplicationContext()

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
                           throws org.springframework.beans.BeansException
Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
Throws:
org.springframework.beans.BeansException

getBeanName

public String getBeanName()

setBeanName

public void setBeanName(String beanName)

getBean

public Object getBean()

setBean

public void setBean(Object bean)

getBeanType

public Class<?> getBeanType()
Returns:
the beanType

setBeanType

public void setBeanType(Class<?> beanType)
Parameters:
beanType - the beanType to set

getBeanClassName

public String getBeanClassName()
Returns:
the beanClassName

setBeanClassName

public void setBeanClassName(String beanClassName)
Parameters:
beanClassName - the beanClassName to set

getBeanInfo

public BeanInfo getBeanInfo()

setBeanInfo

public void setBeanInfo(BeanInfo beanInfo)

getMethodInvocationStrategy

public MethodInvocationStrategy getMethodInvocationStrategy()

setMethodInvocationStrategy

public void setMethodInvocationStrategy(MethodInvocationStrategy methodInvocationStrategy)

process

public void process(javax.jbi.messaging.MessageExchange exchange)
             throws Exception
Specified by:
process in interface Endpoint
Overrides:
process in class ProviderEndpoint
Throws:
Exception

onProviderExchange

protected void onProviderExchange(javax.jbi.messaging.MessageExchange exchange)
                           throws Exception
Throws:
Exception

getOrCreateCurrentRequest

protected Request getOrCreateCurrentRequest(javax.jbi.messaging.MessageExchange exchange)
                                     throws ClassNotFoundException,
                                            InstantiationException,
                                            IllegalAccessException,
                                            javax.jbi.messaging.MessagingException
Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException
javax.jbi.messaging.MessagingException

onConsumerExchange

protected void onConsumerExchange(javax.jbi.messaging.MessageExchange exchange)
                           throws Exception
Throws:
Exception

getCorrelation

protected Object getCorrelation(javax.jbi.messaging.MessageExchange exchange)
                         throws javax.jbi.messaging.MessagingException
Throws:
javax.jbi.messaging.MessagingException

createBean

protected Object createBean()
                     throws ClassNotFoundException,
                            InstantiationException,
                            IllegalAccessException
Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException

createMethodInvocationStrategy

protected MethodInvocationStrategy createMethodInvocationStrategy()

injectBean

protected void injectBean(Object target)
A strategy method to allow implementations to perform some custom JBI based injection of the POJO

Parameters:
target - the bean to be injected

evaluateCallbacks

protected void evaluateCallbacks(Request req)

send

public Future<javax.jbi.messaging.NormalizedMessage> send(String uri,
                                                          javax.jbi.messaging.NormalizedMessage message)
Used by POJOs acting as a consumer

Parameters:
uri -
message -
Returns:

checkEndOfRequest

protected void checkEndOfRequest(Request request,
                                 Object corId)

getCorrelationExpression

public org.apache.servicemix.expression.Expression getCorrelationExpression()
Returns:
the correlationExpression

setCorrelationExpression

public void setCorrelationExpression(org.apache.servicemix.expression.Expression correlationExpression)
Parameters:
correlationExpression - the correlationExpression to set


Copyright © 2005-2008 The Apache Software Foundation. All Rights Reserved.