org.gcube.common.core.utils.calls
Class RICall.RICallHandler

java.lang.Object
  extended by org.gcube.common.core.utils.handlers.GCUBEHandler<CLIENT>
      extended by org.gcube.common.core.utils.handlers.GCUBEServiceHandler<GCUBEServiceClientImpl>
          extended by org.gcube.common.core.utils.calls.RICall.RICallHandler
All Implemented Interfaces:
GCUBEIHandler<GCUBEServiceClientImpl>, Lifetime<GCUBEServiceClientImpl>
Enclosing class:
RICall

public abstract class RICall.RICallHandler
extends GCUBEServiceHandler<GCUBEServiceClientImpl>

Abstract specialisation of GCUBEServiceHandler for embedding in RICalls.

Author:
Fabio Simeoni (University of Strathclyde)

Nested Class Summary
 
Nested classes/interfaces inherited from class org.gcube.common.core.utils.handlers.GCUBEServiceHandler
GCUBEServiceHandler.NoQueryResultException
 
Field Summary
 
Fields inherited from class org.gcube.common.core.utils.handlers.GCUBEHandler
handled, logger, producer
 
Constructor Summary
RICall.RICallHandler()
          Creates a new instance.
 
Method Summary
protected  void _interact(org.apache.axis.message.addressing.EndpointReferenceType epr)
          Used internally to wrap GCUBEServiceHandler.interact(EndpointReferenceType) and handle its successes and failures.
protected  List<org.apache.axis.message.addressing.EndpointReferenceType> findInstances()
          Discovers EPRs to suitable instances of the target port-type.
protected  org.apache.axis.message.addressing.EndpointReferenceType getCachedEPR()
          Returns the EPR of the instance of the target port-type which was last cached.
 GCUBEScopeManager getScopeManager()
          Returns the scope manager of the handler.
protected  String getTargetPortTypeName()
          Returns the local name of the target port-type as the basis for a key to store 'successful' EPRs of the port-type in the cache provided by the service client (cf.
 
Methods inherited from class org.gcube.common.core.utils.handlers.GCUBEServiceHandler
cacheEPR, clearCachedEPR, getAttempts, getCacheKey, getInstances, interact, run, setAttempts, tryInstances
 
Methods inherited from class org.gcube.common.core.utils.handlers.GCUBEHandler
clearBlackboard, getBlackboard, getHandled, getId, getLogger, getName, getSecurityManager, getState, notify, setBlackboard, setHandled, setLogger, setName, setScopeManager, setSecurityManager, setState, subscribe, undo, unsubscribe
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.gcube.common.core.utils.handlers.lifetime.Lifetime
getState
 
Methods inherited from interface org.gcube.common.core.utils.handlers.GCUBEIHandler
clearBlackboard, getBlackboard, getHandled, getId, getLogger, getName, getSecurityManager, setBlackboard, setHandled, setLogger, setName, setScopeManager, setSecurityManager, subscribe, undo, unsubscribe
 

Constructor Detail

RICall.RICallHandler

public RICall.RICallHandler()
Creates a new instance.

Method Detail

_interact

protected void _interact(org.apache.axis.message.addressing.EndpointReferenceType epr)
                  throws Exception
Used internally to wrap GCUBEServiceHandler.interact(EndpointReferenceType) and handle its successes and failures.
If GCUBEServiceHandler.interact(EndpointReferenceType) succeeds, it store the input EPR in the handler's state. If GCUBEServiceHandler.interact(EndpointReferenceType) fails with a GCUBEFault, it propagates the GCUBEException which models it most specifically.

Overrides:
_interact in class GCUBEServiceHandler<GCUBEServiceClientImpl>
Parameters:
epr - the EPR of an instance of the target port-type.
Throws:
GCUBEServiceHandler.NoQueryResultException - if the interaction fails to complete successfully.
Exception
See Also:
GCUBEServiceHandler.interact(EndpointReferenceType).

getCachedEPR

protected org.apache.axis.message.addressing.EndpointReferenceType getCachedEPR()
Returns the EPR of the instance of the target port-type which was last cached.

Overrides:
getCachedEPR in class GCUBEServiceHandler<GCUBEServiceClientImpl>
Returns:
the EPR.

findInstances

protected List<org.apache.axis.message.addressing.EndpointReferenceType> findInstances()
                                                                                throws Exception
Discovers EPRs to suitable instances of the target port-type.

Specified by:
findInstances in class GCUBEServiceHandler<GCUBEServiceClientImpl>
Returns:
the EPRs.
Throws:
GCUBEServiceHandler.NoQueryResultException - if suitable instances cannot be found.
Exception

getScopeManager

public GCUBEScopeManager getScopeManager()
Returns the scope manager of the handler.

Specified by:
getScopeManager in interface GCUBEIHandler<GCUBEServiceClientImpl>
Overrides:
getScopeManager in class GCUBEHandler<GCUBEServiceClientImpl>
Returns:
the manager.

getTargetPortTypeName

protected String getTargetPortTypeName()
Returns the local name of the target port-type as the basis for a key to store 'successful' EPRs of the port-type in the cache provided by the service client (cf. GCUBEServiceHandler.getCacheKey()).

By default, it returns the name of handler (cf. GCUBEHandler.getName()), which will not grant EPR reuse across any other handler type that may target the same port-type. Override and return a specific port-type name to grant EPR reuse across all handler types that target the same port-type and share the same client.

Overrides:
getTargetPortTypeName in class GCUBEServiceHandler<GCUBEServiceClientImpl>
Returns:
the name.
See Also:
#getName()}, #getCacheKey()}.


Copyright © 2012. All Rights Reserved.