private synchronized boolean waitForState(Processor p, int state) { p.addControllerListener(new StateListener()); failed = false; // Call the required method on the processor if (state == Processor.Configured) { p.configure(); } else if (state == Processor.Realized) { p.realize(); } // Wait until we get an event that confirms the // success of the method, or a failure event. // See StateListener inner class while (p.getState() < state && !failed) { synchronized (getStateLock()) { try { getStateLock().wait(); } catch (InterruptedException ie) { return false; } } } return !failed; }
if ((processor != null) && (processor.getState() >= Processor.Realized))
/** * Starts a specific <tt>Processor</tt> if this <tt>MediaDeviceSession</tt> * has been started and the specified <tt>Processor</tt> is not started. * * @param processor the <tt>Processor</tt> to start */ protected void startProcessorInAccordWithDirection(Processor processor) { if (startedDirection.allowsSending() && (processor.getState() != Processor.Started)) { processor.start(); if (logger.isTraceEnabled()) { logger.trace( "Started Processor with hashCode " + processor.hashCode()); } } }
while ((processor.getState() < state) && !failed)
private synchronized boolean waitForState(Processor p, int state) { p.addControllerListener(new StateListener()); failed = false; // Call the required method on the processor if (state == Processor.Configured) { p.configure(); } else if (state == Processor.Realized) { p.realize(); } // Wait until we get an event that confirms the // success of the method, or a failure event. // See StateListener inner class while (p.getState() < state && !failed) { synchronized (getStateLock()) { try { getStateLock().wait(); } catch (InterruptedException ie) { return false; } } } return !failed; }
private synchronized boolean waitForState(Processor p, int state) { p.addControllerListener(new StateListener()); failed = false; // Call the required method on the processor if (state == Processor.Configured) { p.configure(); } else if (state == Processor.Realized) { p.realize(); } // Wait until we get an event that confirms the // success of the method, or a failure event. // See StateListener inner class while (p.getState() < state && !failed) { synchronized (getStateLock()) { try { getStateLock().wait(); } catch (InterruptedException ie) { return false; } } } return !failed; }
&& (processor.getState() > Processor.Configured))
int processorState = processor.getState();
|| ((processor.getState() < Processor.Realized) && !waitForState(processor, Processor.Realized))) outputDataSource = null;
+ processor.hashCode()); if (processor.getState() == Processor.Realized)