Examples of MessageDispatcher


Examples of org.jgroups.blocks.MessageDispatcher

     
//      Thread.currentThread().setContextClassLoader(testLoader);   
//      try
//      {
         channel1 = (Channel) factoryMeth.invoke(factory1, factory1Args);
         dispatchers[0] = new MessageDispatcher(channel1, handler, handler, handler);
        
         channel1.connect("leaktest");
         assertEquals("No classloader leak on channel1 connect", null, handler.getLeakedClassLoader());
        
         channel2 = (Channel) factoryMeth.invoke(factory2, factory2Args);
         dispatchers[1] = new MessageDispatcher(channel2, handler, handler, handler);
        
         channel2.connect("leaktest");
         assertEquals("No classloader leak on channel2 connect", null, handler.getLeakedClassLoader());
//      }
//      finally
//      {
//         Thread.currentThread().setContextClassLoader(ours);
//      }
     
      log.info("Channels connected");
     
      ClassLoaderLeakRunner[] runners = new ClassLoaderLeakRunner[numThreads];     
     
      for (int i = 0; i < runners.length; i++)
      {
         MessageDispatcher disp = dispatchers[i % 2];
           
         runners[i] = new ClassLoaderLeakRunner(disp, numLoops, runnerGroup, semaphore);        
      }

      semaphore.acquire(numThreads);
View Full Code Here

Examples of org.jgroups.blocks.MessageDispatcher

    }

    public void start() throws Exception {
        channel=new JChannel(props);
       //  channel.setOpt(Channel.LOCAL, Boolean.FALSE); // do not receive my own messages
        disp=new MessageDispatcher(channel, null, this, this, false);
        channel.connect("MessageDispatcherSpeedTestGroup");

        try {
            if(server) {
                System.out.println("-- Started as server. Press ctrl-c to kill");
View Full Code Here

Examples of org.jgroups.blocks.MessageDispatcher

    public ChannelCommandDispatcherFactory(ChannelCommandDispatcherFactoryConfiguration config) {
        this.nodeFactory = config.getNodeFactory();
        this.marshallingContext = config.getMarshallingContext();
        this.timeout = config.getTimeout();
        final RpcDispatcher.Marshaller marshaller = new CommandResponseMarshaller(this.marshallingContext);
        this.dispatcher = new MessageDispatcher() {
            @Override
            protected RequestCorrelator createRequestCorrelator(Protocol transport, RequestHandler handler, Address localAddr) {
                RequestCorrelator correlator = super.createRequestCorrelator(transport, handler, localAddr);
                correlator.setMarshaller(marshaller);
                return correlator;
View Full Code Here

Examples of org.mule.api.transport.MessageDispatcher

    }

    public Object makeObject(Object key) throws Exception
    {
        OutboundEndpoint endpoint = (OutboundEndpoint) key;
        MessageDispatcher dispatcher = factory.create(endpoint);
        applyLifecycle(dispatcher);
        return dispatcher;
    }
View Full Code Here

Examples of org.mule.api.transport.MessageDispatcher

    public void testDispatcherFullLifecycle() throws Exception
    {
        OutboundEndpoint out = getTestOutboundEndpoint("out", "test://out", null, null, null, connector);

        MessageDispatcher dispatcher = connector.getDispatcherFactory().create(out);
        dispatcher.initialise();
       
        assertTrue(dispatcher.getLifecycleState().isInitialised());
        dispatcher.connect();
        assertTrue(dispatcher.isConnected());

        dispatcher.start();
        assertTrue(dispatcher.getLifecycleState().isStarted());

        dispatcher.stop();
        assertTrue(dispatcher.getLifecycleState().isStopped());

        dispatcher.disconnect();
        assertFalse(dispatcher.isConnected());

        dispatcher.dispose();
        assertTrue(dispatcher.getLifecycleState().isDisposed());

    }
View Full Code Here

Examples of org.mule.api.transport.MessageDispatcher

        {
            throw new IllegalArgumentException(CoreMessages.connectorSchemeIncompatibleWithEndpointScheme(
                    this.getProtocol(), endpoint.getEndpointURI().toString()).getMessage());
        }

        MessageDispatcher dispatcher = null;
        try
        {
            if (logger.isDebugEnabled())
            {
                logger.debug("Borrowing a dispatcher for endpoint: " + endpoint.getEndpointURI());
            }

            dispatcher = (MessageDispatcher) dispatchers.borrowObject(endpoint);

            if (logger.isDebugEnabled())
            {
                logger.debug("Borrowed a dispatcher for endpoint: " + endpoint.getEndpointURI() + " = "
                        + dispatcher.toString());
            }

            return dispatcher;
        }
        catch (Exception ex)
View Full Code Here

Examples of org.mule.api.transport.MessageDispatcher

           this.endpoint = endpoint;
        }
       
        public MuleEvent process(MuleEvent event) throws MuleException
        {
            MessageDispatcher dispatcher = null;
            try
            {
                dispatcher = getDispatcher(endpoint);
                MuleEvent result = dispatcher.process(event);
                // We need to invoke notification message processor with request
                // message only after successful send/dispatch
                if (notificationMessageProcessor == null)
                {
                    notificationMessageProcessor = new OutboundNotificationMessageProcessor(endpoint);
View Full Code Here

Examples of org.mule.api.transport.MessageDispatcher

        {
            public void run()
            {
                try
                {
                    MessageDispatcher messageDispatcher = (MessageDispatcher) connector.dispatchers.borrowObject(endpoint);
                    Thread.sleep(50);
                    connector.dispatchers.returnObject(endpoint, messageDispatcher);
                }
                catch (Exception e)
                {
View Full Code Here

Examples of org.mule.api.transport.MessageDispatcher

        {
            public void run()
            {
                try
                {
                    MessageDispatcher messageDispatcher = (MessageDispatcher) connector.dispatchers.borrowObject(endpoint);
                    Thread.sleep(200);
                    connector.dispatchers.returnObject(endpoint, messageDispatcher);
                }
                catch (Exception e)
                {
View Full Code Here

Examples of org.snmp4j.MessageDispatcher

      public MOInput createMOInput() {
        return new PropertyMOInput(props, TestMasterAgent.this);
      }
    };
    */
    MessageDispatcher messageDispatcher = new MessageDispatcherImpl();
    addListenAddresses(messageDispatcher, (List)args.get("address"));
    agent =
        new AgentXMasterAgent(new OctetString(MPv3.createLocalEngineID()),
                              messageDispatcher,
                              null,
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.