本文整理汇总了Java中org.springframework.ws.server.EndpointInterceptor类的典型用法代码示例。如果您正苦于以下问题:Java EndpointInterceptor类的具体用法?Java EndpointInterceptor怎么用?Java EndpointInterceptor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EndpointInterceptor类属于org.springframework.ws.server包,在下文中一共展示了EndpointInterceptor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: shouldInvoke
import org.springframework.ws.server.EndpointInterceptor; //导入依赖的package包/类
private boolean shouldInvoke(MessageContext messageContext) throws Exception {
List<EndpointMapping> endpointMappings = messageDispatcher.getEndpointMappings();
// There should be only one endpoint mapped in the module: check it
Assert.isTrue(endpointMappings != null && endpointMappings.size() == 1);
EndpointMapping endpointMapping = endpointMappings.iterator().next();
for (EndpointInterceptor endpointInterceptor : endpointMapping.getEndpoint(messageContext).getInterceptors()) {
// Check to see if the interceptor is directly an instance of a service specific interceptor.
// If so, we don't have to fall back to our default delegate
if (endpointInterceptor instanceof ServiceSpecificEndpointInterceptor) {
return false;
}
// Check to see if the interceptor is decorated by DelegatingSmartEndpointInterceptor
// Unfortunately there is no standard API way of detecting this, so we need some reflection.
// If so, check that the decorated instance is instance of a service specific interceptor.
// If so, we don't have to fall back to our default delegate
if (endpointInterceptor instanceof DelegatingSmartEndpointInterceptor) {
if (FieldUtils.readField(endpointInterceptor, "delegate", true) instanceof ServiceSpecificEndpointInterceptor) {
return false;
}
}
}
return true;
}
开发者ID:koen-serneels,项目名称:ws-proxy,代码行数:26,代码来源:DefaultInterceptorExecutor.java
示例2: handleResponse
import org.springframework.ws.server.EndpointInterceptor; //导入依赖的package包/类
/**
* Processes response using interceptors.
* @param messageContext
* @throws IOException
*/
protected void handleResponse(MessageContext messageContext) throws IOException {
if (!interceptors.isEmpty())
{
boolean hasFault = hasFault(messageContext);
for (EndpointInterceptor interceptor:interceptors)
{
try {
if (!hasFault)
{
if (!interceptor.handleResponse(messageContext, null)) return;
}
else
{
if (!interceptor.handleFault(messageContext, null)) return;
}
} catch (Exception e) {
throw new IOException("Unexpected exception",e);
}
}
}
}
开发者ID:lukas-krecan,项目名称:spring-ws-test,代码行数:27,代码来源:MockWebServiceConnection.java
示例3: wrapEndpointInterceptors
import org.springframework.ws.server.EndpointInterceptor; //导入依赖的package包/类
/**
* Wraps all intrceptors in the array.
* @param endpointInterceptors
* @return
*/
public static ClientInterceptor[] wrapEndpointInterceptors(EndpointInterceptor[] endpointInterceptors)
{
if (endpointInterceptors!=null)
{
ClientInterceptor[] result = new ClientInterceptor[endpointInterceptors.length];
for (int i=0; i<endpointInterceptors.length; i++)
{
result[i]= new EndpointInterceptorClientAdapter(endpointInterceptors[i]);
}
return result;
}
else
{
return new ClientInterceptor[0];
}
}
开发者ID:lukas-krecan,项目名称:smock,代码行数:22,代码来源:EndpointInterceptorClientAdapter.java
示例4: getObject
import org.springframework.ws.server.EndpointInterceptor; //导入依赖的package包/类
public EndpointInterceptor getObject() throws Exception {
if(useSecurity){
return wss4jSecurityInterceptor;
}else{
return noneSecurityInterceptor;
}
}
开发者ID:bsteker,项目名称:bdf2,代码行数:8,代码来源:EndpointSecurityInterceptor.java
示例5: createEndpointInvocationChain
import org.springframework.ws.server.EndpointInterceptor; //导入依赖的package包/类
@Override
protected final EndpointInvocationChain createEndpointInvocationChain(MessageContext messageContext, Object endpoint, EndpointInterceptor[] interceptors) {
for (EndpointMappingKey key : endpoints.keySet()) {
if (EndpointMappingType.SOAP_ACTION.equals(key.getType())) {
Object messageKey = getSoapAction(messageContext);
if (messageKey != null && key.getLookupKey().equals(messageKey)) {
return new SoapEndpointInvocationChain(endpoint, interceptors, actorsOrRoles, isUltimateReceiver);
}
}
}
return super.createEndpointInvocationChain(messageContext, endpoint, interceptors);
}
开发者ID:HydAu,项目名称:Camel,代码行数:13,代码来源:CamelEndpointMapping.java
示例6: handleRequest
import org.springframework.ws.server.EndpointInterceptor; //导入依赖的package包/类
/**
* Iterates over all interceptors. If one of them returns false, false is returned. True is returned otherwise.
* @param messageContext
* @return
* @throws IOException
*/
protected boolean handleRequest(MessageContext messageContext) throws IOException {
for (EndpointInterceptor interceptor:interceptors)
{
try {
if (!interceptor.handleRequest(messageContext, null))
{
return false;
}
} catch (Exception e) {
throw new IOException("Unexpected exception",e);
}
}
return true;
}
开发者ID:lukas-krecan,项目名称:spring-ws-test,代码行数:21,代码来源:MockWebServiceConnection.java
示例7: testCreateConnection
import org.springframework.ws.server.EndpointInterceptor; //导入依赖的package包/类
@Test
public void testCreateConnection() throws Exception
{
AbstractMockWebServiceMessageSender sender = new MockWebServiceMessageSender();
URI uri = new URI("http://example.org/");
assertTrue(sender.supports(uri));
List<EndpointInterceptor> interceptors = Arrays.<EndpointInterceptor>asList(new PayloadLoggingInterceptor());
sender.setInterceptors(interceptors);
MockWebServiceConnection connection = (MockWebServiceConnection) sender.createConnection(uri);
assertNotNull(connection);
assertEquals(interceptors, connection.getInterceptors());
}
开发者ID:lukas-krecan,项目名称:spring-ws-test,代码行数:15,代码来源:MockWebServiceMessageSenderTest.java
示例8: testInterceptorsOk
import org.springframework.ws.server.EndpointInterceptor; //导入依赖的package包/类
@Test
public void testInterceptorsOk() throws Exception
{
WebServiceMessage request = createMock(WebServiceMessage.class);
List<EndpointInterceptor> interceptors = new ArrayList<EndpointInterceptor>();
EndpointInterceptor interceptor1 = createMock(EndpointInterceptor.class);
expect(interceptor1.handleRequest((MessageContext)anyObject(), isNull())).andReturn(true);
expect(interceptor1.handleResponse((MessageContext)anyObject(), isNull())).andReturn(true);
interceptors.add(interceptor1);
connection.setInterceptors(interceptors);
RequestProcessor requestProcessor = createMock(RequestProcessor.class);
WebServiceMessage response = createMock(WebServiceMessage.class);
connection.setRequestProcessors(Collections.singletonList(requestProcessor));
expect(requestProcessor.processRequest(uri, messageFactory, request)).andReturn(response);
replay(request, response, interceptor1, requestProcessor);
connection.send(request);
assertSame(response, connection.receive(messageFactory));
verify(request, response, interceptor1, requestProcessor);
}
开发者ID:lukas-krecan,项目名称:spring-ws-test,代码行数:28,代码来源:MockWebServiceConnectionTest.java
示例9: testHandleFault
import org.springframework.ws.server.EndpointInterceptor; //导入依赖的package包/类
@Test
public void testHandleFault() throws Exception
{
WebServiceMessage request = createMock(WebServiceMessage.class);
List<EndpointInterceptor> interceptors = new ArrayList<EndpointInterceptor>();
EndpointInterceptor interceptor1 = createMock(EndpointInterceptor.class);
expect(interceptor1.handleRequest((MessageContext)anyObject(), isNull())).andReturn(true);
expect(interceptor1.handleFault((MessageContext)anyObject(), isNull())).andReturn(true);
interceptors.add(interceptor1);
connection.setInterceptors(interceptors);
RequestProcessor requestProcessor = createMock(RequestProcessor.class);
WebServiceMessage response = createMessage("xml/fault.xml");
connection.setRequestProcessors(Collections.singletonList(requestProcessor));
expect(requestProcessor.processRequest(uri, messageFactory, request)).andReturn(response);
replay(request, interceptor1, requestProcessor);
connection.send(request);
assertSame(response, connection.receive(messageFactory));
verify(request, interceptor1, requestProcessor);
}
开发者ID:lukas-krecan,项目名称:spring-ws-test,代码行数:28,代码来源:MockWebServiceConnectionTest.java
示例10: createServer
import org.springframework.ws.server.EndpointInterceptor; //导入依赖的package包/类
/**
* Creates a {@code MockWebServiceServer} instance based on the given {@link WebServiceTemplate}.
* Supports interceptors that will be applied on the incomming message. Please note that acctually the interceptoes will
* be added to the {@link ClientInterceptor} set on the client side. it's an ugly hack, but that's the only way to do it
* without reimplementing the whole testing library. I hope it will change in next releases.
*
* @param webServiceTemplate the web service template
* @return the created server
*/
public static MockWebServiceServer createServer(WebServiceTemplate webServiceTemplate, EndpointInterceptor[] interceptors) {
if (interceptors!=null && interceptors.length>0)
{
List<ClientInterceptor> newInterceptors = new ArrayList<ClientInterceptor>();
if (webServiceTemplate.getInterceptors()!=null)
{
newInterceptors.addAll(Arrays.asList(webServiceTemplate.getInterceptors()));
}
newInterceptors.addAll(Arrays.asList(EndpointInterceptorClientAdapter.wrapEndpointInterceptors(interceptors)));
webServiceTemplate.setInterceptors(newInterceptors.toArray(new ClientInterceptor[newInterceptors.size()]));
}
return MockWebServiceServer.createServer(webServiceTemplate);
}
开发者ID:lukas-krecan,项目名称:smock,代码行数:23,代码来源:SmockClient.java
示例11: testWrapOne
import org.springframework.ws.server.EndpointInterceptor; //导入依赖的package包/类
@Test
public void testWrapOne()
{
ClientInterceptor[] endpointInterceptors = EndpointInterceptorClientAdapter.wrapEndpointInterceptors(new EndpointInterceptor[]{new PayloadLoggingInterceptor()});
assertEquals(1, endpointInterceptors.length);
assertEquals(EndpointInterceptorClientAdapter.class, endpointInterceptors[0].getClass());
}
开发者ID:lukas-krecan,项目名称:smock,代码行数:8,代码来源:EndpointInterceptorClientAdapterTest.java
示例12: testWrapperHandleRequest
import org.springframework.ws.server.EndpointInterceptor; //导入依赖的package包/类
@Test
public void testWrapperHandleRequest() throws Exception
{
MessageContext messageContext = createMock(MessageContext.class);
EndpointInterceptor interceptor = createMock(EndpointInterceptor.class);
expect(interceptor.handleRequest(messageContext, null)).andReturn(true);
replay(interceptor);
EndpointInterceptorClientAdapter adapter = new EndpointInterceptorClientAdapter(interceptor);
adapter.handleRequest(messageContext);
verify(interceptor);
}
开发者ID:lukas-krecan,项目名称:smock,代码行数:15,代码来源:EndpointInterceptorClientAdapterTest.java
示例13: testWrapperHandleResponse
import org.springframework.ws.server.EndpointInterceptor; //导入依赖的package包/类
@Test
public void testWrapperHandleResponse() throws Exception
{
MessageContext messageContext = createMock(MessageContext.class);
EndpointInterceptor interceptor = createMock(EndpointInterceptor.class);
expect(interceptor.handleResponse(messageContext, null)).andReturn(true);
replay(interceptor);
EndpointInterceptorClientAdapter adapter = new EndpointInterceptorClientAdapter(interceptor);
adapter.handleResponse(messageContext);
verify(interceptor);
}
开发者ID:lukas-krecan,项目名称:smock,代码行数:15,代码来源:EndpointInterceptorClientAdapterTest.java
示例14: testWrapperHandleFault
import org.springframework.ws.server.EndpointInterceptor; //导入依赖的package包/类
@Test
public void testWrapperHandleFault() throws Exception
{
MessageContext messageContext = createMock(MessageContext.class);
EndpointInterceptor interceptor = createMock(EndpointInterceptor.class);
expect(interceptor.handleFault(messageContext, null)).andReturn(true);
replay(interceptor);
EndpointInterceptorClientAdapter adapter = new EndpointInterceptorClientAdapter(interceptor);
adapter.handleFault(messageContext);
verify(interceptor);
}
开发者ID:lukas-krecan,项目名称:smock,代码行数:15,代码来源:EndpointInterceptorClientAdapterTest.java
示例15: traceeWsConfigurerAdapter
import org.springframework.ws.server.EndpointInterceptor; //导入依赖的package包/类
/**
* Provides a WsConfigurerAdapter that adds the traceeEndpointInterceptor to the list of EndpointInterceptors.
*/
@Bean
WsConfigurerAdapter traceeWsConfigurerAdapter(final TraceeEndpointInterceptor traceeEndpointInterceptor) {
return new WsConfigurerAdapter() {
@Override
public void addInterceptors(List<EndpointInterceptor> interceptors) {
super.addInterceptors(Collections.<EndpointInterceptor>singletonList(traceeEndpointInterceptor));
}
};
}
开发者ID:tracee,项目名称:tracee,代码行数:13,代码来源:TraceeSpringWsConfiguration.java
示例16: addInterceptors
import org.springframework.ws.server.EndpointInterceptor; //导入依赖的package包/类
@Override
public void addInterceptors(List<EndpointInterceptor> interceptors) {
interceptors.add(securityInterceptor());
}
开发者ID:in28minutes,项目名称:spring-web-services,代码行数:5,代码来源:WebServiceConfig.java
示例17: getObjectType
import org.springframework.ws.server.EndpointInterceptor; //导入依赖的package包/类
public Class<?> getObjectType() {
return EndpointInterceptor.class;
}
开发者ID:bsteker,项目名称:bdf2,代码行数:4,代码来源:EndpointSecurityInterceptor.java
示例18: addInterceptors
import org.springframework.ws.server.EndpointInterceptor; //导入依赖的package包/类
@Override
public void addInterceptors(List<EndpointInterceptor> interceptors) {
interceptors.add(new SoapEnvelopeLoggingInterceptor());
interceptors.add(new ServiceEndpointInterceptor());
interceptors.add(new WsdlCdataInterceptor());
}
开发者ID:vrk-kpa,项目名称:xroad-catalog,代码行数:7,代码来源:WebServiceConfig.java
示例19: addInterceptors
import org.springframework.ws.server.EndpointInterceptor; //导入依赖的package包/类
@Override
public void addInterceptors(List<EndpointInterceptor> interceptors) {
// register the LogHttpHeaderEndpointInterceptor
interceptors.add(new LogHttpHeaderEndpointInterceptor());
}
开发者ID:code-not-found,项目名称:spring-ws,代码行数:6,代码来源:WebServiceConfig.java
示例20: addInterceptors
import org.springframework.ws.server.EndpointInterceptor; //导入依赖的package包/类
@Override
public void addInterceptors(List<EndpointInterceptor> interceptors) {
interceptors.add(serverSecurityInterceptor());
}
开发者ID:code-not-found,项目名称:spring-ws,代码行数:5,代码来源:WebServiceConfig.java
注:本文中的org.springframework.ws.server.EndpointInterceptor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论