org.mule.component
Class SimpleCallableJavaComponent
java.lang.Object
org.mule.component.AbstractComponent
org.mule.component.AbstractJavaComponent
org.mule.component.SimpleCallableJavaComponent
- All Implemented Interfaces:
- AnnotatedObject, Component, JavaComponent, FlowConstructAware, MuleContextAware, Disposable, Initialisable, Lifecycle, Startable, Stoppable, MessageProcessor
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
Methods inherited from class org.mule.component.AbstractJavaComponent |
createLifecycleAdaptor, doInitialise, doInvoke, getEntryPointResolverSet, getInterfaceBindings, getLifecycleAdapterFactory, getObjectFactory, injectService, setEntryPointResolvers, setEntryPointResolverSet, setFlowConstruct, setInterfaceBindings, setLifecycleAdapterFactory |
Methods inherited from class org.mule.component.AbstractComponent |
createResultEvent, dispose, fireComponentNotification, getAnnotation, getAnnotations, getFlowConstruct, getInterceptors, getName, getStatistics, initialise, process, release, setAnnotations, setInterceptors, setMuleContext, start, stop, toString |
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
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
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-2012 MuleSoft, Inc.. All Rights Reserved.