List of usage examples for java.io ObjectInput readBoolean
boolean readBoolean() throws IOException;
From source file:org.apache.lens.server.query.QueryExecutionServiceImpl.java
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { super.readExternal(in); // Restore drivers synchronized (drivers) { int numDrivers = in.readInt(); String driverQualifiedName; String driverClsName;//from w w w.j a v a 2 s . co m for (int i = 0; i < numDrivers; i++) { driverQualifiedName = in.readUTF(); driverClsName = in.readUTF(); LensDriver driver = drivers.get(driverQualifiedName); if (driver == null) { // this driver is removed in the current server restart // we will create an instance and read its state still. try { Class<? extends LensDriver> driverCls = (Class<? extends LensDriver>) Class .forName(driverClsName); driver = driverCls.newInstance(); String[] driverTypeAndName = StringUtils.split(driverQualifiedName, '/'); driver.configure(conf, driverTypeAndName[0], driverTypeAndName[1]); } catch (Exception e) { log.error("Could not instantiate driver:{} represented by class {}", driverQualifiedName, driverClsName, e); throw new IOException(e); } log.info("Driver state for {} will be ignored", driverQualifiedName); } driver.readExternal(in); } } // Restore queries synchronized (allQueries) { int numQueries = in.readInt(); for (int i = 0; i < numQueries; i++) { QueryContext ctx = (QueryContext) in.readObject(); ctx.initTransientState(); //Create DriverSelectorQueryContext by passing all the drivers and the user query //Driver conf gets reset in start DriverSelectorQueryContext driverCtx = new DriverSelectorQueryContext(ctx.getUserQuery(), new Configuration(), drivers.values()); ctx.setDriverContext(driverCtx); boolean driverAvailable = in.readBoolean(); // set the selected driver if available, if not available for the cases of queued queries, // query service will do the selection from existing drivers and update if (driverAvailable) { String selectedDriverQualifiedName = in.readUTF(); if (drivers.get(selectedDriverQualifiedName) != null) { ctx.getDriverContext().setSelectedDriver(drivers.get(selectedDriverQualifiedName)); ctx.setDriverQuery(ctx.getSelectedDriver(), ctx.getSelectedDriverQuery()); } else { log.info("Ignoring {} as the driver is not loaded", ctx.getQueryHandle()); continue; } } allQueries.put(ctx.getQueryHandle(), ctx); } } }
From source file:com.sentaroh.android.SMBExplorer.SMBExplorerMain.java
@SuppressWarnings("unchecked") @Override/* w w w . j a v a 2 s . co m*/ public void readExternal(ObjectInput objin) throws IOException, ClassNotFoundException { // Log.v("","rd"); long sid = objin.readLong(); if (serialVersionUID != sid) { throw new IOException("serialVersionUID was not matched by saved UID"); } paste_list = (ArrayList<FileListItem>) SerializeUtil.readArrayList(objin); paste_from_url = SerializeUtil.readUtf(objin); paste_to_url = SerializeUtil.readUtf(objin); paste_item_list = SerializeUtil.readUtf(objin); is_paste_copy = objin.readBoolean(); is_paste_enabled = objin.readBoolean(); is_paste_from_local = objin.readBoolean(); local_dir_hist = (ArrayList<String>) SerializeUtil.readArrayList(objin); remote_dir_hist = (ArrayList<String>) SerializeUtil.readArrayList(objin); remote_file_list_cache = (ArrayList<FileListCacheItem>) SerializeUtil.readArrayList(objin); remote_curr_file_list = (FileListCacheItem) objin.readObject(); local_file_list_cache = (ArrayList<FileListCacheItem>) SerializeUtil.readArrayList(objin); local_curr_file_list = (FileListCacheItem) objin.readObject(); vsa = new ViewSaveArea(); vsa.readExternal(objin); dialog_msg_cat = objin.readUTF(); remoteBase = SerializeUtil.readUtf(objin); localBase = SerializeUtil.readUtf(objin); remoteDir = SerializeUtil.readUtf(objin); localDir = SerializeUtil.readUtf(objin); currentTabName = SerializeUtil.readUtf(objin); smbUser = SerializeUtil.readUtf(objin); smbPass = SerializeUtil.readUtf(objin); localUpButtonEnabled = objin.readBoolean(); localTopButtonEnabled = objin.readBoolean(); remoteUpButtonEnabled = objin.readBoolean(); remoteTopButtonEnabled = objin.readBoolean(); }