|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
SI
- type of data used to invoke remote service (such as remote service URL)E
- type of endpoints that could be created by this factorypublic interface EndpointProvider<E extends Endpoint<SI>,SI extends ServiceMoniker>
Provides endpoints for remote service. Since the same service could exists in several locations, it is possible that there will be several endpoints for the same service available. This class provides endpoint via which remote call will be executed (based on list of available service locations).
Since in the distributed environment some servers that provide service could become unavailable, endpoints may become invalid. If cluster4spring-related exception occured during endpoint invocation, the calling code may be aware about this fact and mark particular endpoint invalid (so it will not be selected during subsequent invocations of service). As side effect of marking service invalid (if service is autodiscovered), appropriate network notification could be issued to other clients in cluster which use the same remote services. If there are several endpoints for the same service exist, the problem of selecting particular one of them for invocation occurs. In general,EndpointProvider
delegates selection of endpoint to invocation to appropriate EndpointSelectionPolicy
EndpointSelectionPolicy
Method Summary | |
---|---|
E |
getEndpoint(org.springframework.remoting.support.RemoteInvocationFactory aRemoteInvocationFactory,
EndpointFactory<E,SI> aEndpointFactory,
java.lang.String aBeanName)
Returns endpoint that should be used for remote service invocation |
void |
markInvalid(java.lang.String aBeanName,
E aEndpoint)
Marks given endpoint invalid. |
void |
refresh(org.springframework.remoting.support.RemoteInvocationFactory aRemoteInvocationFactory,
EndpointFactory<E,SI> aEndpointFactory,
java.lang.String aBeanName)
Refreshes internal state of provider. |
Method Detail |
---|
E getEndpoint(org.springframework.remoting.support.RemoteInvocationFactory aRemoteInvocationFactory, EndpointFactory<E,SI> aEndpointFactory, java.lang.String aBeanName) throws org.springframework.remoting.RemoteAccessException
aRemoteInvocationFactory
- factory used to create remote invocationsaEndpointFactory
- factory used to create endpointsaBeanName
- name of bean that is used as proxy for remote service
org.springframework.remoting.RemoteAccessException
- thrown if endpoint could not be selected of if
there are not currently available endpoints for remote servicevoid markInvalid(java.lang.String aBeanName, E aEndpoint)
aBeanName
- name of bean that is used as proxy for remote serviceaEndpoint
- endpoint to be marked invalidvoid refresh(org.springframework.remoting.support.RemoteInvocationFactory aRemoteInvocationFactory, EndpointFactory<E,SI> aEndpointFactory, java.lang.String aBeanName) throws org.springframework.remoting.RemoteAccessException
aRemoteInvocationFactory
- factory used to create remote invocationaEndpointFactory
- factory used to create endpointsaBeanName
- name of bean that is used as proxy for remote service
org.springframework.remoting.RemoteAccessException
- throw if exception occured during refreshing
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |