1 Reply Latest reply on May 25, 2012 9:02 AM by Martin Gencur

    How do I override ·"defaultTransport" programmatically?

    David Sancho Newbie

      HI there,

       

      I am using infinispan 5.1.2.Final and I have created a producer to override default embedded cache manager:

       

       

          /**
           * Overrides the default embedded cache manager.
           */
          @Produces
          @ApplicationScoped
          public EmbeddedCacheManager defaultCacheManager() {
             return new DefaultCacheManager(
                   new GlobalConfigurationBuilder().transport().clusterName(CLUSTER_NAME).defaultTransport().build());
          }
      
      

       

      Now, I want to use a different UDP transport for my cluster setting it programmatically instead of using a jgroups config file. So my question is, how can I  get rid of "defaultTransport"?

       

      Thanks in advance!

       

      Sancheski

        • 1. Re: How do I override ·"defaultTransport" programmatically?
          Martin Gencur Novice

          By new GlobalConfigurationBuilder().transport().transport(new YourOwnTransportImpl()).build()    ;-)

           

          The transport impl must implement org.infinispan.remoting.transport.Transport

           

          NOTE: Currently Infinispan will not use the object instance, but instead instantiate a new

          instance of the class. Therefore, do not expect any state to survive, and provide a no-args

          constructor to any instance. This will be resolved in Infinispan 5.2.0