* check registration failed<br />
* error message received from SC <br />
*/
public synchronized void checkRegistration(int operationTimeoutSeconds) throws SCServiceException {
if (this.registered == false) {
throw new SCServiceException("Server is not registered for a service.");
}
// cancel server timeout not if its running already, you might interrupt current thread
this.cancelServerTimeout(false);
SCMPCheckRegistrationCall checkRegistrationCall = new SCMPCheckRegistrationCall(this.requester, this.serviceName);
SCServerCallback callback = new SCServerCallback(true);
try {
checkRegistrationCall.invoke(callback, operationTimeoutSeconds * Constants.SEC_TO_MILLISEC_FACTOR);
} catch (Exception e) {
throw new SCServiceException("Check registration failed. ", e);
}
SCMPMessage reply = callback.getMessageSync(operationTimeoutSeconds * Constants.SEC_TO_MILLISEC_FACTOR);
if (reply.isFault()) {
SCServiceException ex = new SCServiceException("Check registration failed.");
ex.setSCErrorCode(reply.getHeaderInt(SCMPHeaderAttributeKey.SC_ERROR_CODE));
ex.setSCErrorText(reply.getHeader(SCMPHeaderAttributeKey.SC_ERROR_TEXT));
throw ex;
}
// set up server timeout thread
this.triggerServerTimeout();
}