Package org.springframework.messaging.support

Examples of org.springframework.messaging.support.ExecutorSubscribableChannel$SendTask


            if (result == null)
                result = defaultCase(theEObject);
            return result;
        }
        case Bpmn2Package.SEND_TASK: {
            SendTask sendTask = (SendTask) theEObject;
            T result = caseSendTask(sendTask);
            if (result == null)
                result = caseTask(sendTask);
            if (result == null)
                result = caseActivity(sendTask);
View Full Code Here


      super(fp, "Send Task", "Task that is completed when a message is sent");
    }

    @Override
    protected Task createFlowElement(ICreateContext context) {
      SendTask task = ModelHandler.FACTORY.createSendTask();
      task.setName("Send Task");
      task.setImplementation("##unspecified");
      return task;
    }
View Full Code Here

  }

  @Test
  public void handleMessageFromClientWithImmutableMessageInterceptor() {
    AtomicReference<Boolean> mutable = new AtomicReference<>();
    ExecutorSubscribableChannel channel = new ExecutorSubscribableChannel();
    channel.addInterceptor(new ChannelInterceptorAdapter() {
      @Override
      public Message<?> preSend(Message<?> message, MessageChannel channel) {
        mutable.set(MessageHeaderAccessor.getAccessor(message, MessageHeaderAccessor.class).isMutable());
        return message;
      }
    });
    channel.addInterceptor(new ImmutableMessageChannelInterceptor());

    StompSubProtocolHandler handler = new StompSubProtocolHandler();
    handler.afterSessionStarted(this.session, channel);

    TextMessage message = StompTextMessageBuilder.create(StompCommand.CONNECT).build();
View Full Code Here

  }

  @Test
  public void handleMessageFromClientWithoutImmutableMessageInterceptor() {
    AtomicReference<Boolean> mutable = new AtomicReference<>();
    ExecutorSubscribableChannel channel = new ExecutorSubscribableChannel();
    channel.addInterceptor(new ChannelInterceptorAdapter() {
      @Override
      public Message<?> preSend(Message<?> message, MessageChannel channel) {
        mutable.set(MessageHeaderAccessor.getAccessor(message, MessageHeaderAccessor.class).isMutable());
        return message;
      }
View Full Code Here

  static class TestMessageBrokerConfiguration extends DelegatingWebSocketMessageBrokerConfiguration {

    @Override
    @Bean
    public AbstractSubscribableChannel clientInboundChannel() {
      return new ExecutorSubscribableChannel(); // synchronous
    }
View Full Code Here

    }

    @Override
    @Bean
    public AbstractSubscribableChannel clientOutboundChannel() {
      return new ExecutorSubscribableChannel(); // synchronous
    }
View Full Code Here

  @Before
  public void setup() {

    TestMessageChannelDestinationResolver resolver = new TestMessageChannelDestinationResolver();

    this.myChannel = new ExecutorSubscribableChannel();
    resolver.registerMessageChannel("myChannel", this.myChannel);

    this.template = new TestDestinationResolvingMessagingTemplate();
    this.template.setDestinationResolver(resolver);
View Full Code Here


  @Test
  public void sendAndReceive() {

    SubscribableChannel channel = new ExecutorSubscribableChannel(this.executor);
    channel.subscribe(new MessageHandler() {
      @Override
      public void handleMessage(Message<?> message) throws MessagingException {
        MessageChannel replyChannel = (MessageChannel) message.getHeaders().getReplyChannel();
        replyChannel.send(new GenericMessage<String>("response"));
      }
View Full Code Here

    final CountDownLatch latch = new CountDownLatch(1);

    this.template.setReceiveTimeout(1);
    this.template.setThrowExceptionOnLateReply(true);

    SubscribableChannel channel = new ExecutorSubscribableChannel(this.executor);
    channel.subscribe(new MessageHandler() {
      @Override
      public void handleMessage(Message<?> message) throws MessagingException {
        try {
          Thread.sleep(500);
          MessageChannel replyChannel = (MessageChannel) message.getHeaders().getReplyChannel();
View Full Code Here

  @Before
  public void setUp() throws Exception {
    logger.debug("Setting up before '" + this.testName.getMethodName() + "'");
    this.port = SocketUtils.findAvailableTcpPort(61613);
    this.responseChannel = new ExecutorSubscribableChannel();
    this.responseHandler = new TestMessageHandler();
    this.responseChannel.subscribe(this.responseHandler);
    this.eventPublisher = new TestEventPublisher();
    startActiveMqBroker();
    createAndStartRelay();
View Full Code Here

TOP

Related Classes of org.springframework.messaging.support.ExecutorSubscribableChannel$SendTask

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.