Sets an observer for this output stream. The observer will be
notified when the stream is first written to.
182928
@Override
    public void setObserver(HttpOutputStreamObserver obs) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "obs  ->" + obs);
        }
        this.obs = obs;
    }
660458
def dispatch(self, receiver):
        ''' 

        '''
        super(ColumnsStreamedEvent, self).dispatch(receiver)
        if hasattr(receiver, '_columns_streamed'):
            receiver._columns_streamed(self)
293498
private void writeObject(ObjectOutputStream stream) throws IOException {
		final Object[] lList = this.listeners;
		stream.defaultWriteObject();

		// Save the non-null event listeners:
		for (int i = 0; i < lList.length; i += 2) {
			final Class<?> t = (Class<?>) lList[i];
			final EventListener l = (EventListener) lList[i + 1];
			if ((l != null) && (l instanceof Serializable)) {
				stream.writeObject(t.getName());
				stream.writeObject(l);
			}
		}

		stream.writeObject(null);
	}
459712
final public function notify()
  {
    $observers = array_values($this->_observers);
    foreach ($observers as $observer) {
      switch (false) {
        case is_array($observer):
        case isset($observer[0]):
        case isset($observer[1]):
        case is_string($observer[0]):
          break;
        default:
          Loader::loadClass($observer[0]);
          break;
      }

      if (!is_callable($observer)) {
        continue;
      }

      call_user_func($observer, $this);
    }

    return $this;
  }
31210
protected void setReadWrite() throws IOException
   {
      // Release all the current threads
      synchronized (updateMonitor)
      {
         indexUpdateMonitor.setUpdateInProgress(false, true);
         updateMonitor.notifyAll();
         releaseMultiReader();
      }

      this.redoLog = new RedoLog(indexDir);
      redoLogApplied = redoLog.hasEntries();

      // run recovery
      Recovery.run(this, redoLog);

      // enqueue unused segments for deletion
      enqueueUnusedSegments();
      attemptDelete();

      // now that we are ready, start index merger
      initMerger();

      if (redoLogApplied)
      {
         // wait for the index merge to finish pending jobs
         try
         {
            merger.waitUntilIdle();
         }
         catch (InterruptedException e)
         {
            // move on
         }
         flush();
      }

      if (indexNames.size() > 0)
      {
         scheduleFlushTask();
      }
   }
267597
@Synchronized
    public void initializeStreamWriters(final EventStreamClientFactory clientFactory,
                                        final ControllerEventProcessorConfig config) {
        if (!commitWriterFuture.isDone()) {
            commitWriterFuture.complete(clientFactory.createEventWriter(
                    config.getCommitStreamName(),
                    ControllerEventProcessors.COMMIT_EVENT_SERIALIZER,
                    EventWriterConfig.builder().build()));
        }
        if (!abortWriterFuture.isDone()) {
            abortWriterFuture.complete(clientFactory.createEventWriter(
                    config.getAbortStreamName(),
                    ControllerEventProcessors.ABORT_EVENT_SERIALIZER,
                    EventWriterConfig.builder().build()));
        }
        this.setReady();
    }
77072
static void init() {
		initialContextFactory = System.getProperty(Context.INITIAL_CONTEXT_FACTORY);
		System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
				MonitoringInitialContextFactory.class.getName());
	}
449406
def _init_stream(self):
        '''
        '''
        assert not self._control_connection
        self._control_connection = yield from self._acquire_request_connection(self._request)
        self._control_stream = ControlStream(self._control_connection)
        self._commander = Commander(self._control_stream)

        read_callback = functools.partial(self.event_dispatcher.notify, self.Event.control_receive_data)
        self._control_stream.data_event_dispatcher.add_read_listener(read_callback)

        write_callback = functools.partial(self.event_dispatcher.notify, self.Event.control_send_data)
        self._control_stream.data_event_dispatcher.add_write_listener(write_callback)
20637
public void write(PrintStream stream) {
        this.output = stream;
        dispatch(base, false);
        stream.flush();
    }
378729
public void setOutputStream(FLACOutputStream fos) {
    if(fos == null)
      throw new IllegalArgumentException("FLACOutputStream fos must not be null.");
    if(flacWriter == null)
      flacWriter = new FLACStreamController(fos,streamConfig);
    else
      flacWriter.setFLACOutputStream(fos);
  }
1048784
def add_observer(self, observer):
        
        if not isinstance(observer, PowerManagementObserver):
            raise TypeError("observer MUST conform to power.PowerManagementObserver")
        self._weak_observers.append(weakref.ref(observer))
1135380
public void startWatching() {
        try {
            final List<MonitorLine> lines = getSource().getLastLine(getInitialCount());
            actual = null;
            updateLines(lines);
        } catch (Exception e) {
            notifyObservers(e);
        }
    }
1364321
def write(self, output):
        
        self._stream.write(output)

        if self._auto_flush:
            self._stream.flush()
665211
public void setOutput(java.io.Writer writer) {
        
        fOut = writer instanceof PrintWriter
                ? (PrintWriter)writer : new PrintWriter(writer);
        
    }
1031580
public synchronized static void setStdout(OutputStream os)
  {
    if (_stdoutStream == null) {
      initStdout();
    }

    if (os == _systemErr || os == _systemOut) {
      return;
    }

    if (os instanceof WriteStream) {
      WriteStream out = (WriteStream) os;

      /*
      if (out.getSource() == StdoutStream.create()
          || out.getSource() == StderrStream.create()) {
        return;
      }
      */
    }
    
    _stdoutStream.setStream(os);
  }
1217355
public void registerMonitor(Monitor monitor) {
        if (monitors == null) {
            monitors = new CopyOnWriteArrayList<>();
        }
        monitors.add(monitor);
    }
123430
def notify(self, resource):
        
        observers = self._observeLayer.notify(resource)
        logger.debug("Notify")
        for transaction in observers:
            with transaction:
                transaction.response = None
                transaction = self._requestLayer.receive_request(transaction)
                transaction = self._observeLayer.send_response(transaction)
                transaction = self._blockLayer.send_response(transaction)
                transaction = self._messageLayer.send_response(transaction)
                if transaction.response is not None:
                    if transaction.response.type == defines.Types["CON"]:
                        self._start_retransmission(transaction, transaction.response)

                    self.send_datagram(transaction.response)