|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.softamis.cluster4spring.support.provider.BaseEndpointProvider<E,SI> org.softamis.cluster4spring.support.provider.SingleUrlEndpointProvider<E,SI>
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 class SingleUrlEndpointProvider<E extends Endpoint<SI>,SI extends ServiceMoniker>
Implementation of EndpointProvider
that utilises single and
explicitely specified "url" of the service to create service endpoint. Basically,
any object may represent service "url" - it is responsibility of concrete implementation
of EndpointFactory
to interpret given object and create appropriate
endpoint for remote service that could be located based on given "url".
Field Summary | |
---|---|
protected E |
fEndpoint
Cached endpoint, if any. |
protected static org.apache.commons.logging.Log |
fLog
|
protected SI |
fServiceMoniker
Information needed to discover remote service |
Fields inherited from class org.softamis.cluster4spring.support.provider.BaseEndpointProvider |
---|
fCacheEndpoints |
Constructor Summary | |
---|---|
SingleUrlEndpointProvider()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
Called by Spring as part of bean lifecycle. |
E |
getEndpoint(org.springframework.remoting.support.RemoteInvocationFactory aRemoteInvocationFactory,
EndpointFactory<E,SI> aEndpointFactory,
java.lang.String aBeanName)
Returns endpoint that will be used for remote service invocation. |
SI |
getServiceMoniker()
|
java.lang.String |
getServiceUrl()
Returns information needed to discover remote service |
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. |
void |
setServiceMoniker(SI aServiceMoniker)
Sets information needed to discover remote service |
void |
setServiceUrl(java.lang.String aServiceURL)
|
Methods inherited from class org.softamis.cluster4spring.support.provider.BaseEndpointProvider |
---|
doCreateServiceEndpoint, isCacheEndpoints, setCacheEndpoints |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.commons.logging.Log fLog
protected E extends Endpoint<SI> fEndpoint
protected SI extends ServiceMoniker fServiceMoniker
Constructor Detail |
---|
public SingleUrlEndpointProvider()
Method Detail |
---|
public void afterPropertiesSet() throws java.lang.Exception
serviceUrl
property is specified.
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
java.lang.Exception
setServiceMoniker(ServiceMoniker)
,
setServiceUrl(String)
public E getEndpoint(org.springframework.remoting.support.RemoteInvocationFactory aRemoteInvocationFactory, EndpointFactory<E,SI> aEndpointFactory, java.lang.String aBeanName) throws org.springframework.remoting.RemoteAccessException
EndpointFactory
- Specified by:
getEndpoint
in interface EndpointProvider<E extends Endpoint<SI>,SI extends ServiceMoniker>
- Parameters:
aRemoteInvocationFactory
- factory used to create remote invocationsaEndpointFactory
- factory used to create endpointsaBeanName
- name of bean that is used as proxy for remote service
- Returns:
- endpoint that should be used to remote invocation
- Throws:
org.springframework.remoting.RemoteAccessException
- thrown if endpoint could not be selected of if
there are not currently available endpoints for remote service- See Also:
BaseEndpointProvider.setCacheEndpoints(boolean)
public void markInvalid(java.lang.String aBeanName, E aEndpoint)
null
to cached endpoint.
markInvalid
in interface EndpointProvider<E extends Endpoint<SI>,SI extends ServiceMoniker>
aBeanName
- name of bean that is used as proxy for remote serviceaEndpoint
- endpoint to be marked invalidpublic void refresh(org.springframework.remoting.support.RemoteInvocationFactory aRemoteInvocationFactory, EndpointFactory<E,SI> aEndpointFactory, java.lang.String aBeanName) throws org.springframework.remoting.RemoteAccessException
EndpointFactory
and
stored created endpoint for later use.
Otherwise, silently does nothing since endpoint will be obtained by
request.
refresh
in interface EndpointProvider<E extends Endpoint<SI>,SI extends ServiceMoniker>
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 refreshingBaseEndpointProvider.setCacheEndpoints(boolean)
public void setServiceMoniker(SI aServiceMoniker)
aServiceMoniker
- information needed to discover remote servicepublic SI getServiceMoniker()
public java.lang.String getServiceUrl()
public void setServiceUrl(java.lang.String aServiceURL)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |