Examples of MessageHandler


Examples of org.jboss.as.ejb3.remote.protocol.MessageHandler

        // read the first byte to see what type of a message it is
        final int header = inputStream.read();
        if (EjbLogger.ROOT_LOGGER.isTraceEnabled()) {
            EjbLogger.ROOT_LOGGER.trace("Got message with header 0x" + Integer.toHexString(header) + " on channel " + channel);
        }
        final MessageHandler messageHandler = getMessageHandler((byte) header);
        if (messageHandler == null) {
            // enroll for next message (whenever it's available)
            channel.receiveMessage(this);
            // log a message that the message wasn't identified
            EjbLogger.ROOT_LOGGER.unsupportedMessageHeader(Integer.toHexString(header), channel);
            return;
        }
        // let the message handler process the message
        messageHandler.processMessage(channelAssociation, inputStream);
    }
View Full Code Here

Examples of org.jboss.as.process.protocol.MessageHandler

            throw MESSAGES.nullVar("authCode");
        }
        if (messageHandler == null) {
            throw MESSAGES.nullVar("messageHandler");
        }
        configuration.setMessageHandler(new MessageHandler() {
            public void handleMessage(final Connection connection, final InputStream dataStream) throws IOException {
                final ProcessControllerClient client = (ProcessControllerClient) connection.getAttachment();
                final int cmd = readUnsignedByte(dataStream);
                switch (cmd) {
                    case Protocol.PROCESS_ADDED: {
View Full Code Here

Examples of org.jboss.as.protocol.MessageHandler

public abstract class ManagementHeaderMessageHandler extends AbstractMessageHandler {

    public void handle(Connection connection, InputStream dataStream) throws IOException {
        final int workingVersion;
        final ManagementRequestHeader requestHeader;
        final MessageHandler handler;
        ByteDataInput input = null;
        try {
            input = new SimpleByteDataInput(dataStream);

            // Start by reading the request header
View Full Code Here

Examples of org.jboss.as.protocol.old.MessageHandler

            throw new IllegalArgumentException("authCode is null");
        }
        if (messageHandler == null) {
            throw new IllegalArgumentException("messageHandler is null");
        }
        configuration.setMessageHandler(new MessageHandler() {
            public void handleMessage(final Connection connection, final InputStream dataStream) throws IOException {
                final ProcessControllerClient client = (ProcessControllerClient) connection.getAttachment();
                final int cmd = readUnsignedByte(dataStream);
                switch (cmd) {
                    case Protocol.PROCESS_ADDED: {
View Full Code Here

Examples of org.mokai.persist.jdbc.MessageHandler

*/
public class OutboundInboundHandlerTest {

  @Test
  public void testSaveOutboundMessage() throws Exception {
    MessageHandler outHandler = mockHandlerForSaveMessage();
    MessageHandler inHandler = mock(MessageHandler.class);

    Connection conn = mock(Connection.class);
    MessageHandler handler = createMessageHandler(outHandler, inHandler);

    Message message = new Message();
    message.setDirection(Direction.TO_CONNECTIONS);

    handler.insertMessage(conn, message);

    verify(outHandler).insertMessage(any(Connection.class), any(Message.class));
    verify(inHandler, never()).insertMessage(any(Connection.class), any(Message.class));
  }
View Full Code Here

Examples of org.projectodd.stilts.stomp.client.MessageHandler

        client.connect();

        final Set<String> outbound = new HashSet<String>();
        final CountDownLatch outboundLatch = new CountDownLatch(2);
        SubscriptionBuilder builder = client.subscribe(DESTINATION_QUEUE_ONE);
        builder.withMessageHandler(new MessageHandler() {
            public void handle(StompMessage message) {
                String content = message.getContentAsString();
                outbound.add(content);
                outboundLatch.countDown();
            }
View Full Code Here

Examples of org.projectodd.stilts.stomp.client.MessageHandler

        client.connect();

        final Set<String> outbound = new HashSet<String>();
        final CountDownLatch outboundLatch = new CountDownLatch(2);
        SubscriptionBuilder builder = client.subscribe(DESTINATION_QUEUE_ONE);
        builder.withMessageHandler(new MessageHandler() {
            public void handle(StompMessage message) {
                String content = message.getContentAsString();
                outbound.add(content);
                outboundLatch.countDown();
            }
View Full Code Here

Examples of org.springframework.integration.core.MessageHandler

        MessageChannel requestChannel = applicationContext.getBean("channelB", MessageChannel.class);
        Message message = new GenericMessage<Object>(MESSAGE_BODY);
        //Need to subscribe the responseChannel first
        DirectChannel responseChannel = (DirectChannel) applicationContext.getBean("channelC");
        responseChannel.subscribe(new MessageHandler() {
            public void handleMessage(Message<?> message) {
                String result = (String) message.getPayload();
                assertEquals("Get the wrong result", MESSAGE_BODY + " is processed",  result);               
            }           
        });
View Full Code Here

Examples of org.springframework.integration.core.MessageHandler

        MessageChannel requestChannel = applicationContext.getBean("channelD", MessageChannel.class);
        DirectChannel responseChannel = applicationContext.getBean("channelC", DirectChannel.class);
        Map<String, Object> headers = new HashMap<String, Object>();
        headers.put(MessageHeaders.REPLY_CHANNEL, responseChannel);
        GenericMessage<String> message = new GenericMessage<String>(MESSAGE_BODY, headers);
        responseChannel.subscribe(new MessageHandler() {
            public void handleMessage(Message<?> message) {
                String result = (String) message.getPayload();
                assertEquals("Get the wrong result", MESSAGE_BODY + " is processed",  result);               
            }           
        });
View Full Code Here

Examples of org.springframework.integration.core.MessageHandler

public class CamelSourceAdapterTest extends CamelSpringTestSupport {
    @Test
    public void testSendingOneWayMessage() throws Exception {
        DirectChannel channelA = applicationContext.getBean("channelA", DirectChannel.class);
        channelA.subscribe(new MessageHandler() {
            public void handleMessage(Message<?> message) {
                assertEquals("We should get the message from channelA", message.getPayload(), "Willem");            
            }           
        });
        template.sendBody("direct:OneWay", "Willem");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.