Package org.jgroups.stack

Examples of org.jgroups.stack.ProtocolStack


            cluster_name = "null";

        cluster_name=ObjectName.quote(cluster_name);

        if (register_protocols) {
            ProtocolStack stack = channel.getProtocolStack();
            List<Protocol> protocols = stack.getProtocols();
            for (Protocol p : protocols) {
                if (p.getClass().isAnnotationPresent(MBean.class)) {
                    String jmx_name=getProtocolRegistrationName(cluster_name,domain,p);
                    register(p, server, jmx_name);
                }
View Full Code Here


                    throws Exception {

        if(clusterName != null)
            clusterName=ObjectName.quote(clusterName);

        ProtocolStack stack = c.getProtocolStack();
        List<Protocol> protocols = stack.getProtocols();
        for (Protocol p : protocols) {
            if (p.getClass().isAnnotationPresent(MBean.class)) {
                try {
                    unregister(p, server, getProtocolRegistrationName(clusterName, domain, p));
                } catch (MBeanRegistrationException e) {
View Full Code Here


    private void handleDiagnosticProbe(SocketAddress sender, DatagramSocket sock, String request) {
        if(singleton_name != null && singleton_name.length() > 0) {
            for(Protocol prot: up_prots.values()) {
                ProtocolStack st=prot.getProtocolStack();
                handleDiagnosticProbe(sender, sock, request, st);
            }
        }
        else {
            handleDiagnosticProbe(sender, sock, request, stack);
View Full Code Here

                Channel channel = factory.createChannel(UUID.randomUUID().toString());
                try {
                    // ProtocolStack.printProtocolSpecAsXML() is very hacky and only works on an uninitialized stack
                    List<Protocol> protocols = channel.getProtocolStack().getProtocols();
                    Collections.reverse(protocols);
                    ProtocolStack stack = new ProtocolStack();
                    stack.addProtocols(protocols);
                    context.getResult().set(stack.printProtocolSpecAsXML());
                    context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER);
                } finally {
                    channel.close();
                }
            } finally {
View Full Code Here

        if(log.isInfoEnabled())
            log.info("JGroups version: " + Version.description);
        // ConfiguratorFactory.substituteVariables(configurator); // replace vars with system props
        props=configurator.getProtocolStackString();
        props=Util.substituteVariable(props);
        prot_stack=new ProtocolStack(this, props);
        try {
            prot_stack.setup(); // Setup protocol stack (creates protocol, calls init() on them)
        }
        catch(Throwable e) {
            throw new ChannelException("unable to setup the protocol stack: " + e.getMessage(), e);
View Full Code Here

        System.out.println(">>> sent message at " + new Date());
        Util.sleep(5000);
    }

    private void setLoopback(JChannel ch, boolean b) {
        ProtocolStack stack=ch.getProtocolStack();
        Vector<Protocol> prots=stack.getProtocols();
        TP transport=(TP)prots.lastElement();
        transport.setLoopback(b);
    }
View Full Code Here

        transport.setLoopback(b);
    }


    private void setBundling(JChannel ch, boolean enabled, int max_bytes, long timeout) {
        ProtocolStack stack=ch.getProtocolStack();
        Vector<Protocol> prots=stack.getProtocols();
        TP transport=(TP)prots.lastElement();
        transport.setEnableBundling(enabled);
        transport.setMaxBundleSize(max_bytes);
        transport.setMaxBundleTimeout(timeout);
        transport.setEnable_unicast_bundling(false);
        if(enabled) {
            GMS gms=(GMS)stack.findProtocol("GMS");
            gms.setViewAckCollectionTimeout(LATENCY * 2);
            gms.setJoinTimeout(LATENCY * 2);
        }
    }
View Full Code Here

    }


    public void testLastMessageDropped() throws Exception {
        DISCARD discard=new DISCARD();
        ProtocolStack stack=c1.getProtocolStack();
        stack.insertProtocol(discard, ProtocolStack.BELOW, NAKACK.class);
        c1.setOpt(Channel.LOCAL, false);

        Message m1=new Message(null, null, 1);
        Message m2=new Message(null, null, 2);
        Message m3=new Message(null, null, 3);
View Full Code Here

    }


    private static void modifyStack(JChannel ... channels) {
        for(JChannel ch: channels) {
            ProtocolStack stack=ch.getProtocolStack();
            STABLE stable=(STABLE)stack.findProtocol(STABLE.class);
            if(stable == null)
                throw new IllegalStateException("STABLE protocol was not found");
            stable.setDesiredAverageGossip(2000);
        }
    }
View Full Code Here

        }
    }
   
   
    private static void addDiscardProtocol(JChannel ch) throws Exception {
        ProtocolStack stack=ch.getProtocolStack();
        Protocol transport=stack.getTransport();
        DISCARD discard=new DISCARD();
        discard.setProtocolStack(ch.getProtocolStack());
        discard.start();
        stack.insertProtocol(discard, ProtocolStack.ABOVE, transport.getName());
    }
View Full Code Here

TOP

Related Classes of org.jgroups.stack.ProtocolStack

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.