001: /*
002: * $Id: JavaComponent.java 11379 2008-03-17 02:46:56Z dfeist $
003: * --------------------------------------------------------------------------------------
004: * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
005: *
006: * The software in this package is published under the terms of the CPAL v1.0
007: * license, a copy of which has been included with this distribution in the
008: * LICENSE.txt file.
009: */
010:
011: package org.mule.api.component;
012:
013: import org.mule.api.model.EntryPointResolverSet;
014: import org.mule.api.object.ObjectFactory;
015: import org.mule.api.routing.NestedRouterCollection;
016: import org.mule.component.PooledJavaComponent;
017: import org.mule.object.PrototypeObjectFactory;
018: import org.mule.object.SingletonObjectFactory;
019:
020: /**
021: * <code>JavaComponent</code> is a Java {@link Component} implementation used to
022: * invoke Java component implementations. A <code>JavaComponent</code> uses an
023: * {@link ObjectFactory} to specify the object instance's source and allows for
024: * singleton and prototype implementations to be used along with other custom
025: * {@link ObjectFactory} that allow component instances to be obtained from
026: * containers such as Spring. A <code>JavaComponent</code> uses a customizable
027: * {@link EntryPointResolverSet} in order to resolve which method should be used for
028: * invocation and allows java bindings to be configure. Java Component bindings, if
029: * implemented by the JavaComponent implementation, uses a component instance proxy
030: * to implement interface methods using calls to outbound endpoints.
031: */
032: public interface JavaComponent extends Component {
033:
034: /**
035: * A {@link JavaComponent} can have a custom entry-point resolver for its own
036: * object. By default this is null. When set this resolver will override the
037: * resolver on the model
038: *
039: * @return Null is a resolver set has not been set otherwise the resolver to use
040: * on this service
041: */
042: EntryPointResolverSet getEntryPointResolverSet();
043:
044: /**
045: * A {@link JavaComponent} can have a custom entry-point resolver for its own
046: * object. By default this is null. When set this resolver will override the
047: * resolver on the model
048: *
049: * @return Null is a resolver set has not been set otherwise the resolver to use
050: * on this service
051: */
052: void setEntryPointResolverSet(
053: EntryPointResolverSet entryPointResolverSet);
054:
055: // TODO This should be renamed to something like "Bindings", moved up to
056: // Component. NestedRouter should also be renamed to "Binding" and made more
057: // generic so as to support other types of bindings e.g. wsdl port -> ws-endpont,
058: // or script context variable -> outbound endpoint etc. See MULE-3114
059: NestedRouterCollection getNestedRouter();
060:
061: void setNestedRouter(NestedRouterCollection nestedRouter);
062:
063: /**
064: * The object factory used to obtain the component object instance. Mule core
065: * provides two implementations: {@link SingletonObjectFactory} and
066: * {@link PrototypeObjectFactory}.<br/> The spring-config module provides an
067: * {@link ObjectFactory} implementation that delegates to spring. There is no
068: * PooledObjectFactory, the {@link PooledJavaComponent} should be used for
069: * pooling.
070: *
071: * @param objectFactory
072: */
073: void setObjectFactory(ObjectFactory objectFactory);
074:
075: /**
076: * @return
077: */
078: ObjectFactory getObjectFactory();
079:
080: /**
081: * @return
082: */
083: Class getObjectType();
084:
085: /**
086: * Returns the factory used create life-cycle adaptors that are used to wrap
087: * component instance.
088: *
089: * @return
090: */
091: public LifecycleAdapterFactory getLifecycleAdapterFactory();
092:
093: /**
094: * Sets the factory used create life-cycle adaptors that are used to wrap
095: * component instance.
096: *
097: * @param lifecycleAdaptor
098: */
099: public void setLifecycleAdapterFactory(
100: LifecycleAdapterFactory lifecycleAdaptor);
101: }
|