private static ProtocolStackConfigurator loadUdp() {
   try {
     return ConfiguratorFactory.getStackConfigurator("stacks/udp.xml");
   } catch (Exception e) {
     throw new RuntimeException(e);
   }
 }
Exemplo n.º 2
0
 /**
  * Creates a JChannel without a protocol stack; used for programmatic creation of channel and
  * protocol stack
  *
  * @param create_protocol_stack If true, the default configuration will be used. If false, no
  *     protocol stack will be created
  */
 public JChannel(boolean create_protocol_stack) {
   if (create_protocol_stack) {
     try {
       init(ConfiguratorFactory.getStackConfigurator(DEFAULT_PROTOCOL_STACK));
     } catch (Exception e) {
       throw new RuntimeException(e);
     }
   }
 }
Exemplo n.º 3
0
 @ManagedOperation(
     description =
         "Reads logical-physical address mappings and logical name mappings from a "
             + "file (or URL) and adds them to the local caches")
 public void addToCache(String filename) throws Exception {
   InputStream in = ConfiguratorFactory.getConfigStream(filename);
   List<PingData> list = read(in);
   if (list != null)
     for (PingData data : list)
       addDiscoveryResponseToCaches(
           data.getAddress(), data.getLogicalName(), data.getPhysicalAddr());
 }
Exemplo n.º 4
0
 /**
  * Creates a channel with a configuration based on an input stream.
  *
  * @param input An input stream, pointing to a streamed configuration
  * @throws Exception
  */
 public JChannel(InputStream input) throws Exception {
   this(ConfiguratorFactory.getStackConfigurator(input));
 }
Exemplo n.º 5
0
 /**
  * Constructs a JChannel instance with the protocol stack configuration based upon the specified
  * properties parameter.
  *
  * @param props A file containing a JGroups XML configuration, a URL pointing to an XML
  *     configuration, or an old style plain configuration string.
  * @throws Exception If problems occur during the configuration or initialization of the protocol
  *     stack.
  */
 public JChannel(String props) throws Exception {
   this(ConfiguratorFactory.getStackConfigurator(props));
 }
Exemplo n.º 6
0
 /**
  * Constructs a JChannel instance with the protocol stack configuration indicated by the specified
  * URL.
  *
  * @param properties A URL pointing to a JGroups XML protocol stack configuration.
  * @throws Exception If problems occur during the configuration or initialization of the protocol
  *     stack.
  */
 public JChannel(URL properties) throws Exception {
   this(ConfiguratorFactory.getStackConfigurator(properties));
 }