@Override public Persister<Message>[] getPersister() { Persister[] persisters = new Persister[]{AMQPMessagePersister.getInstance(), AMQPMessagePersisterV2.getInstance()}; return persisters; }
/** * Returns a copy of the message Header if one is present, changes to the returned * Header instance do not affect the original Message. * * @return a copy of the Message Header if one exists or null if none present. */ public Header getHeader() { ensureMessageDataScanned(); ensureDataIsValid(); return scanForMessageSection(headerPosition, Header.class); }
@Override public void handleBuffer(RemotingConnection connection, ActiveMQBuffer buffer) { ActiveMQProtonRemotingConnection protonConnection = (ActiveMQProtonRemotingConnection) connection; protonConnection.bufferReceived(protonConnection.getID(), buffer); }
@Override public AMQPMessage setAddress(String address) { setAddress(cachedAddressSimpleString(address)); return this; }
@Override public void destroy() { synchronized (this) { if (destroyed) { return; } destroyed = true; } callClosingListeners(); internalClose(); }
@Override public int getPersistSize() { ensureDataIsValid(); return DataConstants.SIZE_INT + internalPersistSize(); }
@Override public int getEncodeSize(Message record) { int encodeSize = super.getEncodeSize(record) + DataConstants.SIZE_INT; TypedProperties properties = ((AMQPMessage)record).getExtraProperties(); return encodeSize + (properties != null ? properties.getEncodeSize() : 0); }
private synchronized void ensureDataIsValid() { assert data != null; if (modified) { encodeMessage(); modified = false; } }
public int getAmqpCredits() { if (protocolManager != null) { return protocolManager.getAmqpCredits(); } else { // this is for tests only... return AmqpSupport.AMQP_CREDITS_DEFAULT; } }
public static AMQPMessagePersisterV2 getInstance() { if (theInstance == null) { theInstance = new AMQPMessagePersisterV2(); } return theInstance; }
public static AMQPMessagePersister getInstance() { if (theInstance == null) { theInstance = new AMQPMessagePersister(); } return theInstance; }
private synchronized void ensureMessageDataScanned() { if (!messageDataScanned) { scanMessageData(); messageDataScanned = true; } }
public int getAmqpLowCredits() { if (protocolManager != null) { return protocolManager.getAmqpLowCredits(); } else { // this is for tests only... return AmqpSupport.AMQP_LOW_CREDITS_DEFAULT; } }
public AMQPConnectionCallback(ProtonProtocolManager manager, Connection connection, Executor sessionExecutor, ActiveMQServer server) { this.manager = manager; this.connection = connection; this.sessionExecutor = sessionExecutor; this.server = server; saslMechanisms = manager.getSaslMechanisms(); }
@Override public RemotingConnection getRemotingConnection() { return connection.connectionCallback.getProtonConnectionDelegate(); } });
public Executor getExeuctor() { if (protonConnectionDelegate != null) { return protonConnectionDelegate.getExecutor(); } else { return null; } }
/** * Disconnect the connection, closing all channels */ @Override public void disconnect(String scaleDownNodeID, boolean criticalError) { disconnect(criticalError); }
/** * Returns a copy of the MessageAnnotations in the message if present or null. Changes to the * returned DeliveryAnnotations instance do not affect the original Message. * * @return a copy of the {@link DeliveryAnnotations} present in the message or null if non present. */ public DeliveryAnnotations getDeliveryAnnotations() { ensureMessageDataScanned(); ensureDataIsValid(); return scanForMessageSection(deliveryAnnotationsPosition, DeliveryAnnotations.class); }
@Override public Persister<Message>[] getPersister() { Persister[] persisters = new Persister[]{AMQPMessagePersister.getInstance(), AMQPMessagePersisterV2.getInstance()}; return persisters; }
/** * Returns a copy of the message Properties if one is present, changes to the returned * Properties instance do not affect the original Message. * * @return a copy of the Message Properties if one exists or null if none present. */ public Properties getProperties() { ensureMessageDataScanned(); ensureDataIsValid(); return scanForMessageSection(propertiesPosition, Properties.class); }