Class ServiceDataCargo
- All Implemented Interfaces:
Serializable
It is not required that Analysis Engine Services use this class. It is provided as a convenience for those services that communicate using binary data.
This object contains state information extracted from an AnalysisProcessData. The
AnalysisProcessData object itself is not serializable, because it contains the
CAS object. CASes are heavyweight objects and should not be created and destroyed
with each network call.
Instead, to pass Analysis Process Data to a remote service, one should create a
ServiceDataCargo and send that to the remote service.
A ServiceDataCargo can be unmarshalled into an existing
AnalysisProcessData by calling the
unmarshalInto(AnalysisProcessData, boolean) method. Alternatively, the CAS state can be
unmarshalled separately by calling the unmarshalCas(CAS, boolean) method.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newSerializableAnalysisProcessDatathat contains information extracted from the specifiedAnalysisProcessData.ServiceDataCargo(CAS aCAS, ProcessTrace aProcessTrace) Creates a newSerializableAnalysisProcessDatathat contains the givenCASandProcessTrace. -
Method Summary
Modifier and TypeMethodDescriptionGets the ProcessTrace object from thisServiceDataCargo.voidsetProcessTrace(ProcessTrace aProcessTrace) Sets the ProcessTrace object from thisServiceDataCargo.voidunmarshalCas(CAS aCas, boolean aReplaceCasTypeSystem) Unmarshalls the CAS data in thisServiceDataCargointo an existingCASinstance.voidunmarshalInto(AnalysisProcessData aDataContainer, boolean aReplaceCasTypeSystem) Unmarshalls thisSerializableAnalysisProcessDatainto an existingAnalysisProcessDataobject.
-
Constructor Details
-
ServiceDataCargo
Creates a newSerializableAnalysisProcessDatathat contains information extracted from the specifiedAnalysisProcessData.- Parameters:
aData- the AnalysisProcessData to extract from
-
ServiceDataCargo
Creates a newSerializableAnalysisProcessDatathat contains the givenCASandProcessTrace.- Parameters:
aCAS- the CAS whose state will be extracted into this objectaProcessTrace- the process trace object. This may be null, if no process trace is available. (For example, ProcessTrace data may often be returned from a service but not passed to the service.)
-
-
Method Details
-
unmarshalInto
public void unmarshalInto(AnalysisProcessData aDataContainer, boolean aReplaceCasTypeSystem) throws CASException Unmarshalls thisSerializableAnalysisProcessDatainto an existingAnalysisProcessDataobject. The existing CAS data in theaDataContainerobject will be replaced by the CAS data in this object. TheProcessTraceevents in this object will be appended to theProcessTraceof theaDataContainerobject.- Parameters:
aDataContainer- the AnalysisProcessData to unmarshal intoaReplaceCasTypeSystem- -- Throws:
CASException- -
-
unmarshalCas
Unmarshalls the CAS data in thisServiceDataCargointo an existingCASinstance. The data in the exsiting CAS will be replaced by the CAS data in this object.- Parameters:
aCas- the CAS to unmarshal intoaReplaceCasTypeSystem- if true, assumes serialized data contains the type system- Throws:
CASException- passthru
-
getProcessTrace
Gets the ProcessTrace object from thisServiceDataCargo. This may return null, if no process trace is available. (For example, ProcessTrace data may often be returned from a service but not passed to the service.)- Returns:
- the process trace
-
setProcessTrace
Sets the ProcessTrace object from thisServiceDataCargo.- Parameters:
aProcessTrace- the process trace
-