@Override protected void resumeLink(final Attach attach) throws AmqpErrorException { if (getTarget() == null) { throw new IllegalStateException("Terminus should be set when resuming a Link."); } if (attach.getTarget() == null) { throw new IllegalStateException("Attach.getTarget should not be null when resuming a Link. That would be recovering the Link."); } if (attach.getTarget() instanceof Coordinator) { throw new AmqpErrorException(new Error(AmqpError.PRECONDITION_FAILED, "Cannot resume standard receiving Link as a transaction coordinator")); } attachReceived(attach); }
private LinkEndpoint<S, T> createLinkEndpoint(final Session_1_0 session, final Attach attach) { final LinkEndpoint<S, T> linkEndpoint; if (_role == Role.SENDER) { linkEndpoint = (LinkEndpoint<S, T>) new SendingLinkEndpoint(session, (LinkImpl<Source, Target>) this); } else if (attach.getTarget() instanceof Coordinator) { linkEndpoint = (LinkEndpoint<S, T>) new TxnCoordinatorReceivingLinkEndpoint(session, (LinkImpl<Source, Coordinator>) this); } else { linkEndpoint = (LinkEndpoint<S, T>) new StandardReceivingLinkEndpoint(session, (LinkImpl<Source, Target>) this); } return linkEndpoint; }
@Override protected void reattachLink(final Attach attach) throws AmqpErrorException { if (attach.getTarget() instanceof Coordinator) { throw new AmqpErrorException(new Error(AmqpError.PRECONDITION_FAILED, "Cannot reattach standard receiving Link as a transaction coordinator")); } attachReceived(attach); }
Target attachTarget = (Target) attach.getTarget();
boolean isAttachingRemoteTerminusNull = (attach.getRole() == Role.SENDER ? attach.getSource() == null : attach.getTarget() == null); boolean isAttachingLocalTerminusNull = (attach.getRole() == Role.SENDER ? attach.getTarget() == null : attach.getSource() == null); boolean isLocalTerminusNull = (attach.getRole() == Role.SENDER ? getTarget() == null : getSource() == null);
Target target = (Target) attach.getTarget(); Source source = getSource(); if (source == null)
if( _value.getTarget() != null)