Package java.beans

Examples of java.beans.XMLDecoder.readObject()


   */
  public static QueryPlan deserializeQueryPlan(InputStream in, Configuration conf) {
    XMLDecoder d = null;
    try {
      d = new XMLDecoder(in, null, null, conf.getClassLoader());
      QueryPlan ret = (QueryPlan) d.readObject();
      return (ret);
    } finally {
      if (null != d) {
        d.close();
      }
View Full Code Here


  public static MapredWork deserializeMapRedWork(InputStream in, Configuration conf) {
    XMLDecoder d = null;
    try {
      d = new XMLDecoder(in, null, null, conf.getClassLoader());
      MapredWork ret = (MapredWork) d.readObject();
      return (ret);
    } finally {
      if (null != d) {
        d.close();
      }
View Full Code Here

  public static MapredLocalWork deserializeMapRedLocalWork(InputStream in, Configuration conf) {
    XMLDecoder d = null;
    try {
      d = new XMLDecoder(in, null, null, conf.getClassLoader());
      MapredLocalWork ret = (MapredLocalWork) d.readObject();
      return (ret);
    } finally {
      if (null != d) {
        d.close();
      }
View Full Code Here

      {
  Object expectedObject = ite.next();

  try
    {
      Object decodedObject = decoder.readObject();

      if (checkers.containsKey(expectedObject))
        {
    EqualityChecker eq = (EqualityChecker) checkers.get(expectedObject);
View Full Code Here

     * Since there is no query method for this we have to invoke readObject() which should throw an
     * ArrayIndexOutOfBoundsException if there is no object left.
     */
    try
      {
  decoder.readObject();
      }
    catch (ArrayIndexOutOfBoundsException aioobe)
      {
  // this exception is expected
  decoder.close();
View Full Code Here

            public void exceptionThrown(Exception ex) {
                System.out.println(ex.getMessage());
                ex.printStackTrace();
            }
        });
        Object obj = dec.readObject();
        return (Painter)obj;
    }
   
    public static Painter loadPainter(URL url) throws IOException {
        return loadPainter(url,url);
View Full Code Here

  public static void main(String[] args) throws Exception {
   
         XMLDecoder d = new XMLDecoder(
                   new BufferedInputStream(
                       new FileInputStream("Test.xml")));
         Object result = d.readObject();
         System.out.println(result);
         d.close();
   
  }
View Full Code Here

* @return workspace object decoded from lastWorkspace static
*/
  private Workspace decodeWorkspaceXML() {
    ByteArrayInputStream stream = new ByteArrayInputStream(((String)lastWorkspace).getBytes());
    XMLDecoder decoder = new XMLDecoder(new BufferedInputStream(stream));
    Workspace workspace = (Workspace) decoder.readObject();
    decoder.close();
    return workspace;
  }
  private Workspace decodeWorkspaceBinary() {
        ByteArrayInputStream bin=new ByteArrayInputStream((byte[]) lastWorkspace);
View Full Code Here

                                    EndEntityProfile eprofile = null;
                                    FileInputStream is = new FileInputStream(infiles[i]);
                                    XMLDecoder decoder = new XMLDecoder( is );
                                    if (entityprofile) {
                                        eprofile = new EndEntityProfile();
                                        eprofile.loadData(decoder.readObject());
                                        // Translate cert profile ids that have changed after import
                                        String availableCertProfiles = "";
                                        String defaultCertProfile = eprofile.getValue(EndEntityProfile.DEFAULTCERTPROFILE,0);
                                      //getLogger().debug("Debug: Org - AVAILCERTPROFILES " + eprofile.getValue(EndEntityProfile.AVAILCERTPROFILES,0) + " DEFAULTCERTPROFILE "+defaultCertProfile);
                                        for (String currentCertProfile : (Collection<String>) eprofile.getAvailableCertificateProfileIds()) {
View Full Code Here

                                        }catch(EndEntityProfileExistsException eepee){ 
                                          getLogger().error("Error adding entity profile '"+profilename+"' to database.");
                                        }                                       
                                    } else {
                                        cprofile = new CertificateProfile();
                                        cprofile.loadData(decoder.readObject());
                                        // Make sure CAs in profile exist
                                        Collection<Integer> cas = cprofile.getAvailableCAs();
                                        ArrayList<Integer> casToRemove = new ArrayList<Integer>();
                                        for (Integer currentCA : cas) {
                                          if (currentCA != CertificateProfile.ANYCA && ejb.getCAAdminSession().getCAInfo(getAdmin(), currentCA) == null) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.