try { bais = new ByteArrayInputStream(in); input = new HessianInput(bais); input.startReply(); obj = input.readObject();
in = new HessianInput(isToUse); if (major >= 2) { out = new Hessian2Output(osToUse);
byte[] requestByteArray = ByteUtils.stringToByteArray(transactionContextContent); ByteArrayInputStream bais = new ByteArrayInputStream(requestByteArray); HessianInput input = new HessianInput(bais); try { TransactionContext remoteTransactionContext = (TransactionContext) input.readObject();
byte[] requestByteArray = ByteUtils.stringToByteArray(transactionContextContent); ByteArrayInputStream bais = new ByteArrayInputStream(requestByteArray); HessianInput input = new HessianInput(bais); try { TransactionContext remoteTransactionContext = (TransactionContext) input.readObject();
private void afterConsumerInvokeForSVC(Invocation invocation, TransactionRequestImpl request, TransactionResponseImpl response) { CompensableBeanRegistry beanRegistry = CompensableBeanRegistry.getInstance(); CompensableBeanFactory beanFactory = beanRegistry.getBeanFactory(); TransactionInterceptor transactionInterceptor = beanFactory.getTransactionInterceptor(); RemotingException rpcError = null; try { if (request.getTransactionContext() != null) { String transactionContextContent = invocation.getAttachment(TransactionContext.class.getName()); byte[] byteArray = ByteUtils.stringToByteArray(transactionContextContent); ByteArrayInputStream bais = new ByteArrayInputStream(byteArray); HessianInput input = new HessianInput(bais); TransactionContext remoteTransactionContext = (TransactionContext) input.readObject(); response.setTransactionContext(remoteTransactionContext); } } catch (IOException ex) { logger.error("Error occurred in remote call!", ex); rpcError = new RemotingException(ex.getMessage()); } try { transactionInterceptor.afterReceiveResponse(response); } catch (RuntimeException rex) { logger.error("Error occurred in remote call!", rex); throw new RemotingException(rex.getMessage()); } if (rpcError != null) { throw rpcError; } }
private void afterConsumerInvokeForSVC(Invocation invocation, TransactionRequestImpl request, TransactionResponseImpl response) { CompensableBeanRegistry beanRegistry = CompensableBeanRegistry.getInstance(); CompensableBeanFactory beanFactory = beanRegistry.getBeanFactory(); TransactionInterceptor transactionInterceptor = beanFactory.getTransactionInterceptor(); RemotingException rpcError = null; try { if (request.getTransactionContext() != null) { String transactionContextContent = invocation.getAttachment(TransactionContext.class.getName()); byte[] byteArray = ByteUtils.stringToByteArray(transactionContextContent); ByteArrayInputStream bais = new ByteArrayInputStream(byteArray); HessianInput input = new HessianInput(bais); TransactionContext remoteTransactionContext = (TransactionContext) input.readObject(); response.setTransactionContext(remoteTransactionContext); } } catch (IOException ex) { logger.error("Error occurred in remote call!", ex); rpcError = new RemotingException(ex.getMessage()); } try { transactionInterceptor.afterReceiveResponse(response); } catch (RuntimeException rex) { logger.error("Error occurred in remote call!", rex); throw new RemotingException(rex.getMessage()); } if (rpcError != null) { throw rpcError; } }
in = new HessianInput(isToUse); if (major >= 2) { out = new Hessian2Output(osToUse);
/** * {@inheritDoc} * * @see marshalsec.AbstractHessianBase#createInput(java.io.ByteArrayInputStream) */ @Override protected AbstractHessianInput createInput ( ByteArrayInputStream bos ) { return new HessianInput(bos); }
/** * Creates a new Hessian 1.0 deserializer. */ public HessianInput createHessianInput(InputStream is) { return new HessianInput(is); }
/** * Creates a new Hessian 1.0 deserializer. */ public HessianInput createHessianInput(InputStream is) { return new HessianInput(is); }
/** * Creates a new Hessian 1.0 deserializer. */ public HessianInput createHessianInput(InputStream is) { return new HessianInput(is); }
static public HessianInput createHessianInput(InputStream in) { HessianInput hin = new HessianInput(in); hin.setSerializerFactory(_serializerFactory); return hin; }
@Override public <T> T deserialize(byte[] serializedObject, Class<T> objectClass) throws IOException { HessianInput in = new HessianInput(new ByteArrayInputStream(serializedObject)); in.setSerializerFactory(serializerFactory); return objectClass.cast(in.readObject()); }
@Override @SuppressWarnings("unchecked") public <T extends Serializable> T decode(byte[] bytes) throws SerializationException { ByteArrayInputStream is = new ByteArrayInputStream(bytes); HessianInput hi = new HessianInput(is); try { return (T) hi.readObject(); } catch (IOException e) { throw new SerializationException(e); } }
@Override public <T> T deserialize(InputStream input, Class<T> objectClass) throws IOException { HessianInput in = new HessianInput(input); in.setSerializerFactory(serializerFactory); return objectClass.cast(in.readObject()); } }
public static Serializable hessianDeserialize(byte[] bytes) throws IOException { ByteArrayInputStream bais = new ByteArrayInputStream(bytes); HessianInput hi = new HessianInput(bais); try { Object result = hi.readObject(); return (Serializable) result; } finally { CommonUtils.closeQuietly(bais); } }
/** * Client side of the handshake */ public static Response sendHandshake(Request request, Socket s) throws IOException { HessianInput input = new HessianInput(s.getInputStream()); HessianOutput output = new HessianOutput(s.getOutputStream()); output.findSerializerFactory().setAllowNonSerializable(true); output.writeObject(request); return (Response) input.readObject(); }
HessianCauchoInput(InputStream stream) { this.input = new HessianInput(); input.setSerializerFactory(new JMXSerializerFactory()); input.init(stream); }
public AbstractHessianInput getHessian1Input(InputStream is) { AbstractHessianInput in; if (_isDebug) is = new HessianDebugInputStream(is, new PrintWriter(System.out)); in = new HessianInput(is); in.setRemoteResolver(getRemoteResolver()); in.setSerializerFactory(getSerializerFactory()); return in; }
public static Object deserialize(byte[] by) throws IOException { if (by == null) throw new NullPointerException(); SerializerFactory serializerFactory = new SerializerFactory(); serializerFactory.addFactory(new BigDecimalSerializerFactory()); ByteArrayInputStream is = new ByteArrayInputStream(by); HessianInput hi = new HessianInput(is); hi.setSerializerFactory(serializerFactory); return hi.readObject(); } }