public class MuleExtensionUtils extends Object
extensions| Constructor and Description |
|---|
MuleExtensionUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addInterceptorFactory(org.mule.runtime.api.meta.model.declaration.fluent.BaseDeclaration declaration,
org.mule.runtime.extension.api.runtime.InterceptorFactory interceptorFactory)
Adds the given
interceptorFactory to the declaration as the last interceptor in the list |
static void |
addInterceptorFactory(org.mule.runtime.api.meta.model.declaration.fluent.BaseDeclaration declaration,
org.mule.runtime.extension.api.runtime.InterceptorFactory interceptorFactory,
int position)
Adds the given
interceptorFactory to the declaration at the given position |
static List<org.mule.runtime.extension.api.runtime.operation.Interceptor> |
createInterceptors(org.mule.runtime.api.meta.model.EnrichableModel model)
Creates a new
List of interceptors using the factories returned by
InterceptorsModelProperty (if present). |
static List<org.mule.runtime.extension.api.runtime.operation.Interceptor> |
createInterceptors(List<org.mule.runtime.extension.api.runtime.InterceptorFactory> interceptorFactories)
|
static List<org.mule.runtime.api.meta.model.connection.ConnectionProviderModel> |
getAllConnectionProviders(org.mule.runtime.api.meta.model.ExtensionModel extensionModel,
org.mule.runtime.api.meta.model.config.ConfigurationModel configurationModel)
Returns all the
ConnectionProviderModel instances available for the given configurationModel plus the ones
globally defined at the extensionModel. |
static ClassLoader |
getClassLoader(org.mule.runtime.api.meta.model.ExtensionModel extensionModel)
If the
extensionModel contains a ClassLoaderModelProperty, then it returns the ClassLoader associated
to such property. |
static org.mule.runtime.extension.api.runtime.config.ConfigurationFactory |
getConfigurationFactory(org.mule.runtime.api.meta.model.config.ConfigurationModel configurationModel)
Tests the
configurationModel for a ConfigurationFactoryModelProperty and
returns the contained ConfigurationFactory. |
static org.mule.runtime.extension.api.runtime.connectivity.ConnectionProviderFactory |
getConnectionProviderFactory(org.mule.runtime.api.meta.model.connection.ConnectionProviderModel connectionProviderModel)
Tests the given
connectionProviderModel for a ConnectionProviderFactoryModelProperty and if present
it returns the enclosed ConnectionProviderFactory. |
static Class<?> |
getConnectionType(org.mule.runtime.api.meta.model.connection.ConnectionProviderModel connectionProviderModel)
Tests the given
connectionProviderModel for a ConnectionTypeModelProperty and if present
it returns the enclosed connection type. |
static String |
getExtensionsErrorNamespace(org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclaration extensionDeclaration) |
static String |
getExtensionsErrorNamespace(org.mule.runtime.api.meta.model.ExtensionModel extensionModel) |
static Optional<Method> |
getImplementingMethod(org.mule.runtime.api.meta.model.declaration.fluent.OperationDeclaration operationDeclaration)
Returns the
Method that was used to declare the given operationDeclaration. |
static String |
getImplicitConfigurationProviderName(org.mule.runtime.api.meta.model.ExtensionModel extensionModel,
org.mule.runtime.api.meta.model.config.ConfigurationModel implicitConfigurationModel) |
static Event |
getInitialiserEvent() |
static Event |
getInitialiserEvent(MuleContext muleContext) |
static org.mule.runtime.extension.api.metadata.MetadataResolverFactory |
getMetadataResolverFactory(org.mule.runtime.api.meta.model.EnrichableModel model)
Tests the given
model for a MetadataResolverFactoryModelProperty and if present
it returns the contained MetadataResolverFactory. |
static org.mule.runtime.extension.api.runtime.operation.OperationExecutorFactory |
getOperationExecutorFactory(org.mule.runtime.api.meta.model.operation.OperationModel operationModel)
Tests the given
operationModel for a OperationExecutorModelProperty and if present
it returns the enclosed OperationExecutorFactory. |
static org.mule.runtime.extension.api.runtime.source.SourceFactory |
getSourceFactory(org.mule.runtime.api.meta.model.source.SourceModel sourceModel)
Tests the given
sourceModel for a SourceFactoryModelProperty and if present
it returns the enclosed SourceFactory. |
static <T> boolean |
hasAnyDynamic(Iterable<ValueResolver<T>> resolvers)
|
static void |
injectConfigName(org.mule.runtime.api.meta.model.EnrichableModel model,
Object target,
String configName) |
static boolean |
isNullSafe(org.mule.runtime.api.meta.model.parameter.ParameterModel parameterModel) |
static org.mule.runtime.api.meta.model.ExtensionModel |
loadExtension(Class<?> clazz) |
static org.mule.runtime.api.meta.model.ExtensionModel |
loadExtension(Class<?> clazz,
Map<String,Object> params) |
static org.mule.runtime.extension.api.exception.IllegalModelDefinitionException |
noClassLoaderException(String extensionName)
Creates an exception that says that no
ClassLoader was specified for the extension of the given extensionName |
static boolean |
returnsListOfMessages(org.mule.runtime.api.meta.model.ComponentModel componentModel) |
static boolean |
supportsOAuth(org.mule.runtime.api.meta.model.ExtensionModel extensionModel)
Whether at least one
ConnectionProviderModel in the given
supports OAuth authentication |
static byte |
toActionCode(org.mule.runtime.extension.api.tx.OperationTransactionalAction action)
Converts the given
action to its equivalent transactional action as defined in TransactionConfig |
static byte |
toActionCode(org.mule.runtime.extension.api.tx.SourceTransactionalAction action)
Converts the given
action to its equivalent transactional action as defined in TransactionConfig |
static <T> T |
withExtensionClassLoader(org.mule.runtime.api.meta.model.ExtensionModel extensionModel,
Callable<T> callable)
|
public static boolean returnsListOfMessages(org.mule.runtime.api.meta.model.ComponentModel componentModel)
componentModel - a ComponentModelcomponentModel returns a list of messagespublic static <T> boolean hasAnyDynamic(Iterable<ValueResolver<T>> resolvers)
T - the generic type of the ValueResolver itemsresolvers - a Iterable with instances of ValueResolvertrue if at least one ValueResolver is dynamic, false otherwisepublic static boolean isNullSafe(org.mule.runtime.api.meta.model.parameter.ParameterModel parameterModel)
parameterModel - a ParameterModelpublic static List<org.mule.runtime.api.meta.model.connection.ConnectionProviderModel> getAllConnectionProviders(org.mule.runtime.api.meta.model.ExtensionModel extensionModel, org.mule.runtime.api.meta.model.config.ConfigurationModel configurationModel)
ConnectionProviderModel instances available for the given configurationModel plus the ones
globally defined at the extensionModel.
The List will first contain those defined at a HasConnectionProviderModels.getConnectionProviders() level and finally the
ones at ExtensionModel.getConnectionProviders()extensionModel - the ExtensionModel which owns the configurationModelconfigurationModel - a ConfigurationModelList. Might be empty but will never be nullpublic static boolean supportsOAuth(org.mule.runtime.api.meta.model.ExtensionModel extensionModel)
ConnectionProviderModel in the given
supports OAuth authenticationextensionModel - a ExtensionModeltrue if a ConnectionProviderModel exist which is OAuth enabledpublic static List<org.mule.runtime.extension.api.runtime.operation.Interceptor> createInterceptors(org.mule.runtime.api.meta.model.EnrichableModel model)
List of interceptors using the factories returned by
InterceptorsModelProperty (if present).model - the model on which InterceptorsModelProperty is to be invokedList with instances of Interceptorpublic static void addInterceptorFactory(org.mule.runtime.api.meta.model.declaration.fluent.BaseDeclaration declaration,
org.mule.runtime.extension.api.runtime.InterceptorFactory interceptorFactory)
interceptorFactory to the declaration as the last interceptor in the listdeclaration - a BaseDeclarationinterceptorFactory - a InterceptorFactorypublic static void addInterceptorFactory(org.mule.runtime.api.meta.model.declaration.fluent.BaseDeclaration declaration,
org.mule.runtime.extension.api.runtime.InterceptorFactory interceptorFactory,
int position)
interceptorFactory to the declaration at the given positiondeclaration - a BaseDeclarationinterceptorFactory - a InterceptorFactoryposition - a valid list indexpublic static List<org.mule.runtime.extension.api.runtime.operation.Interceptor> createInterceptors(List<org.mule.runtime.extension.api.runtime.InterceptorFactory> interceptorFactories)
public static Event getInitialiserEvent()
public static Event getInitialiserEvent(MuleContext muleContext)
public static Optional<Method> getImplementingMethod(org.mule.runtime.api.meta.model.declaration.fluent.OperationDeclaration operationDeclaration)
Method that was used to declare the given operationDeclaration.operationDeclaration - a OperationDeclarationMethod or null if the operationDeclaration was defined by other meanspublic static ClassLoader getClassLoader(org.mule.runtime.api.meta.model.ExtensionModel extensionModel)
extensionModel contains a ClassLoaderModelProperty, then it returns the ClassLoader associated
to such property. Otherwise, it returns the current TCCLextensionModel - a ExtensionModelClassLoaderpublic static <T> T withExtensionClassLoader(org.mule.runtime.api.meta.model.ExtensionModel extensionModel,
Callable<T> callable)
throws Exception
public static void injectConfigName(org.mule.runtime.api.meta.model.EnrichableModel model,
Object target,
String configName)
public static byte toActionCode(org.mule.runtime.extension.api.tx.OperationTransactionalAction action)
action to its equivalent transactional action as defined in TransactionConfigaction - a OperationTransactionalActionpublic static byte toActionCode(org.mule.runtime.extension.api.tx.SourceTransactionalAction action)
action to its equivalent transactional action as defined in TransactionConfigaction - a SourceTransactionalActionpublic static org.mule.runtime.extension.api.runtime.config.ConfigurationFactory getConfigurationFactory(org.mule.runtime.api.meta.model.config.ConfigurationModel configurationModel)
configurationModel for a ConfigurationFactoryModelProperty and
returns the contained ConfigurationFactory.configurationModel - a ConfigurationModelConfigurationFactoryorg.mule.runtime.extension.api.exception.IllegalConfigurationModelDefinitionException - if the configurationModel doesn't contain such model propertypublic static org.mule.runtime.extension.api.metadata.MetadataResolverFactory getMetadataResolverFactory(org.mule.runtime.api.meta.model.EnrichableModel model)
model for a MetadataResolverFactoryModelProperty and if present
it returns the contained MetadataResolverFactory. If no such property is found, then
a NullMetadataResolverFactory is returnedmodel - an enriched modelMetadataResolverFactorypublic static org.mule.runtime.extension.api.runtime.operation.OperationExecutorFactory getOperationExecutorFactory(org.mule.runtime.api.meta.model.operation.OperationModel operationModel)
operationModel for a OperationExecutorModelProperty and if present
it returns the enclosed OperationExecutorFactory. If no such property is found, then a
IllegalOperationModelDefinitionException is thrown.operationModel - an OperationModelOperationExecutorFactoryorg.mule.runtime.extension.api.exception.IllegalOperationModelDefinitionException - if the operation is not properly enrichedpublic static org.mule.runtime.extension.api.runtime.source.SourceFactory getSourceFactory(org.mule.runtime.api.meta.model.source.SourceModel sourceModel)
sourceModel for a SourceFactoryModelProperty and if present
it returns the enclosed SourceFactory. If no such property is found, then a
IllegalSourceModelDefinitionException is thrownsourceModel - a SourceModelSourceFactoryorg.mule.runtime.extension.api.exception.IllegalSourceModelDefinitionException - if the source is not properly enrichedpublic static org.mule.runtime.extension.api.runtime.connectivity.ConnectionProviderFactory getConnectionProviderFactory(org.mule.runtime.api.meta.model.connection.ConnectionProviderModel connectionProviderModel)
connectionProviderModel for a ConnectionProviderFactoryModelProperty and if present
it returns the enclosed ConnectionProviderFactory. If no such property is found, then a
IllegalConnectionProviderModelDefinitionException is thrownconnectionProviderModel - a ConnectionProviderModelSourceFactoryorg.mule.runtime.extension.api.exception.IllegalConnectionProviderModelDefinitionException - if the connection provider is not properly enrichedpublic static Class<?> getConnectionType(org.mule.runtime.api.meta.model.connection.ConnectionProviderModel connectionProviderModel)
connectionProviderModel for a ConnectionTypeModelProperty and if present
it returns the enclosed connection type. If no such property is found, then a
IllegalConnectionProviderModelDefinitionException is thrownconnectionProviderModel - a ConnectionProviderModelClassorg.mule.runtime.extension.api.exception.IllegalConnectionProviderModelDefinitionException - if the connection provider is not properly enrichedpublic static org.mule.runtime.extension.api.exception.IllegalModelDefinitionException noClassLoaderException(String extensionName)
ClassLoader was specified for the extension of the given extensionNameextensionName - the name of the offending extensionIllegalModelDefinitionExceptionpublic static String getExtensionsErrorNamespace(org.mule.runtime.api.meta.model.ExtensionModel extensionModel)
ExtensionModelpublic static String getExtensionsErrorNamespace(org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclaration extensionDeclaration)
ExtensionDeclarationpublic static org.mule.runtime.api.meta.model.ExtensionModel loadExtension(Class<?> clazz)
public static org.mule.runtime.api.meta.model.ExtensionModel loadExtension(Class<?> clazz, Map<String,Object> params)
public static String getImplicitConfigurationProviderName(org.mule.runtime.api.meta.model.ExtensionModel extensionModel, org.mule.runtime.api.meta.model.config.ConfigurationModel implicitConfigurationModel)
Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.