|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.softamis.cluster4spring.support.Endpoint<SI>
SI
- type of data used to invoke remote service (such as remote service URL)public abstract class Endpoint<SI extends java.io.Serializable>
Abstract class that encapsulates low-level logic of calling underlying remote service. Roughly speaking, it could be considered as client-side proxy for remote server-side service. An appropriate type of endpoints should be implemented for every corresponging cluster4spring protocol.
Instance of this class is created by appropriateProxyFactoryBean
which is used to create proxies to remote service.
Field Summary | |
---|---|
protected java.util.Map<java.lang.String,java.lang.Object> |
fAttributes
Custom data which could be associated with endpoint. |
protected java.lang.String |
fEndpointKey
Key used to identify endpoint |
protected long |
fLastAccessTime
Time of last invocation of remote service via this endpoint |
protected static org.apache.commons.logging.Log |
fLog
|
protected org.springframework.remoting.support.RemoteInvocationFactory |
fRemoteInvocationFactory
Factory used to create remote invocations |
protected SI |
fServiceInfo
information about remote service (for example, URL of remote service) |
Constructor Summary | |
---|---|
protected |
Endpoint(org.springframework.remoting.support.RemoteInvocationFactory aRemoteInvocationFactory)
Creates endpoint. |
protected |
Endpoint(org.springframework.remoting.support.RemoteInvocationFactory aRemoteInvocationFactory,
java.lang.String aEndpointKey,
SI aServiceInfo)
Creates endpoint. |
Method Summary | |
---|---|
protected org.springframework.remoting.support.RemoteInvocation |
createRemoteInvocation(org.aopalliance.intercept.MethodInvocation aMethodInvocation)
Create a new RemoteInvocation object for the given AOP method invocation. |
protected abstract java.lang.Object |
doInvoke(org.aopalliance.intercept.MethodInvocation aMethodInvocation)
Perform invocation of given MethoInvocation taking into consideration details of concrete cluster4spring protocol. |
java.util.Map<java.lang.String,java.lang.Object> |
getAttributes()
Returns custom attributes which could be associated with endpoint. |
java.lang.String |
getEndpointKey()
Returns key for endpoint |
long |
getLastAccessTime()
Returns time of last invocation of remote service via this endpoint. |
SI |
getServiceInfo()
Returns information about remote service (for example, URL of remote service) |
java.lang.Object |
invoke(org.aopalliance.intercept.MethodInvocation aMethodInvocation)
Performs invocation of given MethodInvocation . |
void |
setAttributes(java.util.Map<java.lang.String,java.lang.Object> aAttributes)
Sets custom attributes which could be associated with endpoint. |
void |
setEndpointKey(java.lang.String aEndpointKey)
Sets key for endpoint |
void |
setLastAccessTime(long aLastAccessTime)
Sets time of last invocation of remote service via this endpoint |
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 java.lang.String fEndpointKey
protected SI extends java.io.Serializable fServiceInfo
protected java.util.Map<java.lang.String,java.lang.Object> fAttributes
EndpointSelectionPolicy
protected org.springframework.remoting.support.RemoteInvocationFactory fRemoteInvocationFactory
protected long fLastAccessTime
Constructor Detail |
---|
protected Endpoint(org.springframework.remoting.support.RemoteInvocationFactory aRemoteInvocationFactory)
aRemoteInvocationFactory
- factory used to create remote invocationsprotected Endpoint(org.springframework.remoting.support.RemoteInvocationFactory aRemoteInvocationFactory, java.lang.String aEndpointKey, SI aServiceInfo)
aRemoteInvocationFactory
- factory used to create remote invocationsaEndpointKey
- key of endpointaServiceInfo
- information about service that could be used to perform service invocationMethod Detail |
---|
public java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation aMethodInvocation) throws java.lang.Throwable
MethodInvocation
. After invocation,
updates lastAccessTime of endpoint.
aMethodInvocation
- method invocation to invoke
java.lang.Throwable
protected abstract java.lang.Object doInvoke(org.aopalliance.intercept.MethodInvocation aMethodInvocation) throws java.lang.Throwable
aMethodInvocation
- method invocation to invoke
java.lang.Throwable
- exception that could occur during invocationpublic java.util.Map<java.lang.String,java.lang.Object> getAttributes()
EndpointSelectionPolicy
to implement algorithm of
endpoints selection
public void setAttributes(java.util.Map<java.lang.String,java.lang.Object> aAttributes)
aAttributes
- custom dataprotected org.springframework.remoting.support.RemoteInvocation createRemoteInvocation(org.aopalliance.intercept.MethodInvocation aMethodInvocation)
Can be overridden in subclasses to provide custom RemoteInvocation subclasses, containing additional invocation parameters like user credentials. Note that it is preferable to use a custom RemoteInvocationFactory which is a reusable strategy.
aMethodInvocation
- the current AOP method invocation
RemoteInvocationFactory.createRemoteInvocation(org.aopalliance.intercept.MethodInvocation)
public SI getServiceInfo()
public long getLastAccessTime()
LastAccessTimeEndpointSelectionPolicy
public void setLastAccessTime(long aLastAccessTime)
aLastAccessTime
- timepublic java.lang.String getEndpointKey()
public void setEndpointKey(java.lang.String aEndpointKey)
aEndpointKey
- key for endpoint
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |