本文整理汇总了Java中org.apache.cxf.endpoint.Endpoint.put方法的典型用法代码示例。如果您正苦于以下问题:Java Endpoint.put方法的具体用法?Java Endpoint.put怎么用?Java Endpoint.put使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cxf.endpoint.Endpoint
的用法示例。
在下文中一共展示了Endpoint.put方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupEndpoint
import org.apache.cxf.endpoint.Endpoint; //导入方法依赖的package包/类
protected void setupEndpoint(Endpoint ep) {
resetPartTypes(ep.getBinding());
Class<?> fmt = Source.class;
if (ep.getBinding() instanceof SoapBinding) {
ep.getInInterceptors().add(new SAAJInInterceptor());
SAAJOutInterceptor out = new SAAJOutInterceptor();
ep.getOutInterceptors().add(out);
ep.getOutInterceptors().add(new CxfMessageSoapHeaderOutInterceptor());
ep.getOutInterceptors().add(new MessageModeOutInterceptor(out, ep.getBinding().getBindingInfo().getName()));
fmt = SOAPMessage.class;
} else {
ep.getOutInterceptors().add(new MessageModeOutInterceptor(Source.class, ep.getBinding().getBindingInfo().getName()));
}
ep.getInInterceptors().add(new MessageModeInInterceptor(fmt, ep.getBinding().getBindingInfo().getName()));
ep.put(AbstractInDatabindingInterceptor.NO_VALIDATE_PARTS, Boolean.TRUE);
// need to remove the wrapper class and holder interceptor
removeInterceptors(ep.getInInterceptors(), REMOVING_IN_INTERCEPTORS);
removeInterceptors(ep.getOutInterceptors(), REMOVING_OUT_INTERCEPTORS);
}
示例2: newFactory
import org.apache.cxf.endpoint.Endpoint; //导入方法依赖的package包/类
private JAXRSServerFactoryBean newFactory(final String prefix, final String service, final String endpoint) {
final JAXRSServerFactoryBean factory = new JAXRSServerFactoryBean() {
@Override
protected Endpoint createEndpoint() throws BusException, EndpointException {
final Endpoint created = super.createEndpoint();
created.put(ManagedEndpoint.SERVICE_NAME, service);
created.put(ManagedEndpoint.ENDPOINT_NAME, endpoint);
return created;
}
};
factory.setDestinationFactory(transportFactory);
factory.setBus(CxfUtil.getBus());
factory.setAddress(prefix);
return factory;
}
示例3: configureWSSecurity
import org.apache.cxf.endpoint.Endpoint; //导入方法依赖的package包/类
private <T> void configureWSSecurity(Dispatch<T> dispatch) {
if (this.mcf.getAsSecurityType() == WSManagedConnectionFactory.SecurityType.WSSecurity) {
Bus bus = BusFactory.getThreadDefaultBus();
BusFactory.setThreadDefaultBus(this.mcf.getBus());
try {
Client client = ((DispatchImpl)dispatch).getClient();
Endpoint ep = client.getEndpoint();
// spring configuration file
if (this.mcf.getOutInterceptors() != null) {
for (Interceptor i : this.mcf.getOutInterceptors()) {
ep.getOutInterceptors().add(i);
}
}
// ws-security pass-thru from custom jaas domain
Subject subject = ConnectionContext.getSubject();
if (subject != null) {
WSSecurityCredential credential = ConnectionContext.getSecurityCredential(subject, WSSecurityCredential.class);
if (credential != null) {
if (credential.useSts()) {
dispatch.getRequestContext().put(SecurityConstants.STS_CLIENT, credential.buildStsClient(bus));
}
if(credential.getSecurityHandler() == WSSecurityCredential.SecurityHandler.WSS4J) {
ep.getOutInterceptors().add(new WSS4JOutInterceptor(credential.getRequestPropterties()));
ep.getInInterceptors().add(new WSS4JInInterceptor(credential.getResponsePropterties()));
}
else if (credential.getSecurityHandler() == WSSecurityCredential.SecurityHandler.WSPOLICY) {
dispatch.getRequestContext().putAll(credential.getRequestPropterties());
dispatch.getResponseContext().putAll(credential.getResponsePropterties());
}
}
// When properties are set on subject treat them as they can configure WS-Security
HashMap<String, String> properties = ConnectionContext.getSecurityCredential(subject, HashMap.class);
for (String key:properties.keySet()) {
if (key.startsWith("ws-security.")) { //$NON-NLS-1$
ep.put(key, properties.get(key));
}
}
}
} finally {
BusFactory.setThreadDefaultBus(bus);
}
}
}