@Override public Marshaller getMarshaller(ChannelHandlerContext ctx) throws Exception { return factory.createMarshaller(config); }
@Override public Marshaller getMarshaller(ChannelHandlerContext ctx) throws Exception { return factory.createMarshaller(config); }
@Override public Marshaller run() throws IOException { return factory.createMarshaller(marshallingConfiguration); } });
@Override public Marshaller getMarshaller(ChannelHandlerContext ctx) throws Exception { return factory.createMarshaller(config); }
private Marshaller getMarshaller() throws IOException { return marshallerFactory.createMarshaller(configuration); }
protected Marshaller createMarshaller() throws IOException { return factory.createMarshaller(configuration); }
public Marshaller createMarshaller(MarshallingConfiguration marshallingConfiguration) throws IOException { return MARSHALLER_FACTORY.createMarshaller(marshallingConfiguration); }
public Marshaller getMarshaller(ChannelHandlerContext ctx) throws Exception { return factory.createMarshaller(config); }
public Marshaller getMarshaller(ChannelHandlerContext ctx) throws Exception { Marshaller marshaller = marshallers.get(); if (marshaller == null) { marshaller = factory.createMarshaller(config); marshallers.set(marshaller); } return marshaller; } }
public static Marshaller createMarshaller(MessageOutputStream os, MarshallingConfiguration configuration) throws IOException { final Marshaller marshaller = riverMarshallerFactory.createMarshaller(configuration); marshaller.start(new OutputStreamByteOutput(os) { @Override public void flush() throws IOException { //ignore flushes, all they do is wreck performance as you get a double flush when closing the marshaller //which results in two network packets being sent } }); return marshaller; }
@Override public Marshaller getMarshaller(ChannelHandlerContext ctx) throws Exception { Marshaller marshaller = marshallers.get(); if (marshaller == null) { marshaller = factory.createMarshaller(config); marshallers.set(marshaller); } return marshaller; } }
@Override public Marshaller getMarshaller(ChannelHandlerContext ctx) throws Exception { Marshaller marshaller = marshallers.get(); if (marshaller == null) { marshaller = factory.createMarshaller(config); marshallers.set(marshaller); } return marshaller; } }
@Override public Marshaller getMarshaller(ChannelHandlerContext ctx) throws Exception { Marshaller marshaller = marshallers.get(); if (marshaller == null) { marshaller = factory.createMarshaller(config); marshallers.set(marshaller); } return marshaller; } }
private String serialize(final Serializable serializable) { if (serializable == null) { return null; } ByteArrayOutputStream out = new ByteArrayOutputStream(); try { final Marshaller marshaller = factory.createMarshaller(configuration); marshaller.start(new OutputStreamByteOutput(out)); marshaller.writeObject(serializable); marshaller.finish(); out.flush(); } catch (IOException e) { throw new RuntimeException(e); } return Base64.getEncoder().encodeToString(out.toByteArray()); }
/** * Creates and returns a {@link org.jboss.marshalling.Marshaller} * * @param marshallerFactory The marshaller factory * @return * @throws IOException */ private org.jboss.marshalling.Marshaller getMarshaller(final org.jboss.marshalling.MarshallerFactory marshallerFactory) throws IOException { final MarshallingConfiguration marshallingConfiguration = new MarshallingConfiguration(); // TODO - Do we need an Object and Class table? marshallingConfiguration.setVersion(2); // TODO - Will need classloading server side to be in context of bean being called. return marshallerFactory.createMarshaller(marshallingConfiguration); }
/** * Creates and returns a {@link org.jboss.marshalling.Marshaller} * * @param marshallerFactory The marshaller factory * @return * @throws IOException */ private org.jboss.marshalling.Marshaller getMarshaller(final org.jboss.marshalling.MarshallerFactory marshallerFactory) throws IOException { final MarshallingConfiguration marshallingConfiguration = new MarshallingConfiguration(); // TODO - Do we need an Object and Class table? marshallingConfiguration.setVersion(2); // TODO - Will need classloading server side to be in context of bean being called. return marshallerFactory.createMarshaller(marshallingConfiguration); }
private static void doMarshall(HttpServerExchange exchange, Object result) throws IOException { exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "application/x-wf-jndi-jbmar-value;version=1"); final MarshallingConfiguration marshallingConfiguration = new MarshallingConfiguration(); marshallingConfiguration.setVersion(2); Marshaller marshaller = MARSHALLER_FACTORY.createMarshaller(marshallingConfiguration); marshaller.start(new NoFlushByteOutput(Marshalling.createByteOutput(exchange.getOutputStream()))); marshaller.writeObject(result); marshaller.finish(); }
private void writeFailedResponse(final int invId, final Throwable e) { try (MessageOutputStream os = messageTracker.openMessageUninterruptibly()) { os.writeByte(Protocol.APPLICATION_EXCEPTION); os.writeShort(invId); final Marshaller marshaller = marshallerFactory.createMarshaller(configuration); marshaller.start(new NoFlushByteOutput(Marshalling.createByteOutput(os))); marshaller.writeObject(new RequestSendFailedException(e.getMessage() + "@" + channel.getConnection().getPeerURI(), e)); marshaller.writeByte(0); marshaller.finish(); } catch (IOException e2) { // nothing to do at this point; the client doesn't want the response Logs.REMOTING.trace("EJB response write failed", e2); } }
public static void sendException(HttpServerExchange exchange, int status, Throwable e) throws IOException { exchange.setStatusCode(status); exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "application/x-wf-jbmar-exception;version=1"); final MarshallingConfiguration marshallingConfiguration = new MarshallingConfiguration(); marshallingConfiguration.setVersion(2); final Marshaller marshaller = MARSHALLER_FACTORY.createMarshaller(marshallingConfiguration); OutputStream outputStream = exchange.getOutputStream(); final ByteOutput byteOutput = new NoFlushByteOutput(Marshalling.createByteOutput(outputStream)); // start the marshaller marshaller.start(byteOutput); marshaller.writeObject(e); marshaller.write(0); marshaller.finish(); marshaller.flush(); } }
protected void writeFailure(Exception reason) { try (MessageOutputStream os = messageTracker.openMessageUninterruptibly()) { os.writeByte(Protocol.APPLICATION_EXCEPTION); os.writeShort(invId); if (version >= 3) os.writeByte(getEnlistmentStatus()); final Marshaller marshaller = marshallerFactory.createMarshaller(configuration); marshaller.start(new NoFlushByteOutput(Marshalling.createByteOutput(os))); marshaller.writeObject(reason); marshaller.writeByte(0); marshaller.finish(); } catch (IOException e) { // nothing to do at this point; the client doesn't want the response Logs.REMOTING.trace("EJB response write failed", e); } finally { invocations.removeKey(invId); } }