Package org.apache.cxf.endpoint
Interface Client
- All Superinterfaces:
AutoCloseable
,ConduitSelectorHolder
,InterceptorProvider
,MessageObserver
- All Known Implementing Classes:
ClientImpl
public interface Client
extends InterceptorProvider, MessageObserver, ConduitSelectorHolder, AutoCloseable
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Wrappers the contexts in a way that allows the contexts to be cleared and released in an try-with-resources block -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
Indicates that the client is no longer needed and that any resources it holds can now be freed.getBus()
Retrieves the Bus that was used to create the ClientGet the Conduit that messages for this client will be sent on.Get the ConduitSelector responsible for retreiving the Conduit.default Client.Contexts
Gets the request context used for future invocationsGets the response context from the last invocation on this threadObject[]
Invokes an operation synchronouslyObject[]
Invokes an operation synchronouslyvoid
invoke
(ClientCallback callback, String operationName, Object... params) Invokes an operation asynchronouslyvoid
invoke
(ClientCallback callback, QName operationName, Object... params) Invokes an operation asynchronouslyvoid
invoke
(ClientCallback callback, BindingOperationInfo oi, Object... params) Invokes an operation asynchronouslyvoid
invoke
(ClientCallback callback, BindingOperationInfo oi, Object[] params, Map<String, Object> context) Invokes an operation asynchronouslyvoid
invoke
(ClientCallback callback, BindingOperationInfo oi, Object[] params, Map<String, Object> context, Exchange exchange) Invokes an operation asynchronouslyvoid
invoke
(ClientCallback callback, BindingOperationInfo oi, Object[] params, Exchange exchange) Invokes an operation asynchronouslyObject[]
invoke
(BindingOperationInfo oi, Object... params) Invokes an operation synchronouslyObject[]
Invokes an operation synchronouslyObject[]
Invokes an operation synchronouslyObject[]
invokeWrapped
(String operationName, Object... params) Invokes an operation synchronouslyObject[]
invokeWrapped
(QName operationName, Object... params) Invokes an operation synchronouslyvoid
invokeWrapped
(ClientCallback callback, String operationName, Object... params) Invokes an operation asynchronouslyvoid
invokeWrapped
(ClientCallback callback, QName operationName, Object... params) Invokes an operation asynchronouslyboolean
Checks if the Request context is thread local or global.void
setConduitSelector
(ConduitSelector selector) Set the ConduitSelector responsible for retreiving the Conduit.void
setExecutor
(Executor executor) Sets the executor which is used to process Asynchronous responses.void
setThreadLocalRequestContext
(boolean b) Sets whether the request context is thread local or global to this client.Methods inherited from interface java.lang.AutoCloseable
close
Methods inherited from interface org.apache.cxf.interceptor.InterceptorProvider
getInFaultInterceptors, getInInterceptors, getOutFaultInterceptors, getOutInterceptors
Methods inherited from interface org.apache.cxf.transport.MessageObserver
onMessage
-
Field Details
-
REQUEST_CONTEXT
- See Also:
-
RESPONSE_CONTEXT
- See Also:
-
KEEP_CONDUIT_ALIVE
- See Also:
-
-
Method Details
-
invoke
Invokes an operation synchronously- Parameters:
operationName
- The name of the operation to be invoked. The service namespace will be used when looking up the BindingOperationInfo.params
- The params that matches the parts of the input message of the operation. If the BindingOperationInfo supports unwrapping, it assumes the params are in the "unwrapped" form. If params are in the wrapped form, use invokeWrapped- Returns:
- The return values that matche the parts of the output message of the operation
- Throws:
Exception
-
invoke
Invokes an operation synchronously- Parameters:
operationName
- The name of the operation to be invokedparams
- The params that matches the parts of the input message of the operation. If the BindingOperationInfo supports unwrapping, it assumes the params are in the "unwrapped" form. If params are in the wrapped form, use invokeWrapped- Returns:
- The return values that matche the parts of the output message of the operation
- Throws:
Exception
-
invokeWrapped
Invokes an operation synchronously- Parameters:
operationName
- The name of the operation to be invoked. The service namespace will be used when looking up the BindingOperationInfo.params
- The params that matches the parts of the input message of the operation- Returns:
- The return values that matche the parts of the output message of the operation
- Throws:
Exception
-
invokeWrapped
Invokes an operation synchronously- Parameters:
operationName
- The name of the operation to be invokedparams
- The params that matches the parts of the input message of the operation- Returns:
- The return values that matche the parts of the output message of the operation
- Throws:
Exception
-
invoke
Invokes an operation synchronously- Parameters:
oi
- The operation to be invokedparams
- The params that matches the parts of the input message of the operation- Returns:
- The return values that matche the parts of the output message of the operation
- Throws:
Exception
-
invoke
Object[] invoke(BindingOperationInfo oi, Object[] params, Map<String, Object> context) throws ExceptionInvokes an operation synchronously- Parameters:
oi
- The operation to be invokedparams
- The params that matches the parts of the input message of the operationcontext
- Optional (can be null) contextual information for the invocation- Returns:
- The return values that matche the parts of the output message of the operation
- Throws:
Exception
-
invoke
Object[] invoke(BindingOperationInfo oi, Object[] params, Map<String, Object> context, Exchange exchange) throws ExceptionInvokes an operation synchronously- Parameters:
oi
- The operation to be invokedparams
- The params that matches the parts of the input message of the operationcontext
- Optional (can be null) contextual information for the invocationexchange
- The Exchange to be used for the invocation- Returns:
- The return values that matche the parts of the output message of the operation
- Throws:
Exception
-
invoke
Invokes an operation asynchronously- Parameters:
callback
- The callback that is called when the response is readyoperationName
- The name of the operation to be invoked. The service namespace will be used when looking up the BindingOperationInfo.params
- The params that matches the parts of the input message of the operation. If the BindingOperationInfo supports unwrapping, it assumes the params are in the "unwrapped" form. If params are in the wrapped form, use invokeWrapped- Throws:
Exception
-
invoke
Invokes an operation asynchronously- Parameters:
callback
- The callback that is called when the response is readyoperationName
- The name of the operation to be invokedparams
- The params that matches the parts of the input message of the operation. If the BindingOperationInfo supports unwrapping, it assumes the params are in the "unwrapped" form. If params are in the wrapped form, use invokeWrapped- Throws:
Exception
-
invokeWrapped
void invokeWrapped(ClientCallback callback, String operationName, Object... params) throws Exception Invokes an operation asynchronously- Parameters:
callback
- The callback that is called when the response is readyoperationName
- The name of the operation to be invoked. The service namespace will be used when looking up the BindingOperationInfo.params
- The params that matches the parts of the input message of the operation- Throws:
Exception
-
invokeWrapped
Invokes an operation asynchronously- Parameters:
callback
- The callback that is called when the response is readyoperationName
- The name of the operation to be invokedparams
- The params that matches the parts of the input message of the operation- Throws:
Exception
-
invoke
Invokes an operation asynchronously- Parameters:
callback
- The callback that is called when the response is readyoi
- The operation to be invokedparams
- The params that matches the parts of the input message of the operation- Throws:
Exception
-
invoke
void invoke(ClientCallback callback, BindingOperationInfo oi, Object[] params, Map<String, Object> context) throws ExceptionInvokes an operation asynchronously- Parameters:
callback
- The callback that is called when the response is readyoi
- The operation to be invokedparams
- The params that matches the parts of the input message of the operationcontext
- contextual information for the invocation- Throws:
Exception
-
invoke
void invoke(ClientCallback callback, BindingOperationInfo oi, Object[] params, Exchange exchange) throws Exception Invokes an operation asynchronously- Parameters:
callback
- The callback that is called when the response is readyoi
- The operation to be invokedparams
- The params that matches the parts of the input message of the operationexchange
- The Exchange to be used for the invocation- Throws:
Exception
-
invoke
void invoke(ClientCallback callback, BindingOperationInfo oi, Object[] params, Map<String, Object> context, Exchange exchange) throws ExceptionInvokes an operation asynchronously- Parameters:
callback
- The callback that is called when the response is readyoi
- The operation to be invokedparams
- The params that matches the parts of the input message of the operationcontext
- Optional (can be null) contextual information for the invocationexchange
- Optional (can be null) The Exchange to be used for the invocation- Throws:
Exception
-
getRequestContext
Gets the request context used for future invocations- Returns:
- context The context
-
getResponseContext
Gets the response context from the last invocation on this thread- Returns:
- context The context
-
setThreadLocalRequestContext
void setThreadLocalRequestContext(boolean b) Sets whether the request context is thread local or global to this client. By default, the request context is "global" in that any values set in the context are seen by all threads using this client. If set to true, the context is changed to be a ThreadLocal and values set are not seen by other threads.- Parameters:
b
-
-
isThreadLocalRequestContext
boolean isThreadLocalRequestContext()Checks if the Request context is thread local or global.- Returns:
- true if the request context is a thread local
-
getContexts
-
getEndpoint
Endpoint getEndpoint() -
getConduit
Conduit getConduit()Get the Conduit that messages for this client will be sent on.- Returns:
- Conduit
-
getConduitSelector
ConduitSelector getConduitSelector()Get the ConduitSelector responsible for retreiving the Conduit.- Specified by:
getConduitSelector
in interfaceConduitSelectorHolder
- Returns:
- the current ConduitSelector
-
setConduitSelector
Set the ConduitSelector responsible for retreiving the Conduit.- Specified by:
setConduitSelector
in interfaceConduitSelectorHolder
- Parameters:
selector
- the ConduitSelector to use
-
destroy
void destroy()Indicates that the client is no longer needed and that any resources it holds can now be freed. -
setExecutor
Sets the executor which is used to process Asynchronous responses. The default is to use the threads provided by the transport. (example: the JMS listener threads)- Parameters:
executor
-
-
getBus
Bus getBus()Retrieves the Bus that was used to create the Client- Returns:
- the Bus
-