@Override public Object attempt(Connection cnx) throws Exception { throw new ServerOperationException("Something didn't work"); }
@Override protected Object processResponse(Message msg) throws Exception { if (this.type == CompletionType.BEFORE_COMPLETION) { try { processAck(msg, type.toString()); } catch (ServerOperationException e) { if (e.getCause() instanceof SynchronizationCommitConflictException) { throw (SynchronizationCommitConflictException) e.getCause(); } } return null; } else { TXCommitMessage rcs = (TXCommitMessage) processObjResponse(msg, this.type.toString()); this.tXCommitMessageResponse = rcs; return rcs; } }
/** * Create a new instance of ServerOperationException with a cause * * @param cause the cause */ public ServerOperationException(Throwable cause) { super(getServerMessage(cause), cause); }
@Override public Object attempt(Connection cnx) throws Exception { throw new ServerOperationException("Something didn't work"); }
/** * * Create a new instance of ServerOperationException with a detail message * * @param message the detail message */ public ServerOperationException(String message) { super(getServerMessage(message)); }
@Override public void handle(ChunkedMessage cm) throws Exception { Part part = cm.getPart(0); try { Object o = part.getObject(); if (o instanceof Throwable) { String s = "While performing a remote getAll"; exceptionRef[0] = new ServerOperationException(s, (Throwable) o); } else { VersionedObjectList chunk = (VersionedObjectList) o; chunk.replaceNullIDs(con.getEndpoint().getMemberId()); result.addAll(chunk); } } catch (Exception e) { exceptionRef[0] = new ServerOperationException("Unable to deserialize value", e); } } });
/** * Create a new instance of ServerOperationException with a detail message and cause * * @param message the detail message * @param cause the cause */ public ServerOperationException(String message, Throwable cause) { super(getServerMessage(message), cause); }
} else if (e instanceof BatchException || e instanceof BatchException70) { exToThrow = new ServerOperationException(e); } else if (e instanceof RegionDestroyedException) { invalidateServer = false; } else if (e instanceof GemFireSecurityException) { title = null; exToThrow = new ServerOperationException(e); } else if (e instanceof SerializationException) { exToThrow = new ServerOperationException(e); } else if (e instanceof CopyException) { exToThrow = new ServerOperationException(e); } else if (e instanceof ClassNotFoundException) { exToThrow = new ServerOperationException(e); } else if (e instanceof TransactionException) {
Throwable t = e.getCause(); if (t instanceof BatchException70) {
private static String getServerMessage(String msg) { // To fix bug 44679 add a description of the member the server is on. // Do this without changing how this class gets serialized so that old // clients will still work. InternalDistributedSystem ids = InternalDistributedSystem.getAnyInstance(); if (ids != null) { if (msg != null) { return "remote server on " + ids.getMemberId() + ": " + msg; } else { return "remote server on " + ids.getMemberId(); } } else { if (msg != null) { return "remote server on unknown location: " + msg; } else { return "remote server on unknown location"; } } }
@Override protected Object processResponse(Message msg) throws Exception { Part part = msg.getPart(0); final int msgType = msg.getMessageType(); if (msgType == MessageType.RESPONSE) { return Integer.valueOf(part.getInt()); } else { if (msgType == MessageType.EXCEPTION) { String s = "While performing a remote " + "getPdxIdForType"; throw new ServerOperationException(s, (Throwable) part.getObject()); // Get the exception toString part. // This was added for c++ thin client and not used in java } else if (isErrorResponse(msgType)) { throw new ServerOperationException(part.getString()); } else { throw new InternalGemFireError( "Unexpected message type " + MessageType.getString(msgType)); } } }
@Override protected Object processResponse(Message msg) throws Exception { Part part = msg.getPart(0); final int msgType = msg.getMessageType(); if (msgType == MessageType.RESPONSE) { return Integer.valueOf(part.getInt()); } else { if (msgType == MessageType.EXCEPTION) { String s = "While performing a remote " + "getPdxIdForEnum"; throw new ServerOperationException(s, (Throwable) part.getObject()); // Get the exception toString part. // This was added for c++ thin client and not used in java } else if (isErrorResponse(msgType)) { throw new ServerOperationException(part.getString()); } else { throw new InternalGemFireError( "Unexpected message type " + MessageType.getString(msgType)); } } }
@Override protected Object processResponse(Message msg) throws Exception { Part part = msg.getPart(0); int msgType = msg.getMessageType(); if (msgType == MessageType.RESPONSE) { return (Map<Integer, EnumInfo>) part.getObject(); } else { if (msgType == MessageType.EXCEPTION) { String s = "While performing a remote " + "getPdxEnums"; throw new ServerOperationException(s, (Throwable) part.getObject()); } else if (isErrorResponse(msgType)) { throw new ServerOperationException(part.getString()); } else { throw new InternalGemFireError( "Unexpected message type " + MessageType.getString(msgType)); } } }
@Override protected Object processResponse(Message msg) throws Exception { Part part = msg.getPart(0); final int msgType = msg.getMessageType(); if (msgType == MessageType.REPLY) { return part.getObject(); } else if (msgType == MessageType.EXCEPTION) { String s = "While performing a remote proxy cache close"; throw new ServerOperationException(s, (Throwable) part.getObject()); // Get the exception toString part. // This was added for c++ thin client and not used in java } else if (isErrorResponse(msgType)) { throw new ServerOperationException(part.getString()); } else { throw new InternalGemFireError("Unexpected message type " + MessageType.getString(msgType)); } }
@Override protected Object processResponse(Message msg) throws Exception { Part part = msg.getPart(0); int msgType = msg.getMessageType(); if (msgType == MessageType.RESPONSE) { return (Map<Integer, PdxType>) part.getObject(); } else { if (msgType == MessageType.EXCEPTION) { String s = "While performing a remote " + "getPdxTypes"; throw new ServerOperationException(s, (Throwable) part.getObject()); } else if (isErrorResponse(msgType)) { throw new ServerOperationException(part.getString()); } else { throw new InternalGemFireError( "Unexpected message type " + MessageType.getString(msgType)); } } }
@Override protected Object processResponse(Message msg) throws Exception { Part part = msg.getPart(0); final int msgType = msg.getMessageType(); if (msgType == MessageType.RESPONSE) { return part; } else { if (msgType == MessageType.REQUEST_EVENT_VALUE_ERROR) { // Value not found in haContainer. return null; } else if (msgType == MessageType.EXCEPTION) { String s = "While performing a remote " + "getFullValue"; throw new ServerOperationException(s, (Throwable) part.getObject()); // Get the exception toString part. // This was added for c++ thin client and not used in java } else if (isErrorResponse(msgType)) { throw new ServerOperationException(part.getString()); } else { throw new InternalGemFireError( "Unexpected message type " + MessageType.getString(msgType)); } } }
throw (PutAllPartialResultException) t; } else { throw new ServerOperationException(s, t); throw new ServerOperationException(part.getString()); } else { throw new InternalGemFireError("Unexpected message type " + MessageType.getString(msgType));