Package org.jgroups.stack

Examples of org.jgroups.stack.ProtocolStack


    public static void unregisterChannel(org.jgroups.JChannel c,
                                         MBeanServer server,
                                         String clusterName) throws Exception {

        ProtocolStack stack=c.getProtocolStack();
        Vector<Protocol> protocols=stack.getProtocols();
        for(Protocol p:protocols) {
            if(p.getClass().isAnnotationPresent(MBean.class)) {
                try {
                    unregister(p,
                               ManagementFactory.getPlatformMBeanServer(),
View Full Code Here


     * Returns a pretty-printed form of all the protocols. If include_properties
     * is set, the properties for each protocol will also be printed.
     */
    @ManagedOperation
    public String printProtocolSpec(boolean include_properties) {
        ProtocolStack ps=getProtocolStack();
        return ps != null? ps.printProtocolSpec(include_properties) : null;
    }
View Full Code Here

            mq.reset();

            String props=getProperties();

            // new stack is created on open() - bela June 12 2003
            prot_stack=new ProtocolStack(this, props);
            prot_stack.setup();
            closed=false;
        }
        catch(Exception e) {
            throw new ChannelException("failed to open channel" , e);
View Full Code Here

       
        // ConfiguratorFactory.substituteVariables(configurator); // replace vars with system props
        String tmp=configurator.getProtocolStackString();
        tmp=Util.substituteVariable(tmp); // replace vars with system props

        prot_stack=new ProtocolStack(this, tmp);
        try {
            prot_stack.setup(); // Setup protocol stack (creates protocol, calls init() on them)
            properties=tmp;
        }
        catch(Throwable e) {
View Full Code Here

    protected final void init(JChannel ch) throws ChannelException {
        if(ch == null)
            throw new IllegalArgumentException("channel is null");
        if(log.isInfoEnabled())
            log.info("JGroups version: " + Version.description);
        prot_stack=new ProtocolStack(this, null);
        try {
            prot_stack.setup(ch.getProtocolStack()); // Setup protocol stack (creates protocol, calls init() on them)
            getProperties();
        }
        catch(Throwable e) {
View Full Code Here

   }


   public boolean isSupportStateTransfer() {
      // tests whether state transfer is supported.  We *need* STREAMING_STATE_TRANSFER.
      ProtocolStack stack;
      if (channel != null && (stack = channel.getProtocolStack()) != null) {
         if (stack.findProtocol(STREAMING_STATE_TRANSFER.class) == null) {
            log.streamingStateTransferNotPresent();
            return false;
         }
      } else {
         log.channelNotSetUp();
View Full Code Here

      }
      //bundling is not good for sync caches
      Configuration.CacheMode cacheMode = configuration.getCacheMode();
      if (!cacheMode.equals(Configuration.CacheMode.LOCAL) && configuration.getCacheMode().isSynchronous())
      {
         ProtocolStack stack = ((JChannel) channel).getProtocolStack();
         TP transport = stack.getTransport();
         if (transport.isEnableBundling() && log.isWarnEnabled())
         {
            log.warn("You have enabled jgroups's message bundling, which is not recommended for sync replication. If there is no particular " +
                  "reason for this we strongly recommend to disable message bundling in JGroups config (enable_bundling=\"false\").");
         }
      }
      //bundling is good for async caches
      if (!cacheMode.isSynchronous())
      {
         ProtocolStack stack = ((JChannel) channel).getProtocolStack();
         TP transport = stack.getTransport();
         if (!transport.isEnableBundling() && log.isWarnEnabled())
         {
            log.warn("You have disabled jgroups's message bundling, which is not recommended for async replication. If there is no particular " +
                  "reason for this we strongly recommend to enable message bundling in JGroups config (enable_bundling=\"true\").");
         }
View Full Code Here

   }


   public boolean isSupportStateTransfer() {
      // tests whether state transfer is supported.  We *need* STREAMING_STATE_TRANSFER.
      ProtocolStack stack;
      if (channel != null && (stack = channel.getProtocolStack()) != null) {
         if (stack.findProtocol(STREAMING_STATE_TRANSFER.class) == null) {
            log.error("Channel does not contain STREAMING_STATE_TRANSFER.  Cannot support state transfers!");
            return false;
         }
      } else {
         log.warn("Channel not set up properly!");
View Full Code Here

         return;
      }
     
      JChannel jchannel = (JChannel) channel;
     
      ProtocolStack stack = jchannel.getProtocolStack();
      List<Protocol> protocols = stack.getProtocols();
      TP tp = null;
      for (int i = protocols.size() - 1; i >= 0; i--)
      {
         if (protocols.get(i) instanceof TP)
         {
View Full Code Here

         getServer().registerMBean(conf.asDynamicMBean(ch), channelName);
         allNames.add(channelName);
         if (isExposeProtocols())
         {
            String baseName = getDomain() + ":type=protocol,cluster=" + channelId;
            ProtocolStack stack=ch.getProtocolStack();
            List<Protocol> protocols=stack.getProtocols();
           
            for(Protocol prot : protocols)
            {                               
                ObjectName prot_name=new ObjectName(baseName + ",protocol=" + prot.getName());
                server.registerMBean(conf.asDynamicMBean(prot), prot_name);
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.