|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gcube.common.core.utils.handlers.GCUBEHandler<CLIENT>
org.gcube.common.core.utils.handlers.GCUBEServiceHandler<CLIENT>
org.gcube.common.core.utils.handlers.GCUBEStatefulServiceHandler<CLIENT>
org.gcube.common.core.utils.handlers.GCUBEStagingServiceHandler<CLIENT>
CLIENT - the type of the handled object. It must implement the GCUBEServiceClient interface.public abstract class GCUBEStagingServiceHandler<CLIENT extends GCUBEServiceClient>
Abstract extension of GCUBEStatefulServiceHandler which extends its best-attempt strategy
to the case in which instances of the target port-type can be created through factory port-types.
The strategy extends GCUBEStatefulServiceHandler's by:
(1) Discovering factories whenever no instance can be found of the target port-type;
(2) Interacting with each factory to create an instance of the target port-type, until one instance has been created;
(3) Interacting with the created instance of the target port-type.
To completely define strategy, subclasses must implement the abstract methods required by GCUBEStatefulServiceHandler
as well as the following abstract methods:
(a) findFactories() to discover factories;
(b) createInstance(EndpointReferenceType) to interact with a factory to create an instance of the target port-type;
| 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 | |
|---|---|
GCUBEStagingServiceHandler()
Creates an instance. |
|
GCUBEStagingServiceHandler(CLIENT client)
Creates an instance to act on or on behalf of a service client. |
|
| Method Summary | |
|---|---|
protected org.apache.axis.message.addressing.EndpointReferenceType |
_createInstance(org.apache.axis.message.addressing.EndpointReferenceType epr)
Used internally to wrap createInstance(EndpointReferenceType) and handle its failures.If createInstance(EndpointReferenceType) fails with a GCUBEFault, it propagates the
GCUBEException which models the fault most specifically. |
protected abstract org.apache.axis.message.addressing.EndpointReferenceType |
createInstance(org.apache.axis.message.addressing.EndpointReferenceType epr)
Interacts with a factory to create an instance of the target port-type. |
protected abstract List<org.apache.axis.message.addressing.EndpointReferenceType> |
findFactories()
Returns a list of EPRs to factories. |
protected List<org.apache.axis.message.addressing.EndpointReferenceType> |
getFactories()
Returns a non-empty list of EPRs to factories. |
protected List<org.apache.axis.message.addressing.EndpointReferenceType> |
getInstances()
Returns a non-empty list of EPRs to instances of the target port-type. |
protected org.apache.axis.message.addressing.EndpointReferenceType |
tryFactories(List<org.apache.axis.message.addressing.EndpointReferenceType> eprs)
Interacts with a list of factories to spawn an instance of the target port-type. |
| Methods inherited from class org.gcube.common.core.utils.handlers.GCUBEStatefulServiceHandler |
|---|
findInstances, findWSResources |
| Methods inherited from class org.gcube.common.core.utils.handlers.GCUBEServiceHandler |
|---|
_interact, cacheEPR, clearCachedEPR, getAttempts, getCachedEPR, getCacheKey, getTargetPortTypeName, interact, run, setAttempts, tryInstances |
| Methods inherited from class org.gcube.common.core.utils.handlers.GCUBEHandler |
|---|
clearBlackboard, getBlackboard, getHandled, getId, getLogger, getName, getScopeManager, 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, getScopeManager, getSecurityManager, setBlackboard, setHandled, setLogger, setName, setScopeManager, setSecurityManager, subscribe, undo, unsubscribe |
| Constructor Detail |
|---|
public GCUBEStagingServiceHandler()
public GCUBEStagingServiceHandler(CLIENT client)
client - the client.| Method Detail |
|---|
protected List<org.apache.axis.message.addressing.EndpointReferenceType> getInstances()
throws Exception
getInstances() or, if none is returned, the single
instance spawned as the result of the first successful interaction with a factory returned by
getFactories().
getInstances in class GCUBEServiceHandler<CLIENT extends GCUBEServiceClient>Exception - if no EPRs can be returned.
protected org.apache.axis.message.addressing.EndpointReferenceType tryFactories(List<org.apache.axis.message.addressing.EndpointReferenceType> eprs)
throws Exception
eprs - the EPRs of the factories.
Exception - if no interaction is successful.
protected List<org.apache.axis.message.addressing.EndpointReferenceType> getFactories()
throws Exception,
GCUBEServiceHandler.NoQueryResultException
NoQueryResultException - if no factory can be found.
Exception - if no EPR can be returned.
GCUBEServiceHandler.NoQueryResultException
protected org.apache.axis.message.addressing.EndpointReferenceType _createInstance(org.apache.axis.message.addressing.EndpointReferenceType epr)
throws Exception
createInstance(EndpointReferenceType) and handle its failures.createInstance(EndpointReferenceType) fails with a GCUBEFault, it propagates the
GCUBEException which models the fault most specifically.
epr - the EPR of a factory.
Exception - if no instance could be created.createInstance(EndpointReferenceType)
protected abstract List<org.apache.axis.message.addressing.EndpointReferenceType> findFactories()
throws Exception
Exception - if no EPR can be returned.
protected abstract org.apache.axis.message.addressing.EndpointReferenceType createInstance(org.apache.axis.message.addressing.EndpointReferenceType epr)
throws Exception
epr - the EPR of the factory.
Exception - if the interaction does not complete successfully.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||