use of org.apache.cxf.ws.eventing.shared.handlers.ReferenceParametersAddingHandler in project cxf by apache.
the class SubscriptionEndNotificationTask method run.
@Override
public void run() {
try {
// needed SOAP handlers
ReferenceParametersAddingHandler handler = new ReferenceParametersAddingHandler(target.getNotificationReferenceParams());
JaxWsProxyFactoryBean service = new JaxWsProxyFactoryBean();
service.getOutInterceptors().add(new LoggingOutInterceptor());
service.setServiceClass(EndToEndpoint.class);
service.setAddress(target.getEndToURL());
service.getHandlers().add(handler);
EndToEndpoint endpoint = (EndToEndpoint) service.create();
SubscriptionEnd message = new SubscriptionEnd();
message.setStatus(status.toString());
if (reason != null) {
LanguageSpecificStringType reasonElement = new LanguageSpecificStringType();
reasonElement.setLang("en-US");
reasonElement.setValue(reason);
message.getReason().add(reasonElement);
}
endpoint.subscriptionEnd(message);
} catch (Exception e) {
e.printStackTrace();
}
}
use of org.apache.cxf.ws.eventing.shared.handlers.ReferenceParametersAddingHandler in project cxf by apache.
the class SimpleEventingIntegrationTest method createSubscriptionManagerClient.
/**
* Convenience method to create a client for the testing Subscription Manager
* which is located at local://SimpleSubscriptionManager.
* You have to specify the reference parameters you obtained from the Event Source
* when your subscription was created.
*
* @return a JAX-WS client set up for managing the subscription you had created using the Event Source
*/
public SubscriptionManagerEndpoint createSubscriptionManagerClient(ReferenceParametersType refs) {
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setBus(bus);
factory.setServiceClass(SubscriptionManagerEndpoint.class);
factory.setAddress(URL_SUBSCRIPTION_MANAGER);
factory.getInInterceptors().add(new LoggingInInterceptor());
factory.getOutInterceptors().add(new LoggingOutInterceptor());
ReferenceParametersAddingHandler handler = new ReferenceParametersAddingHandler(refs);
factory.getHandlers().add(handler);
return (SubscriptionManagerEndpoint) factory.create();
}
use of org.apache.cxf.ws.eventing.shared.handlers.ReferenceParametersAddingHandler in project cxf by apache.
the class EventSinkInterfaceNotificationTask method getProxy.
protected Object getProxy(Class<?> sinkInterface, Class<?>... extraClasses) {
// needed SOAP handlers
ReferenceParametersAddingHandler handler = new ReferenceParametersAddingHandler(target.getNotificationReferenceParams());
JaxWsProxyFactoryBean service = new JaxWsProxyFactoryBean();
service.getOutInterceptors().add(new LoggingOutInterceptor());
service.setServiceClass(sinkInterface);
service.setAddress(target.getTargetURL());
service.getHandlers().add(handler);
// do we need to apply a filter?
if (target.getFilter() != null && target.getFilter().getContent().size() > 0) {
service.getOutInterceptors().add(new FilteringInterceptor(target.getFilter()));
}
if (extraClasses != null && extraClasses.length > 0) {
Map<String, Object> props = new HashMap<>();
props.put("jaxb.additionalContextClasses", extraClasses);
service.getClientFactoryBean().getServiceFactory().setProperties(props);
}
return service.create();
}
Aggregations