@Override public byte[] objectToByteBuffer(Object obj) throws Exception { // wrap MethodCall in Object[service_name, byte[]] so that service name is available during demarshalling if (obj instanceof MethodCall) { String name = ((MethodCall)obj).getName(); int idx = name.lastIndexOf('.'); String serviceName = name.substring(0, idx); return CoreGroupCommunicationService.this.objectToByteBufferInternal(new Object[]{serviceName, CoreGroupCommunicationService.this.objectToByteBufferInternal(obj)}); } return CoreGroupCommunicationService.this.objectToByteBufferInternal(obj); } }
public RspList callRemoteMethods(Vector dests, MethodCall method_call, int mode, long timeout, boolean use_anycasting, boolean oob) { if(dests != null && dests.isEmpty()) { // don't send if dest list is empty if(log.isTraceEnabled()) log.trace(new StringBuffer("destination list of ").append(method_call.getName()). append("() is empty: no need to send message")); return new RspList(); } if(log.isTraceEnabled()) log.trace(new StringBuffer("dests=").append(dests).append(", method_call=").append(method_call). append(", mode=").append(mode).append(", timeout=").append(timeout)); byte[] buf; try { buf=req_marshaller != null? req_marshaller.objectToByteBuffer(method_call) : Util.objectToByteBuffer(method_call); } catch(Exception e) { // if(log.isErrorEnabled()) log.error("exception", e); // we will change this in 2.4 to add the exception to the signature // (see http://jira.jboss.com/jira/browse/JGRP-193). The reason for a RTE is that we cannot change the // signature in 2.3, otherwise 2.3 would be *not* API compatible to prev releases throw new RuntimeException("failure to marshal argument(s)", e); } Message msg=new Message(null, null, buf); if(oob) msg.setFlag(Message.OOB); RspList retval=super.castMessage(dests, msg, mode, timeout, use_anycasting); if(log.isTraceEnabled()) log.trace("responses: " + retval); return retval; }
@Override public Buffer objectToBuffer(Object obj) throws Exception { // wrap MethodCall in Object[service_name, byte[]] so that service name is available during demarshalling if (obj instanceof MethodCall) { String name = ((MethodCall) obj).getName(); int idx = name.lastIndexOf('.'); String serviceName = name.substring(0, idx); return new Buffer(CoreGroupCommunicationService.this.objectToByteBufferInternal(new Object[] { serviceName, CoreGroupCommunicationService.this.objectToByteBufferInternal(obj) })); } return new Buffer(CoreGroupCommunicationService.this.objectToByteBufferInternal(obj)); }
String methodName = method_call.getName();
String methodName = method_call.getName();