Package org.apache.catalina.tribes

Examples of org.apache.catalina.tribes.ManagedChannel


public class MembersWithProperties implements MembershipListener{
    static Thread main;

    public MembersWithProperties(Channel channel, Properties props) throws IOException {
        channel.addMembershipListener(this);
        ManagedChannel mchannel = (ManagedChannel)channel;
        mchannel.getMembershipService().setPayload(getPayload(props));
    }
View Full Code Here


    @SuppressWarnings("unused")
    public static void main(String[] args) throws Exception {
        if (args.length==0) usage();
        main = Thread.currentThread();
        ManagedChannel channel = (ManagedChannel) ChannelCreator.createChannel(args);
        Properties props = new Properties();
        props.setProperty("mydomainkey","mydomainvalue");
        props.setProperty("someotherkey", Arrays.toString(UUIDGenerator.randomUUID(true)));
        new MembersWithProperties(channel, props);
        channel.start(Channel.DEFAULT);
        Runtime.getRuntime().addShutdownHook(new Shutdown(channel));
        try {
            Thread.sleep(Long.MAX_VALUE);
        }catch(InterruptedException ix) {
            Thread.sleep(5000);//allow everything to shutdown
View Full Code Here

                           ChannelCreator.usage());
    }

    public static void main(String[] args) throws Exception {
        long start = System.currentTimeMillis();
        ManagedChannel channel = (ManagedChannel) ChannelCreator.createChannel(args);
        String mapName = "MapDemo";
        if ( args.length > 0 && (!args[args.length-1].startsWith("-"))) {
            mapName = args[args.length-1];
        }
        channel.start(channel.DEFAULT);
        Runtime.getRuntime().addShutdownHook(new Shutdown(channel));
        MapDemo demo = new MapDemo(channel,mapName);
       
        System.out.println("System test complete, time to start="+(System.currentTimeMillis()-start)+" ms. Sleeping to let threads finish.");
        Thread.sleep(60 * 1000 * 60);
 
View Full Code Here

     */
    @SuppressWarnings("unused")
    public static void main(String[] args) throws Exception {
        long start = System.currentTimeMillis();
        //create a channel object
        ManagedChannel channel = (ManagedChannel) ChannelCreator.createChannel(args);
        //define a map name, unless one is defined as a paramters
        String mapName = "MapDemo";
        if ( args.length > 0 && (!args[args.length-1].startsWith("-"))) {
            mapName = args[args.length-1];
        }
        //start the channel
        channel.start(Channel.DEFAULT);
        //listen for shutdown
        Runtime.getRuntime().addShutdownHook(new Shutdown(channel));
        //create a map demo object
        new MapDemo(channel,mapName);

View Full Code Here

        if (mbind != null) service.setMcastBindAddress(mbind);
        service.setMcastFrequency(mcastfreq);
        service.setMcastDropTime(mcastdrop);
        service.setMcastPort(mcastport);

        ManagedChannel channel = new GroupChannel();
        channel.setChannelReceiver(rl);
        channel.setChannelSender(ps);
        channel.setMembershipService(service);

        if (gzip) channel.addInterceptor(new GzipInterceptor());
        if ( frag ) {
            FragmentationInterceptor fi = new FragmentationInterceptor();
            fi.setMaxSize(fragsize);
            channel.addInterceptor(fi);
        }
        if (order) {
            OrderInterceptor oi = new OrderInterceptor();
            oi.setMaxQueue(ordersize);
            channel.addInterceptor(oi);
        }
        return channel;
       
    }
View Full Code Here

                System.exit(1);
            }
        }
       
       
        ManagedChannel channel = (ManagedChannel)ChannelCreator.createChannel(args);
       
        LoadTest test = new LoadTest(channel,send,count,debug,pause,stats,breakOnEx);
        LoadMessage msg = new LoadMessage();
       
        messageSize = LoadMessage.getMessageSize(msg);
        channel.setChannelListener(test);
        channel.setMembershipListener(test);
        channel.start(channel.DEFAULT);
        Runtime.getRuntime().addShutdownHook(new Shutdown(channel));
        while ( threads > 1 ) {
            Thread t = new Thread(test);
            t.setDaemon(true);
            t.start();
View Full Code Here

            StoreDescription parentDesc) throws Exception {
        if (aCluster instanceof CatalinaCluster) {
            CatalinaCluster cluster = (CatalinaCluster) aCluster;
           
            //store nested <Group> element
            ManagedChannel channel = (ManagedChannel)cluster.getChannel();
            if (channel != null ) {
                storeElement(aWriter, indent, channel);

                // Store nested <Membership> element
                MembershipService service = channel.getMembershipService();
                if (service != null) {
                    storeElement(aWriter, indent, service);
                }
                // Store nested <Sender> element
                ChannelSender sender = channel.getChannelSender();
                if (sender != null) {
                    storeElement(aWriter, indent, sender);
                }
                // Store nested <Receiver> element
                ChannelReceiver receiver = channel.getChannelReceiver();
                if (receiver != null) {
                    storeElement(aWriter, indent, receiver);
                }
               
                Iterator inti = channel.getInterceptors();
                while ( inti.hasNext() ) {
                    storeElement(aWriter,indent,inti.next());
                }
            }
            // Store nested <Deployer> element
View Full Code Here

                usage();
                System.exit(1);
            }
        }
       
        ManagedChannel channel = (ManagedChannel)ChannelCreator.createChannel(args);
       
        LoadTest test = new LoadTest(channel,send,count,debug,pause,stats,breakOnEx);
        test.channelOptions = channelOptions;
        LoadMessage msg = new LoadMessage();
       
        messageSize = LoadMessage.getMessageSize(msg);
        channel.addChannelListener(test);
        channel.addMembershipListener(test);
        channel.start(startoptions);
        Runtime.getRuntime().addShutdownHook(new Shutdown(channel));
        while ( threads > 1 ) {
            Thread t = new Thread(test);
            t.setDaemon(true);
            t.start();
            threads--;
            test = new LoadTest(channel,send,count,debug,pause,stats,breakOnEx);
            test.channelOptions = channelOptions;
        }
        test.run();
        if ( shutdown && send ) channel.stop(channel.DEFAULT);
        System.out.println("System test complete, sleeping to let threads finish.");
        Thread.sleep(60*1000*60);
    }
View Full Code Here

                           ChannelCreator.usage());
    }

    public static void main(String[] args) throws Exception {
        long start = System.currentTimeMillis();
        ManagedChannel channel = (ManagedChannel) ChannelCreator.createChannel(args);
        String mapName = "MapDemo";
        if ( args.length > 0 && (!args[args.length-1].startsWith("-"))) {
            mapName = args[args.length-1];
        }
        channel.start(channel.DEFAULT);
        Runtime.getRuntime().addShutdownHook(new Shutdown(channel));
        MapDemo demo = new MapDemo(channel,mapName);
       
        System.out.println("System test complete, time to start="+(System.currentTimeMillis()-start)+" ms. Sleeping to let threads finish.");
        Thread.sleep(60 * 1000 * 60);
 
View Full Code Here

    static Thread main;

    public MembersWithProperties(Channel channel, Properties props) throws IOException {
        this.channel = channel;
        channel.addMembershipListener(this);
        ManagedChannel mchannel = (ManagedChannel)channel;
        mchannel.getMembershipService().setPayload(getPayload(props));
    }
View Full Code Here

TOP

Related Classes of org.apache.catalina.tribes.ManagedChannel

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.