Source:
<code>protected Channel(ChannelBuilder settings, CommandTransport transport) throws IOException { this.name = settings.getName(); this.executor = new InterceptingExecutorService(settings.getExecutors(),decorators); this.arbitraryCallableAllowed = settings.isArbitraryCallableAllowed(); this.remoteClassLoadingAllowed = settings.isRemoteClassLoadingAllowed(); this.underlyingOutput = transport.getUnderlyingStream(); this.jarCache = settings.getJarCache(); this.baseClassLoader = settings.getBaseLoader(); this.classFilter = settings.getClassFilter(); if(internalExport(IChannel.class, this, false)!=1) throw new AssertionError(); remoteChannel = RemoteInvocationHandler.wrap(this,1,IChannel.class,true,false); this.remoteCapability = transport.getRemoteCapability(); this.pipeWriter = new PipeWriter(createPipeWriterExecutor()); this.transport = transport; this.jarLoader = new JarLoaderImpl(); setProperty(JarLoader.OURS, jarLoader); this.decorators.addAll(settings.getDecorators()); this.properties.putAll(settings.getProperties()); transport.setup(this, new CommandReceiver() { public void handle(Command cmd) { <START> commandsReceived++; <END> lastCommandReceived = System.currentTimeMillis(); updateLastHeard(); if (logger.isLoggable(Level.FINE)) logger.fine("Received " + cmd); try { cmd.execute(Channel.this); } catch (Throwable t) { logger.log(Level.SEVERE, "Failed to execute command " + cmd + " (channel " + Channel.this.name + ")", t); logger.log(Level.SEVERE, "This command is created here", cmd.createdAt); } } public void terminate(IOException e) { Channel.this.terminate(e); } }); ACTIVE_CHANNELS.put(this,ref()); }</code><technical_language>handling potentially happen in threads</technical_language>

Target:
protected Channel(ChannelBuilder settings, CommandTransport transport) throws IOException { this.name = settings.getName(); this.executor = new InterceptingExecutorService(settings.getExecutors(),decorators); this.arbitraryCallableAllowed = settings.isArbitraryCallableAllowed(); this.remoteClassLoadingAllowed = settings.isRemoteClassLoadingAllowed(); this.underlyingOutput = transport.getUnderlyingStream(); this.jarCache = settings.getJarCache(); this.baseClassLoader = settings.getBaseLoader(); this.classFilter = settings.getClassFilter(); if(internalExport(IChannel.class, this, false)!=1) throw new AssertionError(); remoteChannel = RemoteInvocationHandler.wrap(this,1,IChannel.class,true,false); this.remoteCapability = transport.getRemoteCapability(); this.pipeWriter = new PipeWriter(createPipeWriterExecutor()); this.transport = transport; this.jarLoader = new JarLoaderImpl(); setProperty(JarLoader.OURS, jarLoader); this.decorators.addAll(settings.getDecorators()); this.properties.putAll(settings.getProperties()); transport.setup(this, new CommandReceiver() { public void handle(Command cmd) { commandsReceived++; lastCommandReceivedAt = System.currentTimeMillis(); if (logger.isLoggable(Level.FINE)) logger.fine("Received " + cmd); try { cmd.execute(Channel.this); } catch (Throwable t) { logger.log(Level.SEVERE, "Failed to execute command " + cmd + " (channel " + Channel.this.name + ")", t); logger.log(Level.SEVERE, "This command is created here", cmd.createdAt); } } public void terminate(IOException e) { Channel.this.terminate(e); } }); ACTIVE_CHANNELS.put(this,ref()); }