use of com.sun.xml.ws.api.config.management.policy.ManagedClientAssertion in project metro-jax-ws by eclipse-ee4j.
the class RewritingMOM method createManagedObjectManager.
/**
* Client monitoring is OFF by default because there is
* no standard stub.close() method. Therefore people do
* not typically close a stub when they are done with it
* (even though the RI does provide a .close).
* <pre>
* prop | no assert | assert/no mon | assert/mon off | assert/mon on
* -------------------------------------------------------------------
* not set | off | off | off | on
* false | off | off | off | off
* true | on | on | off | on
* </pre>
*/
@NotNull
public ManagedObjectManager createManagedObjectManager(final Stub stub) {
EndpointAddress ea = stub.requestContext.getEndpointAddress();
if (ea == null) {
return ManagedObjectManagerFactory.createNOOP();
}
String rootName = ea.toString();
final ManagedClientAssertion assertion = ManagedClientAssertion.getAssertion(stub.getPortInfo());
if (assertion != null) {
final String id = assertion.getId();
if (id != null) {
rootName = id;
}
if (assertion.monitoringAttribute() == Setting.OFF) {
return disabled("This client", rootName);
} else if (assertion.monitoringAttribute() == Setting.ON && clientMonitoring != Setting.OFF) {
return createMOMLoop(rootName, 0);
}
}
if (clientMonitoring == Setting.NOT_SET || clientMonitoring == Setting.OFF) {
return disabled("Global client", rootName);
}
return createMOMLoop(rootName, 0);
}
Aggregations