C - the connection generic typepublic class SdkConnectionProviderAdapter<C> extends Object implements org.mule.runtime.api.connection.ConnectionProvider<C>, org.mule.runtime.api.lifecycle.Lifecycle, MuleContextAware, InjectionTargetDecorator<org.mule.sdk.api.connectivity.ConnectionProvider<C>>
ConnectionProvider into a mule-api ConnectionProvider.
This adapter acts as a decorator which (if needed) propagates the Lifecycle and MuleContextAware signals to the
delegate. It also considers the case of the delegate being a pooling or cached provider, in which the returned adapter will
also implement the necessary interfaces.
Instances are to be created through the from(Object) factory method.
| Modifier and Type | Method and Description |
|---|---|
C |
connect() |
void |
disconnect(C connection) |
void |
dispose() |
static <C> org.mule.runtime.api.connection.ConnectionProvider<C> |
from(Object connectionProvider)
Returns the given
connectionProvider as a ConnectionProvider, creating an adapter around it if needed. |
org.mule.sdk.api.connectivity.ConnectionProvider<C> |
getDelegate() |
void |
initialise() |
void |
setMuleContext(MuleContext context) |
void |
start() |
void |
stop() |
org.mule.runtime.api.connection.ConnectionValidationResult |
validate(C connection) |
public static <C> org.mule.runtime.api.connection.ConnectionProvider<C> from(Object connectionProvider)
connectionProvider as a ConnectionProvider, creating an adapter around it if needed.
If the provider is already an adapter or a native ConnectionProvider, the same instance is returned. Otherwise, an
adapter is created.
C - the connection's generic typeconnectionProvider - the instance to be adaptedConnectionProviderIllegalArgumentException - if connectionProvider is null or not a valid connection provider.public C connect() throws org.mule.runtime.api.connection.ConnectionException
connect in interface org.mule.runtime.api.connection.ConnectionProvider<C>org.mule.runtime.api.connection.ConnectionExceptionpublic void disconnect(C connection)
disconnect in interface org.mule.runtime.api.connection.ConnectionProvider<C>public org.mule.runtime.api.connection.ConnectionValidationResult validate(C connection)
validate in interface org.mule.runtime.api.connection.ConnectionProvider<C>public org.mule.sdk.api.connectivity.ConnectionProvider<C> getDelegate()
getDelegate in interface InjectionTargetDecorator<org.mule.sdk.api.connectivity.ConnectionProvider<C>>public void initialise()
throws org.mule.runtime.api.lifecycle.InitialisationException
initialise in interface org.mule.runtime.api.lifecycle.Initialisableorg.mule.runtime.api.lifecycle.InitialisationExceptionpublic void start()
throws org.mule.runtime.api.exception.MuleException
start in interface org.mule.runtime.api.lifecycle.Startableorg.mule.runtime.api.exception.MuleExceptionpublic void stop()
throws org.mule.runtime.api.exception.MuleException
stop in interface org.mule.runtime.api.lifecycle.Stoppableorg.mule.runtime.api.exception.MuleExceptionpublic void dispose()
dispose in interface org.mule.runtime.api.lifecycle.Disposablepublic void setMuleContext(MuleContext context)
setMuleContext in interface MuleContextAwareCopyright © 2003–2022 MuleSoft, Inc.. All rights reserved.