org.gcube.common.core.utils.calls
Class StagingCall.StagingHandler

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

public abstract class StagingCall.StagingHandler
extends GCUBEStagingServiceHandler<GCUBEServiceClientImpl>

Abstract specialisation of GCUBEStatefulServiceHandler for embedding in StagingCalls.

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
StagingCall.StagingHandler()
          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> findFactories()
          Returns a list of EPRs to factories.
protected  List<RPDocument> findWSResources()
          Discovers suitable WS-Resources of the target port-type.
 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.
 void run()
          Executes the task implemented by the handler.
 
Methods inherited from class org.gcube.common.core.utils.handlers.GCUBEStagingServiceHandler
_createInstance, createInstance, getFactories, getInstances, tryFactories
 
Methods inherited from class org.gcube.common.core.utils.handlers.GCUBEStatefulServiceHandler
findInstances
 
Methods inherited from class org.gcube.common.core.utils.handlers.GCUBEServiceHandler
cacheEPR, clearCachedEPR, getAttempts, getCachedEPR, getCacheKey, interact, 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

StagingCall.StagingHandler

public StagingCall.StagingHandler()
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).

run

public void run()
         throws Exception
Executes the task implemented by the handler.

Specified by:
run in interface GCUBEIHandler<GCUBEServiceClientImpl>
Overrides:
run in class GCUBEServiceHandler<GCUBEServiceClientImpl>
Throws:
Exception - if the execution of the task does not complete normally.

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()}.

findWSResources

protected List<RPDocument> findWSResources()
                                    throws Exception
Discovers suitable WS-Resources of the target port-type.

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

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.

findFactories

protected List<org.apache.axis.message.addressing.EndpointReferenceType> findFactories()
                                                                                throws Exception
Returns a list of EPRs to factories.

Specified by:
findFactories in class GCUBEStagingServiceHandler<GCUBEServiceClientImpl>
Returns:
the list of EPRs.
Throws:
Exception - if no EPR can be returned.


Copyright © 2012. All Rights Reserved.