@Override public Unmarshaller getUnmarshaller(ChannelHandlerContext ctx) throws Exception { return factory.createUnmarshaller(config); }
@Override public Unmarshaller getUnmarshaller(ChannelHandlerContext ctx) throws Exception { return factory.createUnmarshaller(config); }
protected Unmarshaller createUnmarshaller() throws IOException { return factory.createUnmarshaller(configuration); }
@Override public Unmarshaller getUnmarshaller(ChannelHandlerContext ctx) throws Exception { return factory.createUnmarshaller(config); }
public Unmarshaller createUnmarshaller(MarshallingConfiguration marshallingConfiguration) throws IOException { return MARSHALLER_FACTORY.createUnmarshaller(marshallingConfiguration); }
Unmarshaller createUnmarshaller() throws IOException { return marshallerFactory.createUnmarshaller(configuration); }
public Unmarshaller getUnmarshaller(ChannelHandlerContext ctx) throws Exception { return factory.createUnmarshaller(config); }
public Unmarshaller getUnmarshaller(ChannelHandlerContext ctx) throws Exception { Unmarshaller unmarshaller = unmarshallers.get(); if (unmarshaller == null) { unmarshaller = factory.createUnmarshaller(config); unmarshallers.set(unmarshaller); } return unmarshaller; }
@Override public Unmarshaller createUnmarshaller(int version) throws IOException { return this.factory.createUnmarshaller(this.getMarshallingConfiguration(version)); }
@Override public Unmarshaller getUnmarshaller(ChannelHandlerContext ctx) throws Exception { Unmarshaller unmarshaller = unmarshallers.get(); if (unmarshaller == null) { unmarshaller = factory.createUnmarshaller(config); unmarshallers.set(unmarshaller); } return unmarshaller; }
@Override public Unmarshaller getUnmarshaller(ChannelHandlerContext ctx) throws Exception { Unmarshaller unmarshaller = unmarshallers.get(); if (unmarshaller == null) { unmarshaller = factory.createUnmarshaller(config); unmarshallers.set(unmarshaller); } return unmarshaller; }
@Override public Unmarshaller getUnmarshaller(ChannelHandlerContext ctx) throws Exception { Unmarshaller unmarshaller = unmarshallers.get(); if (unmarshaller == null) { unmarshaller = factory.createUnmarshaller(config); unmarshallers.set(unmarshaller); } return unmarshaller; }
private Object deserialize(final String info) throws IOException, ClassNotFoundException { byte[] data = Base64.getDecoder().decode(info.trim()); Unmarshaller unmarshaller = factory.createUnmarshaller(configuration); unmarshaller.start(new ByteBufferInput(ByteBuffer.wrap(data))); try { return unmarshaller.readObject(); } finally { unmarshaller.close(); } }
public static Unmarshaller createUnmarshaller(MessageInputStream is, MarshallingConfiguration configuration) throws IOException { final Unmarshaller unmarshaller = riverMarshallerFactory.createUnmarshaller(configuration); unmarshaller.start(Marshalling.createByteInput(is)); return unmarshaller; }
public Object deSerialize(final String data) throws SQLException { if (data == null) { return null; } InputStream in = new ByteArrayInputStream(Base64.getDecoder().decode(data)); try { final Unmarshaller unmarshaller = factory.createUnmarshaller(configuration); unmarshaller.start(new InputStreamByteInput(in)); Object ret = unmarshaller.readObject(); unmarshaller.finish(); return ret; } catch (IOException e) { throw new RuntimeException(e); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } finally { safeClose(in); } }
private Object unmarshalIdentifier() throws IOException, ClassNotFoundException { final Object id; try { final byte[] idData = poaCurrent.get_object_id(); final Unmarshaller unmarshaller = factory.createUnmarshaller(configuration); unmarshaller.start(new InputStreamByteInput(new ByteArrayInputStream(idData))); id = unmarshaller.readObject(); unmarshaller.finish(); } catch (NoContext noContext) { throw new RuntimeException(noContext); } return id; }
/** * Creates and returns a {@link Unmarshaller} * * * @param marshallerFactory The marshaller factory * @return * @throws IOException */ private Unmarshaller getUnMarshaller(final MarshallerFactory marshallerFactory, final ClassResolver classResolver) throws IOException { final MarshallingConfiguration marshallingConfiguration = new MarshallingConfiguration(); marshallingConfiguration.setVersion(2); marshallingConfiguration.setClassResolver(classResolver); return marshallerFactory.createUnmarshaller(marshallingConfiguration); }
/** * Creates and returns a {@link Unmarshaller} * * * @param marshallerFactory The marshaller factory * @return * @throws IOException */ private Unmarshaller getUnMarshaller(final MarshallerFactory marshallerFactory, final ClassResolver classResolver) throws IOException { final MarshallingConfiguration marshallingConfiguration = new MarshallingConfiguration(); marshallingConfiguration.setVersion(2); marshallingConfiguration.setClassResolver(classResolver); return marshallerFactory.createUnmarshaller(marshallingConfiguration); }
@Override protected final Object doOperation(HttpServerExchange exchange, String name) throws NamingException { ContentType contentType = ContentType.parse(exchange.getRequestHeaders().getFirst(Headers.CONTENT_TYPE)); if (contentType == null || !contentType.getType().equals("application/x-wf-jndi-jbmar-value") || contentType.getVersion() != 1) { exchange.setStatusCode(StatusCodes.BAD_REQUEST); exchange.endExchange(); return null; } final MarshallingConfiguration marshallingConfiguration = new MarshallingConfiguration(); marshallingConfiguration.setVersion(2); try (InputStream inputStream = exchange.getInputStream()) { Unmarshaller unmarshaller = MARSHALLER_FACTORY.createUnmarshaller(marshallingConfiguration); unmarshaller.start(new InputStreamByteInput(inputStream)); Object object = unmarshaller.readObject(); unmarshaller.finish(); doOperation(name, object); } catch (Exception e) { NamingException nm = new NamingException(e.getMessage()); nm.initCause(e); throw nm; } return null; }
@Override public final void handleRequest(HttpServerExchange exchange) throws Exception { ContentType contentType = ContentType.parse(exchange.getRequestHeaders().getFirst(Headers.CONTENT_TYPE)); if (contentType == null || contentType.getVersion() != 1 || !contentType.getType().equals(TransactionConstants.XID)) { exchange.setStatusCode(StatusCodes.BAD_REQUEST); HttpRemoteTransactionMessages.MESSAGES.debugf("Exchange %s has incorrect or missing content type", exchange); return; } try { Unmarshaller unmarshaller = MARSHALLER_FACTORY.createUnmarshaller(createMarshallingConf()); unmarshaller.start(new InputStreamByteInput(exchange.getInputStream())); int formatId = unmarshaller.readInt(); int len = unmarshaller.readInt(); byte[] globalId = new byte[len]; unmarshaller.readFully(globalId); len = unmarshaller.readInt(); byte[] branchId = new byte[len]; unmarshaller.readFully(branchId); SimpleXid simpleXid = new SimpleXid(formatId, globalId, branchId); unmarshaller.finish(); ImportResult<LocalTransaction> transaction = transactionContext.findOrImportTransaction(simpleXid, 0); transaction.getTransaction().performFunction((ExceptionBiFunction<ImportResult<LocalTransaction>, HttpServerExchange, Void, Exception>) (o, exchange2) -> { handleImpl(exchange2, o); return null; }, transaction, exchange); } catch (Exception e) { sendException(exchange, StatusCodes.INTERNAL_SERVER_ERROR, e); } }