Package org.jgroups.protocols

Examples of org.jgroups.protocols.TP$Bundler


        if(channel != null) {
            Vector tmp_mbrs=channel.getView() != null ? channel.getView().getMembers() : null;
            setMembers(tmp_mbrs);
            if(channel instanceof JChannel) {
                TP transport=((JChannel)channel).getProtocolStack().getTransport();
                corr.registerProbeHandler(transport);
            }
        }
    }
View Full Code Here


        if(corr != null) {
            corr.stop();
        }

        if(channel instanceof JChannel) {
            TP transport=((JChannel)channel).getProtocolStack().getTransport();
            corr.unregisterProbeHandler(transport);
        }

        // fixes leaks of MembershipListeners (http://jira.jboss.com/jira/browse/JGRP-160)
        if(adapter != null && handler != null) {
View Full Code Here

    public static void stopProtocolStack(List<Protocol> protocols, String cluster_name, final Map<String,Tuple<TP,Short>> singletons) {
        for(final Protocol prot: protocols) {
            if(prot instanceof TP) {
                String singleton_name=((TP)prot).getSingletonName();
                if(singleton_name != null && singleton_name.length() > 0) {
                    TP transport=(TP)prot;
                    final Map<String, Protocol> up_prots=transport.getUpProtocols();

                    synchronized(up_prots) {
                        up_prots.remove(cluster_name);
                    }
View Full Code Here

      assertTrue("no singleton_name in unshared2", cfg2.indexOf("singleton_name") < 0);
     
      channel1 = factory1.createChannel("unshared1");
      assertFalse(channel1 instanceof MuxChannel);
      channel1.connect("test");     
      TP tp1 = getTP((JChannel) channel1);
     
      channel2 = factory2.createChannel("unshared2");
      assertFalse(channel2 instanceof MuxChannel);
      channel2.connect("test");
      TP tp2 = getTP((JChannel) channel2);
     
      assertNotSame(tp1, tp2);
     
      channel3 = factory1.createMultiplexerChannel("unshared1", "test");
      assertFalse(channel3 instanceof MuxChannel);
      channel3.connect("test");
      TP tp3 = getTP((JChannel) channel3);
     
      assertNotSame(tp1, tp3);
      assertNotSame(tp2, tp3);
     
      channel4 = factory1.createMultiplexerChannel("unshared1", "test2");
      assertFalse(channel4 instanceof MuxChannel);
      channel4.connect("test2");
      TP tp4 = getTP((JChannel) channel4);
     
      assertSame(tp3, tp4);
   }
View Full Code Here

   {
      log.info("+++ testThreadPoolConfig()");     
     
      channel1 = factory1.createChannel("queues");
      channel1.connect("test");
      TP tp1 = getTP((JChannel) channel1);
     
      assertEquals(3000, tp1.getIncomingKeepAliveTime());
      assertEquals(22, tp1.getIncomingMaxPoolSize());
      assertEquals(2, tp1.getIncomingMinPoolSize());
      assertEquals(750, tp1.getIncomingMaxQueueSize());
      assertEquals(4000, tp1.getOOBKeepAliveTime());
      assertEquals(12, tp1.getOOBMaxPoolSize());
      assertEquals(3, tp1.getOOBMinPoolSize());
      assertEquals(75, tp1.getOOBMaxQueueSize());
     
      Executor exec = tp1.getDefaultThreadPool();
      assertNotNull(exec);
     
      exec = tp1.getOOBThreadPool();
      assertNotNull(exec);
     
      // Confirm that the no-pool config doesn't create a pool
      channel2 = factory1.createChannel("nonconcurrent1");
      channel2.connect("test");
      TP tp2 = getTP((JChannel) channel2);
     
      assertFalse(tp2.getDefaultThreadPool() instanceof ThreadPoolExecutor);
      assertFalse(tp2.getOOBThreadPool() instanceof ThreadPoolExecutor);
   }
View Full Code Here

        /*create a temporary view, assume this channel is the only member and is the coordinator*/
        Vector<Address> t=new Vector<Address>(1);
        t.addElement(local_addr);
        my_view=new View(local_addr, 0, t)// create a dummy view

        TP transport=prot_stack.getTransport();
        transport.registerProbeHandler(probe_handler);
    }
View Full Code Here

            catch(Exception e) {
                if(log.isErrorEnabled())
                    log.error("failed destroying the protocol stack", e);
            }

            TP transport=prot_stack.getTransport();
            if(transport != null)
                transport.unregisterProbeHandler(probe_handler);
        }
    }
View Full Code Here

    }

    private static void disableBundling(JChannel ch) {
        System.out.println("Disabling message bundling (as this would increase latency)");
        ProtocolStack stack=ch.getProtocolStack();
        TP transport=stack.getTransport();
        transport.setEnableBundling(false);
    }
View Full Code Here

    /**
     * @deprecated Use {@link org.jgroups.stack.Protocol#getThreadFactory()}  instead
     * @return
     */
    public ThreadFactory getThreadFactory() {
        TP transport=getTransport();
        return transport != null? transport.getThreadFactory() : null;
    }
View Full Code Here

    /**
     * @deprecated Use {@link org.jgroups.protocols.TP#getTimer()} to fetch the timer and call getCorePoolSize() directly
     * @return
     */
    public int getTimerThreads() {
        TP transport=getTransport();
        TimeScheduler timer;
        if(transport != null) {
            timer=transport.getTimer();
            if(timer != null)
                return timer.getMinThreads();
        }
        return -1;
    }
View Full Code Here

TOP

Related Classes of org.jgroups.protocols.TP$Bundler

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.