Archived

This forum has been archived. Please start a new discussion on GitHub.

How do you get an ObjectAdapter's state

In section 32.4.5 of the doco it says that an ObjectAdapter can have several states (holding, active, inactive), and that it can transition between holding and active as many times as you want.

But how do you find out the current state of an ObjectAdapter (ie. whether it is currently in the holding state, or the active state)? All I can find is the isDeactivated() function...

Comments

  • benoit
    benoit Rennes, France
    Hi Gary,

    There's no method to figure out whether or not the adapter is in the holding state. Your application needs to keep track of the object adapter state if it really needs this information. Note that it's fine to call hold multiple times on the object adapter so you don't really need to check whether or not the object adapter is in the holding state before calling hold.

    Cheers,
    Benoit.
  • Yeah, fair enough, that's the approach I had taken. I just thought I'd better check that I hadn't missed something.

    thanks!