@Override public void write(DataOutput output, SessionID id) throws IOException { byte[] encoded = id.getEncodedForm(); IndexSerializer.UNSIGNED_BYTE.writeInt(output, encoded.length); output.write(encoded); }
final byte[] bytes = sessionId.getEncodedForm(); PackedInteger.writePackedInteger(os, bytes.length); os.write(bytes);
.setBeanName(locator.getBeanName()); if (locator instanceof StatefulEJBLocator) { builder.setBeanId(Base64.getUrlEncoder().encodeToString(locator.asStateful().getSessionId().getEncodedForm()));
os.writeByte(Protocol.OPEN_SESSION_RESPONSE); os.writeShort(invId); final byte[] encodedForm = sessionId.getEncodedForm(); PackedInteger.writePackedInteger(os, encodedForm.length); os.write(encodedForm);
@Override public void write(DataOutput output, SessionID id) throws IOException { byte[] encoded = id.getEncodedForm(); IndexSerializer.UNSIGNED_BYTE.writeInt(output, encoded.length); output.write(encoded); }
private void writeSessionId(final ChannelAssociation channelAssociation, final short invocationId, final SessionID sessionID, final Affinity hardAffinity) throws IOException { final byte[] sessionIdBytes = sessionID.getEncodedForm(); final DataOutputStream dataOutputStream; final MessageOutputStream messageOutputStream; try { messageOutputStream = channelAssociation.acquireChannelMessageOutputStream(); } catch (Exception e) { throw EjbMessages.MESSAGES.failedToOpenMessageOutputStream(e); } dataOutputStream = new DataOutputStream(messageOutputStream); try { // write out header dataOutputStream.writeByte(HEADER_SESSION_OPEN_RESPONSE); // write out invocation id dataOutputStream.writeShort(invocationId); // session id byte length PackedInteger.writePackedInteger(dataOutputStream, sessionIdBytes.length); // write out the session id bytes dataOutputStream.write(sessionIdBytes); // now marshal the hard affinity associated with this session final Marshaller marshaller = this.prepareForMarshalling(this.marshallerFactory, dataOutputStream); marshaller.writeObject(hardAffinity); // finish marshalling marshaller.finish(); } finally { channelAssociation.releaseChannelMessageOutputStream(messageOutputStream); dataOutputStream.close(); } }
final byte[] bytes = sessionId.getEncodedForm(); PackedInteger.writePackedInteger(os, bytes.length); os.write(bytes);
final byte[] bytes = sessionId.getEncodedForm(); PackedInteger.writePackedInteger(os, bytes.length); os.write(bytes);
.setBeanName(locator.getBeanName()); if (locator instanceof StatefulEJBLocator) { builder.setBeanId(Base64.getUrlEncoder().encodeToString(locator.asStateful().getSessionId().getEncodedForm()));
.setBeanName(locator.getBeanName()); if (locator instanceof StatefulEJBLocator) { builder.setBeanId(Base64.getUrlEncoder().encodeToString(locator.asStateful().getSessionId().getEncodedForm()));
os.writeByte(Protocol.OPEN_SESSION_RESPONSE); os.writeShort(invId); final byte[] encodedForm = sessionId.getEncodedForm(); PackedInteger.writePackedInteger(os, encodedForm.length); os.write(encodedForm);
os.writeByte(Protocol.OPEN_SESSION_RESPONSE); os.writeShort(invId); final byte[] encodedForm = sessionId.getEncodedForm(); PackedInteger.writePackedInteger(os, encodedForm.length); os.write(encodedForm);