/*
(non-Javadoc)

@see com.ibm.ws.sib.processor.MPConsumerSession#setBifurcatedConsumerCloseRedeliveryMode(boolean)
541449
@Override
    public synchronized void setBifurcatedConsumerCloseRedeliveryMode(boolean bumpRedeliveryOnClose)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        {
            SibTr.entry(tc, "setBifurcatedConsumerCloseRedeliveryMode", Boolean.valueOf(bumpRedeliveryOnClose));
            SibTr.exit(tc, "setBifurcatedConsumerCloseRedeliveryMode");
        }
        bumpRedeliveryOnBifurcatedClose = bumpRedeliveryOnClose;
    }
926681
public boolean isConsumerSuspended(int suspendFlag)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "isConsumerSuspended", Integer.valueOf(suspendFlag));
    
    boolean suspended;
    this.lock();
    try 
    {
      if (suspendFlag == 0)
      {
        // the passed in suspend flag was 0 this means the caller wants to know if the consumer
        // is suspended for any reason
        suspended = _consumerSuspended;
      }
      else if (_suspendFlags == 0)  // No flags set so it must not be suspended
      {
        suspended = false;
      }
      else if ((_suspendFlags & suspendFlag) == suspendFlag)
      {
        //We were asked about certain type of suspended and we are suspended for that reason
        suspended = true;
      }
      else 
      {
        suspended = false;
      }
    }
    finally
    {
      this.unlock();
    }
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "isConsumerSuspended", Boolean.valueOf(suspended));
    
    return suspended;
  }
47614
@Override
    public boolean startOrientationProvider(IOrientationConsumer orientationConsumer)
    {
        mOrientationConsumer = orientationConsumer;
        boolean result = false;

        final Sensor sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION);
        if (sensor != null) {
            result = mSensorManager.registerListener(this, sensor, SensorManager.SENSOR_DELAY_UI);
        }
        return result;
    }
796686
protected void setNonVolatileMode(final MicrochipPotentiometerNonVolatileMode nonVolatileMode) {

		if (nonVolatileMode == null) {
			throw new RuntimeException("Setting a null-NonVolatileMode is not valid!");
		}

		if (!isCapableOfNonVolatileWiper()
				&& (nonVolatileMode != MicrochipPotentiometerNonVolatileMode.VOLATILE_ONLY)) {
			throw new RuntimeException("This device is not capable of non-volatile wipers."
					+ " Using another NonVolatileMode than '"
					+ MicrochipPotentiometerNonVolatileMode.VOLATILE_ONLY + "' is not valid!");
		}

		this.nonVolatileMode = nonVolatileMode;

	}
58108
public void unsetAsynchConsumerCallback(int requestNumber, boolean stoppable)                        //SIB0115d.comms
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "unsetAsynchConsumerCallback", "requestNumber="+requestNumber+",stoppable="+stoppable);

      checkNotBrowserSession();                                   // F171893

      if (subConsumer != null)
      {
         subConsumer.unsetAsynchConsumerCallback(requestNumber, stoppable);                             //SIB0115d.comms
      }

      subConsumer = null;

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "unsetAsynchConsumerCallback");
   }
831443
public void setDestinationResolver(DestinationResolver destinationResolver) {
        Assert.notNull(destinationResolver, "destinationResolver must not be null");
        this.jmsTemplate.setDestinationResolver(destinationResolver);
        this.messageListenerContainer.setDestinationResolver(destinationResolver);
    }
363874
boolean isSessionBifurcated() {

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            final String methodName = "isSessionBifurcated";
            SibTr.entry(this, TRACE, methodName);
            SibTr.exit(this, TRACE, methodName, Boolean.FALSE);
        }
        return false;

    }
808242
public void setConsumerDispatcherStateFilter(ConsumerDispatcherState consumerDispatcherState)
  {
    if (tc.isEntryEnabled())
      SibTr.entry(tc, "setConsumerDispatcherStateFilter", consumerDispatcherState);

    this._consumerDispatcherState = consumerDispatcherState;
    this._subscriptionId = null;
    this._destination = null;
    
    if (tc.isEntryEnabled())
      SibTr.exit(tc, "setConsumerDispatcherStateFilter");
  }
980386
@Override
	public final void setDeliveryMode(int deliveryMode) throws JMSException
    {
        if (deliveryMode != DeliveryMode.PERSISTENT &&
            deliveryMode != DeliveryMode.NON_PERSISTENT)
            throw new FFMQException("Invalid delivery mode : "+deliveryMode,"INVALID_DELIVERY_MODE");
        
        this.defaultDeliveryMode = deliveryMode;
    }
1143409
@Override
    public void setComponentEnabled(boolean enabled) {
        super.setComponentEnabled(enabled);

        boolean enable = enabled && getModel().getRowCount() > 0;
        enableAllButton.setEnabled(enable);
        disableAllButton.setEnabled(enable);
    }
1078908
private void validateDeliveryMode(int deliveryMode) throws JMSException {
        switch (deliveryMode) {
            case DeliveryMode.NON_PERSISTENT:
            case DeliveryMode.PERSISTENT:
                // OK - no problems.
                break;
            default:
                throw (JMSException) JmsErrorUtils.newThrowable(
                                                                JMSException.class,
                                                                "INVALID_VALUE_CWSIA0068",
                                                                new Object[] { "JMSDeliveryMode", "" + deliveryMode },
                                                                tc
                                );
        }
    }
1139184
protected void removeBifurcatedConsumer(BifurcatedConsumerSessionImpl consumer) throws SIResourceException, SISessionDroppedException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "removeBifurcatedConsumer", consumer);

        synchronized (_bifurcatedConsumers)
        {
            _bifurcatedConsumers.remove(consumer);
        }

        // Cleanup after the bifurcated consumer (unlock any messages it owns)
        _localConsumerPoint.cleanupBifurcatedConsumer(consumer);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "removeBifurcatedConsumer");
    }
1277959
public void setIsCoordinatingDiscoveryServer() {
        String instanceId = getId();
        if ((instanceId != null)
                && (instanceId.equals(ApplicationInfoManager.getInstance()
                .getInfo().getId()))) {
            isCoordinatingDiscoveryServer = Boolean.TRUE;
        } else {
            isCoordinatingDiscoveryServer = Boolean.FALSE;
        }
    }
480655
@Override
    public synchronized void setCorrupt(boolean newCorrupt)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "setCorrupt", Boolean.valueOf(newCorrupt));

        boolean oldCorrupt = _isCorruptOrIndoubt;
        _isCorruptOrIndoubt = newCorrupt;

        // PK54812 We need to pass this through to the destination manager to
        // actually change the state of the destination.
        if (newCorrupt && !oldCorrupt)
        {
            destinationManager.corruptDestination(this);

            // Log a message with details of the destination that is corrupt
            SibTr.info(tc_cwsik, "DELIVERY_ERROR_SIRC_27",
                       new Object[] { getName() + " " + getUuid().toString() });
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "setCorrupt");
    }
381773
@Override
    public void resumeConsumer(int suspendFlag)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "resumeConsumer", this);

        // Use this flag to identify whether a new thread must be spun off to look for more
        // messages
        boolean spinOffNewThread = false;
        try
        {
            // Take the lock
            this.lock();

            if (_consumerSuspended)
            {
                boolean setStillSuspended = false;

                // If we're resuming due to the ConsumerSet being resumed then we need to
                // re-check the set's state due to us not holding the set's activeMessageCount
                // lock at this time (due to the hierarchy). And if we find that the set is
                // actually suspended (due to someone else in the set getting in and adding
                // another message then we just ignore this resume as there'll be another one
                // along when the count drops back below the limit again.
                if (suspendFlag == DispatchableConsumerPoint.SUSPEND_FLAG_SET_ACTIVE_MSGS)
                    setStillSuspended = _consumerKey.isConsumerSetSuspended();

                if (!setStillSuspended)
                {
                    // clear the bit provided in the _suspendFlags
                    _suspendFlags &= ~suspendFlag;

                    if (_suspendFlags == 0) // No flags set so resume the consumer
                    {
                        _consumerSuspended = false;

                        // If the consumer is still active (started) we need
                        // to kickstart the consumer back into life to check for more
                        // messages
                        if (!_stopped && !_closing)
                        {
                            if (_asynchConsumerRegistered)
                            {
                                if (!_asynchConsumer.isAsynchConsumerRunning())
                                {
                                    // We'll have to take the full lock hierarchy and
                                    // possibly spin off another thread to start looking for more messages
                                    // (just like start())
                                    spinOffNewThread = true;
                                }
                            }
                            else
                            {
                                // Wake up any synchronous receivers
                                _waiter.signal();
                            }
                        }
                    }
                }
            }
        } finally
        {
            this.unlock();
        }

        // start a new thread to run the callback if we determined that it was necessary   
        if (spinOffNewThread)
        {
            try
            {
                _messageProcessor.startNewThread(new AsynchThread(this, false));
            } catch (InterruptedException e)
            {
                FFDCFilter.processException(
                                            e,
                                            "com.ibm.ws.sib.processor.impl.JSLocalConsumerPoint.resumeConsumer",
                                            "1:4978:1.22.5.1",
                                            this);

                SibTr.exception(tc, e);

                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    SibTr.exit(tc, "resumeConsumer", e);
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "resumeConsumer");
    }
953130
def set_operation_mode(self, mode):
        
        if mode == "off":
            desired_state = {"powered": False}
        else:
            desired_state = {"powered": True, "mode": mode}

        response = self.api_interface.set_device_state(self, {
            "desired_state": desired_state
        })

        self._update_state_from_response(response)
474116
@Override
    public void deregisterAsynchConsumerCallback()
                    throws SISessionUnavailableException, SISessionDroppedException,
                    SIErrorException,
                    SIIncorrectCallException
    {
        if (TraceComponent.isAnyTracingEnabled() && CoreSPIConsumerSession.tc.isEntryEnabled())
            SibTr.entry(CoreSPIConsumerSession.tc, "deregisterAsynchConsumerCallback", this);
        //Deregister the AsynchConsumer by registering null with the LCP
        //the other params don't matter
        registerAsynchConsumerCallback(null, 1, 0, 1, null);
        if (TraceComponent.isAnyTracingEnabled() && CoreSPIConsumerSession.tc.isEntryEnabled())
            SibTr.exit(CoreSPIConsumerSession.tc, "deregisterAsynchConsumerCallback");
    }