org.mule.component
Class SimpleCallableJavaComponent

java.lang.Object
  extended by org.mule.component.AbstractComponent
      extended by org.mule.component.AbstractJavaComponent
          extended by org.mule.component.SimpleCallableJavaComponent
All Implemented Interfaces:
Component, JavaComponent, MuleContextAware, Interceptor, Disposable, Initialisable, Lifecycle, Startable, Stoppable

public class SimpleCallableJavaComponent
extends AbstractJavaComponent

Simple JavaComponent implementation to be used when LifecycleAdapter is not required because i) the object instance implements Callable and so entry-point resolution is required and ii) component bindings are not used.
An ObjectFactory can be set but must return object instances that implement Callable. If one of the constructors that takes just a Class or the instance itself is used then the SingletonObjectFactory is used by default.
This implementation replaces and improves on OptimizedComponent/OptimizedMuleProxy


Field Summary
 
Fields inherited from class org.mule.component.AbstractJavaComponent
bindingCollection, entryPointResolverSet, lifecycleAdapterFactory, objectFactory
 
Fields inherited from class org.mule.component.AbstractComponent
disposed, disposing, initialised, interceptors, logger, muleContext, notificationHandler, service, statistics, stopping
 
Fields inherited from interface org.mule.api.lifecycle.Initialisable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Startable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Stoppable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Disposable
PHASE_NAME
 
Constructor Summary
SimpleCallableJavaComponent()
           
SimpleCallableJavaComponent(Callable callable)
          Create an SimpleCallableJavaComponent instance using an object instance that implements Callable
SimpleCallableJavaComponent(Class callable)
          Create an SimpleCallableJavaComponent instance using an object class.
SimpleCallableJavaComponent(ObjectFactory objectFactory)
           
 
Method Summary
protected  LifecycleAdapter borrowComponentLifecycleAdaptor()
           
protected  void doDispose()
           
protected  void doStart()
           
protected  void doStop()
           
 Class getObjectType()
           
protected  Object invokeComponentInstance(MuleEvent event)
           
protected  void returnComponentLifecycleAdaptor(LifecycleAdapter lifecycleAdapter)
           
 void setObjectFactory(ObjectFactory objectFactory)
          The object factory used to obtain the component object instance.
 
Methods inherited from class org.mule.component.AbstractJavaComponent
createLifeCycleAdaptor, doInitialise, doInvoke, getBindingCollection, getEntryPointResolverSet, getLifecycleAdapterFactory, getObjectFactory, setBindingCollection, setEntryPointResolvers, setEntryPointResolverSet, setLifecycleAdapterFactory
 
Methods inherited from class org.mule.component.AbstractComponent
checkDisposed, createResultMessage, dispose, fireComponentNotification, getInterceptors, getService, getStatistics, initialise, intercept, invoke, release, setInterceptors, setMuleContext, setService, start, stop, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mule.api.component.Component
getService, getStatistics, invoke, setService
 
Methods inherited from interface org.mule.api.lifecycle.Initialisable
initialise
 
Methods inherited from interface org.mule.api.lifecycle.Startable
start
 
Methods inherited from interface org.mule.api.lifecycle.Stoppable
stop
 
Methods inherited from interface org.mule.api.lifecycle.Disposable
dispose
 

Constructor Detail

SimpleCallableJavaComponent

public SimpleCallableJavaComponent()

SimpleCallableJavaComponent

public SimpleCallableJavaComponent(Callable callable)
Create an SimpleCallableJavaComponent instance using an object instance that implements Callable

Parameters:
callable -

SimpleCallableJavaComponent

public SimpleCallableJavaComponent(Class callable)
                            throws DefaultMuleException
Create an SimpleCallableJavaComponent instance using an object class. This class should implement Callable.

Parameters:
callable -
Throws:
DefaultMuleException - if the Class specified does not implement Callable

SimpleCallableJavaComponent

public SimpleCallableJavaComponent(ObjectFactory objectFactory)
                            throws DefaultMuleException
Throws:
DefaultMuleException
Method Detail

doStart

protected void doStart()
                throws MuleException
Overrides:
doStart in class AbstractJavaComponent
Throws:
MuleException

doStop

protected void doStop()
               throws MuleException
Overrides:
doStop in class AbstractComponent
Throws:
MuleException

doDispose

protected void doDispose()
Overrides:
doDispose in class AbstractJavaComponent

getObjectType

public Class getObjectType()
Specified by:
getObjectType in interface JavaComponent
Overrides:
getObjectType in class AbstractJavaComponent
Returns:

borrowComponentLifecycleAdaptor

protected LifecycleAdapter borrowComponentLifecycleAdaptor()
                                                    throws Exception
Specified by:
borrowComponentLifecycleAdaptor in class AbstractJavaComponent
Throws:
Exception

returnComponentLifecycleAdaptor

protected void returnComponentLifecycleAdaptor(LifecycleAdapter lifecycleAdapter)
Specified by:
returnComponentLifecycleAdaptor in class AbstractJavaComponent

invokeComponentInstance

protected Object invokeComponentInstance(MuleEvent event)
                                  throws Exception
Overrides:
invokeComponentInstance in class AbstractJavaComponent
Throws:
Exception

setObjectFactory

public void setObjectFactory(ObjectFactory objectFactory)
Description copied from interface: JavaComponent
The object factory used to obtain the component object instance. Mule core provides two implementations: SingletonObjectFactory and PrototypeObjectFactory.
The spring-config module provides an ObjectFactory implementation that delegates to spring. There is no PooledObjectFactory, the PooledJavaComponent should be used for pooling.

Specified by:
setObjectFactory in interface JavaComponent
Overrides:
setObjectFactory in class AbstractJavaComponent


Copyright © 2003-2009 MuleSource, Inc.. All Rights Reserved.