public String readUTF() throws IOException { return delegate.readUTF(); }
void handleSessionOpenRequest(final int invId, final MessageInputStream inputStream) throws IOException { final String appName = inputStream.readUTF(); final String moduleName = inputStream.readUTF(); final String distName = inputStream.readUTF(); final String beanName = inputStream.readUTF(); final int securityContext; final ExceptionSupplier<ImportResult<?>, SystemException> transactionSupplier; if (version >= 3) { securityContext = inputStream.readInt(); transactionSupplier = readTransaction(inputStream); } else { securityContext = 0; transactionSupplier = null; } final Connection connection = channel.getConnection(); final EJBIdentifier identifier = new EJBIdentifier(appName, moduleName, beanName, distName); association.receiveSessionOpenRequest(new RemotingSessionOpenRequest( invId, identifier, transactionSupplier, connection.getLocalIdentity(securityContext))); }
void handleUnbind(final MessageInputStream message, final int messageId, final int id) throws IOException { try (MessageInputStream mis = message) { if (version == 1) { try (Unmarshaller unmarshaller = createUnmarshaller(mis, configuration)) { final int parameterType = unmarshaller.readUnsignedByte(); if (parameterType != Protocol.P_NAME) { Messages.log.unexpectedParameterType(Protocol.P_NAME, parameterType); } final Name name = unmarshaller.readObject(Name.class); localContext.unbind(name); } catch (ClassNotFoundException e) { throw new IOException(e); } } else { mis.readInt(); // consume authId final String name = mis.readUTF(); localContext.unbind(name); } } catch (NamingException e) { writeExceptionResponse(e, messageId, id); return; } writeSuccessResponse(messageId, id); }
final String name = mis.readUTF(); if (preserveLinks) { result = localContext.lookupLink(name);
final String name = mis.readUTF(); try (Unmarshaller unmarshaller = createUnmarshaller(mis, configuration)) { final Object object = unmarshaller.readObject();
void handleRename(final MessageInputStream message, final int messageId, final int id) throws IOException { try (MessageInputStream mis = message) { if (version == 1) { try (Unmarshaller unmarshaller = createUnmarshaller(mis, configuration)) { int parameterType = unmarshaller.readUnsignedByte(); if (parameterType != Protocol.P_NAME) { Messages.log.unexpectedParameterType(Protocol.P_NAME, parameterType); } final Name oldName = unmarshaller.readObject(Name.class); parameterType = unmarshaller.readUnsignedByte(); if (parameterType != Protocol.P_NAME) { Messages.log.unexpectedParameterType(Protocol.P_NAME, parameterType); } final Name newName = unmarshaller.readObject(Name.class); localContext.rename(oldName, newName); } catch (ClassNotFoundException e) { throw new IOException(e); } } else { mis.readInt(); // consume authId final String oldName = mis.readUTF(); final String newName = mis.readUTF(); localContext.rename(oldName, newName); } } catch (NamingException e) { writeExceptionResponse(e, messageId, id); return; } writeSuccessResponse(messageId, id); }
void handleCreateSubcontext(final MessageInputStream message, final int messageId, final int id) throws IOException { final Object result; try (MessageInputStream mis = message) { if (version == 1) { try (Unmarshaller unmarshaller = createUnmarshaller(mis, configuration)) { final int parameterType = unmarshaller.readUnsignedByte(); if (parameterType != Protocol.P_NAME) { Messages.log.unexpectedParameterType(Protocol.P_NAME, parameterType); } final Name name = unmarshaller.readObject(Name.class); result = localContext.createSubcontext(name); } catch (ClassNotFoundException e) { throw new IOException(e); } } else { mis.readInt(); // consume authId final String name = mis.readUTF(); result = localContext.createSubcontext(name); } } catch (NamingException e) { writeExceptionResponse(e, messageId, id); return; } writeSuccessResponse(messageId, id, result); }
void handleDestroySubcontext(final MessageInputStream message, final int messageId, final int id) throws IOException { try (MessageInputStream mis = message) { if (version == 1) { try (Unmarshaller unmarshaller = createUnmarshaller(mis, configuration)) { final int parameterType = unmarshaller.readUnsignedByte(); if (parameterType != Protocol.P_NAME) { Messages.log.unexpectedParameterType(Protocol.P_NAME, parameterType); } final Name name = unmarshaller.readObject(Name.class); localContext.destroySubcontext(name); } catch (ClassNotFoundException e) { throw new IOException(e); } } else { mis.readInt(); // consume authId final String name = mis.readUTF(); localContext.destroySubcontext(name); } } catch (NamingException e) { writeExceptionResponse(e, messageId, id); return; } writeSuccessResponse(messageId, id); }
final String name = mis.readUTF(); results = localContext.list(name);
final String name = mis.readUTF(); results = localContext.listBindings(name);
final List<NameClassPair> results = new ArrayList<>(listSize); for (int i = 0; i < listSize; i ++) { String itemName = is.readUTF(); String itemClass = is.readUTF(); final NameClassPair nameClassPair = new NameClassPair(itemName, itemClass, true); final CompositeName inNamespace = (CompositeName) compositeName.clone();
void handleTxnRecoverRequest(final int invId, final MessageInputStream message) throws IOException { final String parentName = message.readUTF(); final int flags = message.readInt(); final Xid[] xids; try { xids = transactionServer.getTransactionService().getTransactionContext().getRecoveryInterface().recover(flags, parentName); } catch (XAException e) { writeFailedResponse(invId, e); return; } try (MessageOutputStream os = messageTracker.openMessageUninterruptibly()) { os.writeByte(Protocol.TXN_RECOVERY_RESPONSE); os.writeShort(invId); PackedInteger.writePackedInteger(os, xids.length); final Marshaller marshaller = marshallerFactory.createMarshaller(configuration); marshaller.start(new NoFlushByteOutput(Marshalling.createByteOutput(os))); for (Xid xid : xids) { marshaller.writeObject(new XidTransactionID(xid)); } marshaller.finish(); } catch (IOException e) { // nothing to do at this point; the client doesn't want the response Logs.REMOTING.trace("EJB transaction response write failed", e); } }
public String readUTF() throws IOException { return delegate.readUTF(); }
void handleSessionOpenRequest(final int invId, final MessageInputStream inputStream) throws IOException { final String appName = inputStream.readUTF(); final String moduleName = inputStream.readUTF(); final String distName = inputStream.readUTF(); final String beanName = inputStream.readUTF(); final int securityContext; final ExceptionSupplier<ImportResult<?>, SystemException> transactionSupplier; if (version >= 3) { securityContext = inputStream.readInt(); transactionSupplier = readTransaction(inputStream); } else { securityContext = 0; transactionSupplier = null; } final Connection connection = channel.getConnection(); final EJBIdentifier identifier = new EJBIdentifier(appName, moduleName, beanName, distName); association.receiveSessionOpenRequest(new RemotingSessionOpenRequest( invId, identifier, transactionSupplier, connection.getLocalIdentity(securityContext))); }
void handleSessionOpenRequest(final int invId, final MessageInputStream inputStream) throws IOException { final String appName = inputStream.readUTF(); final String moduleName = inputStream.readUTF(); final String distName = inputStream.readUTF(); final String beanName = inputStream.readUTF(); final int securityContext; final ExceptionSupplier<ImportResult<?>, SystemException> transactionSupplier; if (version >= 3) { securityContext = inputStream.readInt(); transactionSupplier = readTransaction(inputStream); } else { securityContext = 0; transactionSupplier = null; } final Connection connection = channel.getConnection(); final EJBIdentifier identifier = new EJBIdentifier(appName, moduleName, beanName, distName); association.receiveSessionOpenRequest(new RemotingSessionOpenRequest( invId, identifier, transactionSupplier, connection.getLocalIdentity(securityContext))); }
void handleUnbind(final MessageInputStream message, final int messageId, final int id) throws IOException { try (MessageInputStream mis = message) { if (version == 1) { try (Unmarshaller unmarshaller = createUnmarshaller(mis, configuration)) { final int parameterType = unmarshaller.readUnsignedByte(); if (parameterType != Protocol.P_NAME) { Messages.log.unexpectedParameterType(Protocol.P_NAME, parameterType); } final Name name = unmarshaller.readObject(Name.class); localContext.unbind(name); } catch (ClassNotFoundException e) { throw new IOException(e); } } else { mis.readInt(); // consume authId final String name = mis.readUTF(); localContext.unbind(name); } } catch (NamingException e) { writeExceptionResponse(e, messageId, id); return; } writeSuccessResponse(messageId, id); }
void handleUnbind(final MessageInputStream message, final int messageId, final int id) throws IOException { try (MessageInputStream mis = message) { if (version == 1) { try (Unmarshaller unmarshaller = createUnmarshaller(mis, configuration)) { final int parameterType = unmarshaller.readUnsignedByte(); if (parameterType != Protocol.P_NAME) { Messages.log.unexpectedParameterType(Protocol.P_NAME, parameterType); } final Name name = unmarshaller.readObject(Name.class); localContext.unbind(name); } catch (ClassNotFoundException e) { throw new IOException(e); } } else { mis.readInt(); // consume authId final String name = mis.readUTF(); localContext.unbind(name); } } catch (NamingException e) { writeExceptionResponse(e, messageId, id); return; } writeSuccessResponse(messageId, id); }
void handleCreateSubcontext(final MessageInputStream message, final int messageId, final int id) throws IOException { final Object result; try (MessageInputStream mis = message) { if (version == 1) { try (Unmarshaller unmarshaller = createUnmarshaller(mis, configuration)) { final int parameterType = unmarshaller.readUnsignedByte(); if (parameterType != Protocol.P_NAME) { Messages.log.unexpectedParameterType(Protocol.P_NAME, parameterType); } final Name name = unmarshaller.readObject(Name.class); result = localContext.createSubcontext(name); } catch (ClassNotFoundException e) { throw new IOException(e); } } else { mis.readInt(); // consume authId final String name = mis.readUTF(); result = localContext.createSubcontext(name); } } catch (NamingException e) { writeExceptionResponse(e, messageId, id); return; } writeSuccessResponse(messageId, id, result); }
void handleTxnRecoverRequest(final int invId, final MessageInputStream message) throws IOException { final String parentName = message.readUTF(); final int flags = message.readInt(); final Xid[] xids; try { xids = transactionServer.getTransactionService().getTransactionContext().getRecoveryInterface().recover(flags, parentName); } catch (XAException e) { writeFailedResponse(invId, e); return; } try (MessageOutputStream os = messageTracker.openMessageUninterruptibly()) { os.writeByte(Protocol.TXN_RECOVERY_RESPONSE); os.writeShort(invId); PackedInteger.writePackedInteger(os, xids.length); final Marshaller marshaller = marshallerFactory.createMarshaller(configuration); marshaller.start(new NoFlushByteOutput(Marshalling.createByteOutput(os))); for (Xid xid : xids) { marshaller.writeObject(new XidTransactionID(xid)); } marshaller.finish(); } catch (IOException e) { // nothing to do at this point; the client doesn't want the response Logs.REMOTING.trace("EJB transaction response write failed", e); } }
void handleTxnRecoverRequest(final int invId, final MessageInputStream message) throws IOException { final String parentName = message.readUTF(); final int flags = message.readInt(); final Xid[] xids; try { xids = transactionServer.getTransactionService().getTransactionContext().getRecoveryInterface().recover(flags, parentName); } catch (XAException e) { writeFailedResponse(invId, e); return; } try (MessageOutputStream os = messageTracker.openMessageUninterruptibly()) { os.writeByte(Protocol.TXN_RECOVERY_RESPONSE); os.writeShort(invId); PackedInteger.writePackedInteger(os, xids.length); final Marshaller marshaller = marshallerFactory.createMarshaller(configuration); marshaller.start(new NoFlushByteOutput(Marshalling.createByteOutput(os))); for (Xid xid : xids) { marshaller.writeObject(new XidTransactionID(xid)); } marshaller.finish(); } catch (IOException e) { // nothing to do at this point; the client doesn't want the response Logs.REMOTING.trace("EJB transaction response write failed", e); } }