Must be called after construction

@throws IOException errors
762638
public void     start() throws Exception
    {
        log.debug("Starting");

        if ( !started.compareAndSet(false, true) )
        {
            IllegalStateException ise = new IllegalStateException("Already started");
            throw ise;
        }

        state.start();
    }
1191351
public void endInsert() throws IOException {
        ResponseWriter writer = getWrapped();
        writer.endCDATA();
        if (inInsertBefore) {
            writer.endElement("before");
            inInsertBefore = false;
        } else if (inInsertAfter) {
            writer.endElement("after");
            inInsertAfter = false;
        }
        writer.endElement("insert");
    }
761951
private void init() throws IOException {
        bsPutUByte('B');
        bsPutUByte('Z');

        this.data = new Data(this.blockSize100k);
        this.blockSorter = new BlockSort(this.data);

        // huffmanised magic bytes
        bsPutUByte('h');
        bsPutUByte('0' + this.blockSize100k);

        this.combinedCRC = 0;
        initBlock();
    }
46885
private void init() throws IOException {
    WR = new Path(conf.get("fs.snapshot.waitingroom", "/.WR"));
    WR = WR.makeQualified(dfs);
  }
890584
@Override
	protected void onFirstOutput() throws IOException
	{
		if(prefix != null && prefix.length() > 0)
		{
			print(prefix);
			prefix = null;	// no need to keep a ref
		}
	}
329333
private synchronized void initOut() throws IOException
   {
      if (out == null)
      {
         OutputStream os = new IndexOutputStream(dir.createOutput(REDO_LOG));
         out = new BufferedWriter(new OutputStreamWriter(os));
      }
   }
627943
public function afterConstruct()
    {
        if (! isset($this->attributes['permissions'])) {
            $this->permissions = $this->factory->create(RolePermission::class);
        }
    }
388136
private synchronized void initQueryBuilder() throws IOException {
        if (queryBuilder == null) {
            indexReader = DirectoryReader.open(indexDirectory);
            indexSearcher = new IndexSearcher(indexReader);
            queryBuilder = new QueryBuilder(writer.getAnalyzer());
        }
    }
236005
@Override
  public final void error(String error) throws IOException {
    add(false);
    setError(newCurrentPosition, error, newCurrentExisting);
  }
476594
@Override
    public void call(String method, Object[] args)
        throws IOException
    {
        writeVersion();

        int length = args != null ? args.length : 0;

        startCall(method, length);

        for (int i = 0; i < length; i++) {
            writeObject(args[i]);
        }

        completeCall();

        flush();
    }
808420
public void finish() throws IOException 
    {
        if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  //306998.15
            logger.logp(Level.FINE, CLASS_NAME,"finish", "finish");
        } 
        // PM18453 start
        WebContainerRequestState requestState = WebContainerRequestState.getInstance(false);
        if (requestState != null && (Boolean.valueOf((String)requestState.getAttribute("InputStreamEarlyReadCompleted"))).booleanValue()) {
            if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  //306998.15
                logger.logp(Level.FINE, CLASS_NAME,"finish", "Skip read because data has already been read and destroyed.");
            } 
            total=limit;
        }
        // PM18453 End
        else if (!SRTServletResponse.isSkipInputStreamRead() &&  length != -1 )        {
            // if content length set then skip remaining bytes in message body
            long remaining = limit - total;   // PK79219
            while ( remaining > 0 )
            {
                long n = skip(remaining);   // PM03146
                if ( n == 0 )
                {
                    // begin 280584.3    6021: Cleanup of  defect 280584.2    WAS.webcontainer
                    //logger.logp(Level.SEVERE, CLASS_NAME,"finish", nls.getString("Invalid.Content.Length"));
                    // end 280584.3    6021: Cleanup of  defect 280584.2    WAS.webcontainer
                    throw new IOException(nls.getString("Invalid.Content.Length","Invalid content length"));
                }
                remaining -= n;
            }
        }
    }
633
public void run() throws IOException {
    if (this.isStarted() || this.isComplete()) {
      throw new IllegalStateException("The process can only be used once.");
    }

    final ProcessBuilder builder = new ProcessBuilder(this.cmd);
    builder.directory(new File(this.workingDir));
    builder.environment().putAll(this.env);
    builder.redirectErrorStream(true);
    this.process = builder.start();
    try {
      this.processId = processId(this.process);
      if (this.processId == 0) {
        this.logger.debug("Spawned thread with unknown process id");
      } else {
        this.logger.debug("Spawned thread with process id " + this.processId);
      }

      this.startupLatch.countDown();

      final LogGobbler outputGobbler =
          new LogGobbler(
              new InputStreamReader(this.process.getInputStream(), StandardCharsets.UTF_8),
              this.logger, Level.INFO, 30);
      final LogGobbler errorGobbler =
          new LogGobbler(
              new InputStreamReader(this.process.getErrorStream(), StandardCharsets.UTF_8),
              this.logger, Level.ERROR, 30);

      outputGobbler.start();
      errorGobbler.start();
      int exitCode = -1;
      try {
        exitCode = this.process.waitFor();
      } catch (final InterruptedException e) {
        this.logger.info("Process interrupted. Exit code is " + exitCode, e);
      }

      this.completeLatch.countDown();

      // try to wait for everything to get logged out before exiting
      outputGobbler.awaitCompletion(5000);
      errorGobbler.awaitCompletion(5000);

      if (exitCode != 0) {
        throw new ProcessFailureException(exitCode);
      }

    } finally {
      IOUtils.closeQuietly(this.process.getInputStream());
      IOUtils.closeQuietly(this.process.getOutputStream());
      IOUtils.closeQuietly(this.process.getErrorStream());
    }
  }
1287273
@PostConstruct
	protected void postConstruct() {
		if (null == authenticationServices) {
			authenticationServices = new ArrayList<AuthenticationService>();
		}
		if (!excludeDefault) {
			authenticationServices.add(staticAuthenticationService);
		}
	}
1129061
@PostConstruct
	protected void postConstruct() throws GeomajasException {
		if (null == baseTmsUrl) {
			throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "baseTmsUrl");
		}

		// Make sure we have a base URL we can work with:
		if ((baseTmsUrl.startsWith("http://") || baseTmsUrl.startsWith("https://")) && !baseTmsUrl.endsWith("/")) {
			baseTmsUrl += "/";
		}

		// Make sure there is a correct RasterLayerInfo object:
		if (layerInfo == null || layerInfo == UNUSABLE_LAYER_INFO) {
			try {
				tileMap = configurationService.getCapabilities(this);
				version = tileMap.getVersion();
				extension = tileMap.getTileFormat().getExtension();
				layerInfo = configurationService.asLayerInfo(tileMap);
				usable = true;
			} catch (TmsLayerException e) {
				// a layer needs an info object to keep the DtoConfigurationPostProcessor happy !
				layerInfo = UNUSABLE_LAYER_INFO;
				usable = false;
				log.warn("The layer could not be correctly initialized: " + getId(), e);
			}
		} else if (extension == null) {
			throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "extension");
		}

		if (layerInfo != null) {
			// Finally prepare some often needed values:
			state = new TileServiceState(geoService, layerInfo);
			// when proxying the real url will be resolved later on, just use a simple one for now
			boolean proxying = useCache || useProxy || null != authentication;
			if (tileMap != null && !proxying) {
				urlBuilder = new TileMapUrlBuilder(tileMap);
			} else {
				urlBuilder = new SimpleTmsUrlBuilder(extension);
			}
		}
	}
1256167
public void startError(String errorName) throws IOException {
        endUpdateIfNecessary();
        endChangesIfNecessary();
        ResponseWriter writer = getWrapped();
        writer.startElement("error", null);
        writer.startElement("error-name", null);
        writer.write(errorName);
        writer.endElement("error-name");
        writer.startElement("error-message", null);
        writer.startCDATA();
    }
547771
private void complete() throws IOException
    {
    if( source_ != null)
      {
      try
        {
        thread_.join();
        }
      catch( Exception e)
        {
        logger_.error( "Thread=" + thread_ + " not completed", e);
        }

      IOException failure =
        failure_ == null
        ? null
        : new IOException( "Can't write filter output", failure_);
      
      failure_      = null;
      filterInput_  = null;
      source_       = null;
      target_       = null;
      thread_       = null;

      if( failure != null)
        {
        throw failure;
        }
      }
    }
564692
protected void initCheck() throws IOException {
    // Check storage version
    if (_version != STORAGE_VERSION) {
      throw new IOException("Invalid version in " + _file.getName() + ": "
              + _version + ", " + STORAGE_VERSION + " expected");
    }
    
    // Check array file header
    if(!checkHeader()) {
      throw new IOException("Invalid header in " + _file.getName() + ": " + getHeader());
    }
  }