Package org.jboss.portal.portlet.state

Examples of org.jboss.portal.portlet.state.StateConversionException


         dos.close();
         return baos.toByteArray();
      }
      catch (IOException e)
      {
         throw new StateConversionException(e);
      }
   }
View Full Code Here


         ByteArrayInputStream bais = new ByteArrayInputStream(marshalledState);
         DataInputStream dis = new DataInputStream(bais);
         int magicValue = dis.readInt();
         if (magicValue != MAGIC_VALUE)
         {
            throw new StateConversionException("Bad magic value " + Integer.toHexString(magicValue));
         }
         byte versionId = dis.readByte();
         if (versionId > 0)
         {
            throw new StateConversionException("Bad version id " + versionId);
         }
         String portletId = dis.readUTF();
         int size = dis.readInt();
         PropertyMap properties = new SimplePropertyMap(size);
         while (size-- > 0)
         {
            String key = dis.readUTF();
            int length = dis.readInt();
            String[] strings = new String[length];
            for (int i = 0; i < strings.length; i++)
            {
               boolean isNull = dis.readBoolean();
               if (isNull == false)
               {
                  String string = dis.readUTF();
                  strings[i] = string;
               }
            }
            List<String> value = Arrays.asList(strings.clone());
            properties.setProperty(key, value);
         }
         return new PortletState(portletId, properties);
      }
      catch (IOException e)
      {
         throw new StateConversionException(e);
      }
   }
View Full Code Here

TOP

Related Classes of org.jboss.portal.portlet.state.StateConversionException

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.