Package org.infinispan.marshall

Examples of org.infinispan.marshall.Marshallable


      for (Map.Entry<String, String> entry : JDK_EXTERNALIZERS.entrySet()) {
         try {
            Class clazz = Util.loadClassStrict(entry.getKey());
            Externalizer ext = null;
            ext = (Externalizer) Util.getInstanceStrict(entry.getValue());
            Marshallable marshallable = ReflectionUtil.getAnnotation(ext.getClass(), Marshallable.class);
            int id = marshallable.id();
            ids.add(id);
            ExternalizerAdapter adapter = new ExternalizerAdapter(id, ext);
            writers.put(clazz, adapter);
            readers.put(id, adapter);
         } catch (Exception e) {
            if (log.isDebugEnabled()) {
               log.debug("Unable to load class {0}", e.getMessage());
            }
         }
      }

      for (String marshallableClass : MARSHALLABLES) {
         try {
            Class clazz = Util.loadClassStrict(marshallableClass);
            Marshallable marshallable = ReflectionUtil.getAnnotation(clazz, Marshallable.class);
            if (marshallable != null && !marshallable.externalizer().equals(Externalizer.class)) {
               int id = marshallable.id();
               Externalizer ext = null;
               ext = Util.getInstance(marshallable.externalizer());
               if (!ids.add(id))
                  throw new CacheException("Duplicate id found! id=" + id + " in " + ext.getClass().getName() + " is shared by another marshallable class.");
               if (ext instanceof ReplicableCommandExternalizer) {
                  ((ReplicableCommandExternalizer) ext).inject(cmdFactory);
               }
View Full Code Here


            try {
               ext = (Externalizer) Util.getInstance(entry.getValue());
            } catch (Exception e) {
               throw new CacheException("Could not instantiate entry: " + entry, e);
            }
            Marshallable marshallable = ReflectionUtil.getAnnotation(ext.getClass(), Marshallable.class);
            int id = marshallable.id();
            ids.add(id);
            ExternalizerAdapter adapter = new ExternalizerAdapter(id, ext);
            writers.put(clazz, adapter);
            readers.put(id, adapter);
         } catch (ClassNotFoundException e) {
            if (log.isDebugEnabled())
               log.debug("Unable to load class {0}", e.getMessage());
         }
      }

      for (String marshallableClass : MARSHALLABLES) {
         try {
            Class clazz = Util.loadClass(marshallableClass);
            Marshallable marshallable = ReflectionUtil.getAnnotation(clazz, Marshallable.class);
            if (marshallable != null && !marshallable.externalizer().equals(Externalizer.class)) {
               int id = marshallable.id();
               Externalizer ext = null;
               try {
                  ext = Util.getInstance(marshallable.externalizer());
               } catch (Exception e) {
                  throw new CacheException("Could not instantiate the externalizer: " + marshallable.externalizer(), e);
               }
               if (!ids.add(id))
                  throw new CacheException("Duplicate id found! id=" + id + " in " + ext.getClass().getName() + " is shared by another marshallable class.");
               if (ext instanceof ReplicableCommandExternalizer) {
                  ((ReplicableCommandExternalizer) ext).inject(cmdFactory);
View Full Code Here

      for (Map.Entry<String, String> entry : JDK_EXTERNALIZERS.entrySet()) {
         try {
            Class clazz = Util.loadClassStrict(entry.getKey());
            Externalizer ext = null;
            ext = (Externalizer) Util.getInstanceStrict(entry.getValue());
            Marshallable marshallable = ReflectionUtil.getAnnotation(ext.getClass(), Marshallable.class);
            int id = marshallable.id();
            ids.add(id);
            ExternalizerAdapter adapter = new ExternalizerAdapter(id, ext);
            writers.put(clazz, adapter);
            readers.put(id, adapter);
         } catch (Exception e) {
            if (log.isDebugEnabled()) {
               log.debug("Unable to load class {0}", e.getMessage());
            }
         }
      }

      for (String marshallableClass : MARSHALLABLES) {
         try {
            Class clazz = Util.loadClassStrict(marshallableClass);
            Marshallable marshallable = ReflectionUtil.getAnnotation(clazz, Marshallable.class);
            if (marshallable != null && !marshallable.externalizer().equals(Externalizer.class)) {
               int id = marshallable.id();
               Externalizer ext = null;
               ext = Util.getInstance(marshallable.externalizer());
               if (!ids.add(id))
                  throw new CacheException("Duplicate id found! id=" + id + " in " + ext.getClass().getName() + " is shared by another marshallable class.");
               if (ext instanceof ReplicableCommandExternalizer) {
                  ((ReplicableCommandExternalizer) ext).inject(cmdFactory);
               }
View Full Code Here

      for (Map.Entry<String, String> entry : JDK_EXTERNALIZERS.entrySet()) {
         try {
            Class clazz = Util.loadClassStrict(entry.getKey());
            Externalizer ext = null;
            ext = (Externalizer) Util.getInstanceStrict(entry.getValue());
            Marshallable marshallable = ReflectionUtil.getAnnotation(ext.getClass(), Marshallable.class);
            int id = marshallable.id();
            ids.add(id);
            ExternalizerAdapter adapter = new ExternalizerAdapter(id, ext);
            writers.put(clazz, adapter);
            readers.put(id, adapter);
         } catch (Exception e) {
            if (log.isDebugEnabled()) {
               log.debug("Unable to load class {0}", e.getMessage());
            }
         }
      }

      for (String marshallableClass : MARSHALLABLES) {
         try {
            Class clazz = Util.loadClassStrict(marshallableClass);
            Marshallable marshallable = ReflectionUtil.getAnnotation(clazz, Marshallable.class);
            if (marshallable != null && !marshallable.externalizer().equals(Externalizer.class)) {
               int id = marshallable.id();
               Externalizer ext = null;
               ext = Util.getInstance(marshallable.externalizer());
               if (!ids.add(id))
                  throw new CacheException("Duplicate id found! id=" + id + " in " + ext.getClass().getName() + " is shared by another marshallable class.");
               if (ext instanceof ReplicableCommandExternalizer) {
                  ((ReplicableCommandExternalizer) ext).inject(cmdFactory);
               }
View Full Code Here

      for (Map.Entry<String, String> entry : JDK_EXTERNALIZERS.entrySet()) {
         try {
            Class clazz = Util.loadClassStrict(entry.getKey());
            Externalizer ext = null;
            ext = (Externalizer) Util.getInstanceStrict(entry.getValue());
            Marshallable marshallable = ReflectionUtil.getAnnotation(ext.getClass(), Marshallable.class);
            int id = marshallable.id();
            ids.add(id);
            ExternalizerAdapter adapter = new ExternalizerAdapter(id, ext);
            writers.put(clazz, adapter);
            readers.put(id, adapter);
         } catch (Exception e) {
            if (log.isDebugEnabled()) {
               log.debug("Unable to load class %s", e.getMessage());
            }
         }
      }

      for (String marshallableClass : MARSHALLABLES) {
         try {
            Class clazz = Util.loadClassStrict(marshallableClass);
            Marshallable marshallable = ReflectionUtil.getAnnotation(clazz, Marshallable.class);
            if (marshallable != null && !marshallable.externalizer().equals(Externalizer.class)) {
               int id = marshallable.id();
               Externalizer ext = null;
               ext = Util.getInstance(marshallable.externalizer());
               if (!ids.add(id))
                  throw new CacheException("Duplicate id found! id=" + id + " in " + ext.getClass().getName() + " is shared by another marshallable class.");
               if (ext instanceof ReplicableCommandExternalizer) {
                  ((ReplicableCommandExternalizer) ext).inject(cmdFactory);
               }
View Full Code Here

            try {
               ext = (Externalizer) Util.getInstance(entry.getValue());
            } catch (Exception e) {
               throw new CacheException("Could not instantiate entry: " + entry, e);
            }
            Marshallable marshallable = ReflectionUtil.getAnnotation(ext.getClass(), Marshallable.class);
            int id = marshallable.id();
            ids.add(id);
            ExternalizerAdapter adapter = new ExternalizerAdapter(id, ext);
            writers.put(clazz, adapter);
            readers.put(id, adapter);
         } catch (ClassNotFoundException e) {
            if (log.isDebugEnabled())
               log.debug("Unable to load class {0}", e.getMessage());
         }
      }

      for (String marshallableClass : MARSHALLABLES) {
         try {
            Class clazz = Util.loadClass(marshallableClass);
            Marshallable marshallable = ReflectionUtil.getAnnotation(clazz, Marshallable.class);
            if (marshallable != null && !marshallable.externalizer().equals(Externalizer.class)) {
               int id = marshallable.id();
               Externalizer ext = null;
               try {
                  ext = Util.getInstance(marshallable.externalizer());
               } catch (Exception e) {
                  throw new CacheException("Could not instantiate the externalizer: " + marshallable.externalizer(), e);
               }
               if (!ids.add(id))
                  throw new CacheException("Duplicate id found! id=" + id + " in " + ext.getClass().getName() + " is shared by another marshallable class.");
               if (ext instanceof ReplicableCommandExternalizer) {
                  ((ReplicableCommandExternalizer) ext).inject(cmdFactory);
View Full Code Here

      for (Map.Entry<String, String> entry : JDK_EXTERNALIZERS.entrySet()) {
         try {
            Class clazz = Util.loadClassStrict(entry.getKey());
            Externalizer ext = null;
            ext = (Externalizer) Util.getInstanceStrict(entry.getValue());
            Marshallable marshallable = ReflectionUtil.getAnnotation(ext.getClass(), Marshallable.class);
            int id = marshallable.id();
            ids.add(id);
            ExternalizerAdapter adapter = new ExternalizerAdapter(id, ext);
            writers.put(clazz, adapter);
            readers.put(id, adapter);
         } catch (Exception e) {
            if (log.isDebugEnabled()) {
               log.debug("Unable to load class %s", e.getMessage());
            }
         }
      }

      for (String marshallableClass : MARSHALLABLES) {
         try {
            Class clazz = Util.loadClassStrict(marshallableClass);
            Marshallable marshallable = ReflectionUtil.getAnnotation(clazz, Marshallable.class);
            if (marshallable != null && !marshallable.externalizer().equals(Externalizer.class)) {
               int id = marshallable.id();
               Externalizer ext = null;
               ext = Util.getInstance(marshallable.externalizer());
               if (!ids.add(id))
                  throw new CacheException("Duplicate id found! id=" + id + " in " + ext.getClass().getName() + " is shared by another marshallable class.");
               if (ext instanceof ReplicableCommandExternalizer) {
                  ((ReplicableCommandExternalizer) ext).inject(cmdFactory);
               }
View Full Code Here

            try {
               ext = (Externalizer) Util.getInstance(entry.getValue());
            } catch (Exception e) {
               throw new CacheException("Could not instantiate entry: " + entry, e);
            }
            Marshallable marshallable = ReflectionUtil.getAnnotation(ext.getClass(), Marshallable.class);
            int id = marshallable.id();
            ids.add(id);
            ExternalizerAdapter adapter = new ExternalizerAdapter(id, ext);
            writers.put(clazz, adapter);
            readers.put(id, adapter);
         } catch (ClassNotFoundException e) {
            if (log.isDebugEnabled())
               log.debug("Unable to load class {0}", e.getMessage());
         }
      }

      for (String marshallableClass : MARSHALLABLES) {
         try {
            Class clazz = Util.loadClass(marshallableClass);
            Marshallable marshallable = ReflectionUtil.getAnnotation(clazz, Marshallable.class);
            if (marshallable != null && !marshallable.externalizer().equals(Externalizer.class)) {
               int id = marshallable.id();
               Externalizer ext = null;
               try {
                  ext = Util.getInstance(marshallable.externalizer());
               } catch (Exception e) {
                  throw new CacheException("Could not instantiate the externalizer: " + marshallable.externalizer(), e);
               }
               if (!ids.add(id))
                  throw new CacheException("Duplicate id found! id=" + id + " in " + ext.getClass().getName() + " is shared by another marshallable class.");
               if (ext instanceof ReplicableCommandExternalizer) {
                  ((ReplicableCommandExternalizer) ext).inject(cmdFactory);
View Full Code Here

            try {
               ext = (Externalizer) Util.getInstance(entry.getValue());
            } catch (Exception e) {
               throw new CacheException("Could not instantiate entry: " + entry, e);
            }
            Marshallable marshallable = ReflectionUtil.getAnnotation(ext.getClass(), Marshallable.class);
            int id = marshallable.id();
            ids.add(id);
            ExternalizerAdapter adapter = new ExternalizerAdapter(id, ext);
            writers.put(clazz, adapter);
            readers.put(id, adapter);
         } catch (ClassNotFoundException e) {
            if (log.isDebugEnabled())
               log.debug("Unable to load class {0}", e.getMessage());
         }
      }

      for (String marshallableClass : MARSHALLABLES) {
         try {
            Class clazz = Util.loadClass(marshallableClass);
            Marshallable marshallable = ReflectionUtil.getAnnotation(clazz, Marshallable.class);
            if (marshallable != null && !marshallable.externalizer().equals(Externalizer.class)) {
               int id = marshallable.id();
               Externalizer ext = null;
               try {
                  ext = Util.getInstance(marshallable.externalizer());
               } catch (Exception e) {
                  throw new CacheException("Could not instantiate the externalizer: " + marshallable.externalizer(), e);
               }
               if (!ids.add(id))
                  throw new CacheException("Duplicate id found! id=" + id + " in " + ext.getClass().getName() + " is shared by another marshallable class.");
               if (ext instanceof ReplicableCommandExternalizer) {
                  ((ReplicableCommandExternalizer) ext).inject(cmdFactory);
View Full Code Here

      try {
         for (Map.Entry<String, String> entry : JDK_EXTERNALIZERS.entrySet()) {
            try {
               Class clazz = Util.loadClass(entry.getKey());
               Externalizer ext = (Externalizer) Util.getInstance(entry.getValue());
               Marshallable marshallable = ReflectionUtil.getAnnotation(ext.getClass(), Marshallable.class);
               int id = marshallable.id();
               ids.add(id);
               ExternalizerAdapter adapter = new ExternalizerAdapter(id, ext);
               writers.put(clazz, adapter);
               readers.put(id, adapter);
            } catch (ClassNotFoundException e) {
               if (log.isDebugEnabled())
                  log.debug("Unable to load class (ignore if class belonging to a module not in use): {0}", e.getMessage());
            }
         }

         for (String marshallableClass : MARSHALLABLES) {
            try {
               Class clazz = Util.loadClass(marshallableClass);
               Marshallable marshallable = ReflectionUtil.getAnnotation(clazz, Marshallable.class);
               if (marshallable != null && !marshallable.externalizer().equals(Externalizer.class)) {
                  int id = marshallable.id();
                  Externalizer ext = Util.getInstance(marshallable.externalizer());
                  if (!ids.add(id))
                     throw new CacheException("Duplicate id found! id=" + id + " in " + ext.getClass().getName() + " is shared by another marshallable class.");
                  if (ext instanceof ReplicableCommandExternalizer) {
                     ((ReplicableCommandExternalizer) ext).inject(cmdFactory);
                  }
View Full Code Here

TOP

Related Classes of org.infinispan.marshall.Marshallable

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.