E
- the endpoint typeO
- the operation typepublic abstract class EndpointDiscoverer<E extends ExposableEndpoint<O>,O extends Operation> extends Object implements EndpointsSupplier<E>
EndpointsSupplier
implementations that discover
@Endpoint
beans and @EndpointExtension
beans
in an application context.Modifier and Type | Class and Description |
---|---|
protected static class |
EndpointDiscoverer.OperationKey
A key generated for an
Operation based on specific criteria from the actual
operation implementation. |
Constructor and Description |
---|
EndpointDiscoverer(ApplicationContext applicationContext,
ParameterValueMapper parameterValueMapper,
Collection<OperationInvokerAdvisor> invokerAdvisors,
Collection<EndpointFilter<E>> filters)
Create a new
EndpointDiscoverer instance. |
Modifier and Type | Method and Description |
---|---|
protected abstract E |
createEndpoint(Object endpointBean,
EndpointId id,
boolean enabledByDefault,
Collection<O> operations)
Factory method called to create the
endpoint . |
protected abstract O |
createOperation(EndpointId endpointId,
DiscoveredOperationMethod operationMethod,
OperationInvoker invoker)
Factory method to create an
endpoint operation . |
protected abstract EndpointDiscoverer.OperationKey |
createOperationKey(O operation)
Create an
EndpointDiscoverer.OperationKey for the given operation. |
Collection<E> |
getEndpoints()
Return the provided endpoints.
|
protected Class<? extends E> |
getEndpointType() |
protected boolean |
isEndpointExposed(Object endpointBean)
Determine if an endpoint bean should be exposed.
|
protected boolean |
isExtensionExposed(Object extensionBean)
Determine if an extension bean should be exposed.
|
public EndpointDiscoverer(ApplicationContext applicationContext, ParameterValueMapper parameterValueMapper, Collection<OperationInvokerAdvisor> invokerAdvisors, Collection<EndpointFilter<E>> filters)
EndpointDiscoverer
instance.applicationContext
- the source application contextparameterValueMapper
- the parameter value mapperinvokerAdvisors
- invoker advisors to applyfilters
- filters to applypublic final Collection<E> getEndpoints()
EndpointsSupplier
getEndpoints
in interface EndpointsSupplier<E extends ExposableEndpoint<O>>
protected boolean isExtensionExposed(Object extensionBean)
extensionBean
- the extension beantrue
if the extension is exposedprotected boolean isEndpointExposed(Object endpointBean)
endpointBean
- the endpoint beantrue
if the endpoint is exposedprotected abstract E createEndpoint(Object endpointBean, EndpointId id, boolean enabledByDefault, Collection<O> operations)
endpoint
.endpointBean
- the source endpoint beanid
- the ID of the endpointenabledByDefault
- if the endpoint is enabled by defaultoperations
- the endpoint operationsDiscoveredEndpoint
is recommended)protected abstract O createOperation(EndpointId endpointId, DiscoveredOperationMethod operationMethod, OperationInvoker invoker)
endpoint operation
.endpointId
- the endpoint idoperationMethod
- the operation methodinvoker
- the invoker to useprotected abstract EndpointDiscoverer.OperationKey createOperationKey(O operation)
EndpointDiscoverer.OperationKey
for the given operation.operation
- the source operationCopyright © 2019 Pivotal Software, Inc.. All rights reserved.