Package org.jgroups

Examples of org.jgroups.ChannelException


     *
     * @param cause the exceptional configuration condition to be used as the
     *              created <code>ChannelException</code>'s cause.
     */
    static ChannelException createChannelConfigurationException(Throwable cause) {
        return new ChannelException("unable to load the protocol stack", cause);
    }
View Full Code Here


            for(Tuple<Short,String> tuple: mapping) {
                short m=tuple.getVal1();
                try {
                    Class clazz=Util.loadClass(tuple.getVal2(), ClassConfigurator.class);
                    if(magicMap.containsKey(m))
                        throw new ChannelException("key " + m + " (" + clazz.getName() + ')' +
                                " is already in magic map; please make sure that all keys are unique");
                   
                    magicMap.put(m, clazz);
                    classMap.put(clazz, m);
                }
                catch(ClassNotFoundException cnf) {
                    throw new ChannelException("failed loading class", cnf);
                }
            }

            // Read jg-protocol-ids.xml
            mapping=readMappings(protocol_id_file);
            for(Tuple<Short,String> tuple: mapping) {
                short m=tuple.getVal1();
                try {
                    Class clazz=Util.loadClass(tuple.getVal2(), ClassConfigurator.class);
                    if(protocol_ids.containsKey(clazz))
                        throw new ChannelException("ID " + m + " (" + clazz.getName() + ')' +
                                " is already in protocol-ID map; please make sure that all protocol IDs are unique");
                    protocol_ids.put(clazz, m);
                    protocol_names.put(m, clazz);
                }
                catch(ClassNotFoundException cnf) {
                    throw new ChannelException("failed loading class", cnf);
                }
            }
        }
        catch(ChannelException ex) {
            throw ex;
        }
        catch(Throwable x) {
            throw new ChannelException("failed reading the magic number mapping file", x);
        }
    }
View Full Code Here

                    log.trace("Could not read " + name + " from the CLASSPATH, will try to read it from file");
                stream=new FileInputStream(name);
            }
        }
        catch(Exception x) {
            throw new ChannelException(name + " not found. Please make sure it is on the classpath", x);
        }
        return parse(stream);
    }
View Full Code Here

    * Always throws <code>ChannelException</code>; this method is not supported.
    */  
   @Override
   public Channel createChannel() throws ChannelException
   {
      throw new ChannelException("No-arg createChannel() is not supported");
   }
View Full Code Here

      {
         config = ProtocolStackUtil.getProtocolData(properties);
      }
      catch (Exception x)
      {
         throw new ChannelException("unable to load protocol stack", x);
      }

      JChannel channel = initializeChannel(config, null, false);

      try
      {
         registerChannel(channel, null, null, config);
      }
      catch (ChannelException ce)
      {
         throw ce;
      }
      catch (Exception e)
      {
         throw new ChannelException("unable to register channel", e);
      }

      return channel;
   }
View Full Code Here

   /**
    * Always throws <code>ChannelException</code>; this method is not supported.
    */  
   public Channel createChannel() throws ChannelException
   {
      throw new ChannelException("No-arg createChannel() is not supported");
   }
View Full Code Here

         ProtocolStackConfigurator c = ConfiguratorFactory.getStackConfigurator(properties);
         config = c;
      }
      catch (Exception x)
      {
         throw new ChannelException("unable to load protocol stack", x);
      }

      JChannel channel = initializeChannel(config, null, false);

      try
      {
         registerChannel(channel, null, null, ProtocolStackUtil.getProtocolData(config));
      }
      catch (ChannelException ce)
      {
         throw ce;
      }
      catch (Exception e)
      {
         throw new ChannelException("unable to register channel", e);
      }

      return channel;
   }
View Full Code Here

                    log.trace("Could not read " + mMagicNumberFile + " as Resource from the CLASSPATH, will try to read it from file.");
                stream=new FileInputStream(mMagicNumberFile);
            }
        }
        catch(Exception x) {
            throw new ChannelException(mMagicNumberFile + " not found. Please make sure it is on the classpath.", x);
        }
        return parse(stream);
    }
View Full Code Here

                for(int i=0; i < mapping.length; i++) {
                    m=new Short(mapping[i].getMagicNumber());
                    try {
                        Class clazz=mapping[i].getClassForMap();
                        if(magicMap.containsKey(m)) {
                            throw new ChannelException("magic key " + m + " (" + clazz.getName() + ')' +
                                                       " is already in map; please make sure that " +
                                                       "all magic keys are unique");
                        }
                        else {
                            magicMap.put(m, clazz);
                            classMap.put(clazz, m);
                        }
                    }
                    catch(ClassNotFoundException cnf) {
                        throw new ChannelException("failed loading class", cnf);
                    }
                }
                if(log.isDebugEnabled()) log.debug("mapping is:\n" + printMagicMap());
            }
        }
        catch(ChannelException ex) {
            throw ex;
        }
        catch(Throwable x) {
            throw new ChannelException("failed reading the magic number mapping file", x);
        }
    }
View Full Code Here

            for(Tuple<Short,String> tuple: mapping) {
                short m=tuple.getVal1();
                try {
                    Class clazz=Util.loadClass(tuple.getVal2(), ClassConfigurator.class);
                    if(magicMap.containsKey(m))
                        throw new ChannelException("key " + m + " (" + clazz.getName() + ')' +
                                " is already in magic map; please make sure that all keys are unique");
                   
                    magicMap.put(m, clazz);
                    classMap.put(clazz, m);
                }
                catch(ClassNotFoundException cnf) {
                    throw new ChannelException("failed loading class", cnf);
                }
            }

            // Read jg-protocol-ids.xml
            mapping=readMappings(protocol_id_file);
            for(Tuple<Short,String> tuple: mapping) {
                short m=tuple.getVal1();
                try {
                    Class clazz=Util.loadClass(tuple.getVal2(), ClassConfigurator.class);
                    if(protocol_ids.containsKey(clazz))
                        throw new ChannelException("ID " + m + " (" + clazz.getName() + ')' +
                                " is already in protocol-ID map; please make sure that all protocol IDs are unique");
                    protocol_ids.put(clazz, m);
                    protocol_names.put(m, clazz);
                }
                catch(ClassNotFoundException cnf) {
                    throw new ChannelException("failed loading class", cnf);
                }
            }
        }
        catch(ChannelException ex) {
            throw ex;
        }
        catch(Throwable x) {
            throw new ChannelException("failed reading the magic number mapping file", x);
        }
    }
View Full Code Here

TOP

Related Classes of org.jgroups.ChannelException

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.