Yesterday one of my colleagues called in to ask how to retrieve the state of a composite.
The first important piece to understand is that there are two parts to the state
a) active | retired (this setting decides whether new instances can be created [active], or old ones are allowed to finish w/o new ones being allowed to be created [retired] - this is referred to as composite mode
b) on | off (this is the composite state) and overrides (a) in either allowing call access [invoke / callback] to the composite revision [on] or not at all [off]. This is referred to as composite state.
This entry explained how to find a specific instance back via composite sensor values, instance id, or conversation id, yet the starting point is the same.
From oracle.soa.management.facade.Locator one can use getComposite(CompositeDN), which gets you to the composite (an impl of oracle.soa.management.facade.Composite)
In order to retrieve the mode (a) and the state (b) - use the api (and unfortunately the implementation).
System.out.println("Mode: " + composite.getMode() + " state: " +
((oracle.soa.management.internal.facade.CompositeImpl)composite).getState());
This will get you something along the below line
Mode: active state: on.
A few comments in general on the api