org.mule.component
Class AbstractJavaComponent
java.lang.Object
org.mule.component.AbstractComponent
org.mule.component.AbstractJavaComponent
- All Implemented Interfaces:
- Component, JavaComponent, MuleContextAware, Interceptor, Disposable, Initialisable, Lifecycle, Startable, Stoppable
- Direct Known Subclasses:
- DefaultJavaComponent, JcaComponent, PooledJavaComponent, SimpleCallableJavaComponent
public abstract class AbstractJavaComponent
- extends AbstractComponent
- implements JavaComponent
Abstract implementation of JavaComponent adds JavaComponent specific's:
EntryPointResolverSet
, BindingCollection
and
ObjectFactory
. Provides default implementations of doOnCall and doOnEvent
and defines abstract template methods provided for obtaining and returning the
component object instance.
Fields inherited from class org.mule.component.AbstractComponent |
disposed, disposing, initialised, interceptors, logger, muleContext, notificationHandler, service, started, statistics, stopping |
Methods inherited from class org.mule.component.AbstractComponent |
checkDisposed, createResultMessage, dispose, doStop, fireComponentNotification, getInterceptors, getService, getStatistics, initialise, intercept, invoke, release, setInterceptors, setMuleContext, setService, start, stop, toString |
Methods inherited from interface org.mule.api.lifecycle.Startable |
start |
Methods inherited from interface org.mule.api.lifecycle.Stoppable |
stop |
entryPointResolverSet
protected EntryPointResolverSet entryPointResolverSet
bindingCollection
protected BindingCollection bindingCollection
objectFactory
protected ObjectFactory objectFactory
lifecycleAdapterFactory
protected LifecycleAdapterFactory lifecycleAdapterFactory
AbstractJavaComponent
public AbstractJavaComponent()
AbstractJavaComponent
public AbstractJavaComponent(ObjectFactory objectFactory)
AbstractJavaComponent
public AbstractJavaComponent(ObjectFactory objectFactory,
EntryPointResolverSet entryPointResolverSet,
BindingCollection bindingCollection)
doInvoke
protected Object doInvoke(MuleEvent event)
throws Exception
- Specified by:
doInvoke
in class AbstractComponent
- Throws:
Exception
invokeComponentInstance
protected Object invokeComponentInstance(MuleEvent event)
throws Exception
- Throws:
Exception
getObjectType
public Class getObjectType()
- Specified by:
getObjectType
in interface JavaComponent
- Returns:
createLifeCycleAdaptor
protected LifecycleAdapter createLifeCycleAdaptor()
throws MuleException,
Exception
- Creates and initialises a new LifecycleAdaptor instance wrapped the component
object instance obtained from the configured object factory.
- Returns:
-
- Throws:
MuleException
Exception
borrowComponentLifecycleAdaptor
protected abstract LifecycleAdapter borrowComponentLifecycleAdaptor()
throws Exception
- Throws:
Exception
returnComponentLifecycleAdaptor
protected abstract void returnComponentLifecycleAdaptor(LifecycleAdapter lifecycleAdapter)
throws Exception
- Throws:
Exception
doInitialise
protected void doInitialise()
throws InitialisationException
- Overrides:
doInitialise
in class AbstractComponent
- Throws:
InitialisationException
doStart
protected void doStart()
throws MuleException
- Overrides:
doStart
in class AbstractComponent
- Throws:
MuleException
doDispose
protected void doDispose()
- Overrides:
doDispose
in class AbstractComponent
getEntryPointResolverSet
public EntryPointResolverSet getEntryPointResolverSet()
- Description copied from interface:
JavaComponent
- A
JavaComponent
can have a custom entry-point resolver for its own
object. By default this is null. When set this resolver will override the
resolver on the model
- Specified by:
getEntryPointResolverSet
in interface JavaComponent
- Returns:
- Null is a resolver set has not been set otherwise the resolver to use
on this service
getBindingCollection
public BindingCollection getBindingCollection()
- Specified by:
getBindingCollection
in interface JavaComponent
setEntryPointResolverSet
public void setEntryPointResolverSet(EntryPointResolverSet entryPointResolverSet)
- Description copied from interface:
JavaComponent
- A
JavaComponent
can have a custom entry-point resolver for its own
object. By default this is null. When set this resolver will override the
resolver on the model
- Specified by:
setEntryPointResolverSet
in interface JavaComponent
setBindingCollection
public void setBindingCollection(BindingCollection bindingCollection)
- Specified by:
setBindingCollection
in interface JavaComponent
setEntryPointResolvers
public void setEntryPointResolvers(Collection entryPointResolvers)
- Allow for incremental addition of resolvers by for example the spring-config
module
- Parameters:
entryPointResolvers
- Resolvers to add
getObjectFactory
public ObjectFactory getObjectFactory()
- Specified by:
getObjectFactory
in interface JavaComponent
- Returns:
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
getLifecycleAdapterFactory
public LifecycleAdapterFactory getLifecycleAdapterFactory()
- Description copied from interface:
JavaComponent
- Returns the factory used create life-cycle adaptors that are used to wrap
component instance.
- Specified by:
getLifecycleAdapterFactory
in interface JavaComponent
- Returns:
setLifecycleAdapterFactory
public void setLifecycleAdapterFactory(LifecycleAdapterFactory lifecycleAdapterFactory)
- Description copied from interface:
JavaComponent
- Sets the factory used create life-cycle adaptors that are used to wrap
component instance.
- Specified by:
setLifecycleAdapterFactory
in interface JavaComponent
Copyright © 2003-2009 MuleSource, Inc.. All Rights Reserved.