public FIStaxInInterceptor(String phase) { super(phase); addBefore(StaxInInterceptor.class.getName()); }
protected boolean isHttpVerbSupported(Message message) { if (isGET(message)) { return isRequestor(message) && MessageUtils.getContextualBoolean(message, FI_GET_SUPPORTED, false); } return true; } }
@Override protected void initializeProvider(InterceptorProvider provider, Bus bus) { FIStaxInInterceptor in = new FIStaxInInterceptor();
public void handleMessage(Message message) { if (message.getContent(XMLStreamReader.class) != null || !isHttpVerbSupported(message)) { return; } String ct = (String)message.get(Message.CONTENT_TYPE); if (ct != null && ct.indexOf("fastinfoset") != -1 && message.getContent(InputStream.class) != null && message.getContent(XMLStreamReader.class) == null) { message.setContent(XMLStreamReader.class, getParser(message.getContent(InputStream.class))); //add the StaxInEndingInterceptor which will close the reader message.getInterceptorChain().add(StaxInEndingInterceptor.INSTANCE); ct = ct.replace("fastinfoset", "xml"); if (ct.contains("application/xml")) { ct = ct.replace("application/xml", "text/xml"); } message.put(Message.CONTENT_TYPE, ct); message.getExchange().put(FIStaxOutInterceptor.FI_ENABLED, Boolean.TRUE); if (isRequestor(message)) { //record the fact that is worked so future requests will //automatically be FI enabled Endpoint ep = message.getExchange().getEndpoint(); ep.put(FIStaxOutInterceptor.FI_ENABLED, Boolean.TRUE); } } }
@Override protected void initializeProvider(InterceptorProvider provider, Bus bus) { FIStaxInInterceptor in = new FIStaxInInterceptor();
public void handleMessage(Message message) { if (message.getContent(XMLStreamReader.class) != null || !isHttpVerbSupported(message)) { return; } String ct = (String)message.get(Message.CONTENT_TYPE); if (ct != null && ct.indexOf("fastinfoset") != -1 && message.getContent(InputStream.class) != null && message.getContent(XMLStreamReader.class) == null) { message.setContent(XMLStreamReader.class, getParser(message.getContent(InputStream.class))); //add the StaxInEndingInterceptor which will close the reader message.getInterceptorChain().add(StaxInEndingInterceptor.INSTANCE); ct = ct.replace("fastinfoset", "xml"); if (ct.contains("application/xml")) { ct = ct.replace("application/xml", "text/xml"); } message.put(Message.CONTENT_TYPE, ct); message.getExchange().put(FIStaxOutInterceptor.FI_ENABLED, Boolean.TRUE); if (isRequestor(message)) { //record the fact that is worked so future requests will //automatically be FI enabled Endpoint ep = message.getExchange().getEndpoint(); ep.put(FIStaxOutInterceptor.FI_ENABLED, Boolean.TRUE); } } }
@Override protected void initializeProvider(InterceptorProvider provider, Bus bus) { FIStaxInInterceptor in = new FIStaxInInterceptor(); FIStaxOutInterceptor out = new FIStaxOutInterceptor(force); if (serializerAttributeValueMapMemoryLimit != null && serializerAttributeValueMapMemoryLimit.intValue() > 0) { out.setSerializerAttributeValueMapMemoryLimit(serializerAttributeValueMapMemoryLimit); } if (serializerMinAttributeValueSize != null && serializerMinAttributeValueSize.intValue() > 0) { out.setSerializerMinAttributeValueSize(serializerMinAttributeValueSize); } if (serializerMaxAttributeValueSize != null && serializerMaxAttributeValueSize.intValue() > 0) { out.setSerializerMaxAttributeValueSize(serializerMaxAttributeValueSize); } if (serializerCharacterContentChunkMapMemoryLimit != null && serializerCharacterContentChunkMapMemoryLimit.intValue() > 0) { out.setSerializerCharacterContentChunkMapMemoryLimit( serializerCharacterContentChunkMapMemoryLimit); } if (serializerMinCharacterContentChunkSize != null && serializerMinCharacterContentChunkSize.intValue() > 0) { out.setSerializerMinCharacterContentChunkSize(serializerMinCharacterContentChunkSize); } if (serializerMaxCharacterContentChunkSize != null && serializerMaxCharacterContentChunkSize.intValue() > 0) { out.setSerializerMaxCharacterContentChunkSize(serializerMaxCharacterContentChunkSize); } provider.getInInterceptors().add(in); provider.getInFaultInterceptors().add(in); provider.getOutInterceptors().add(out); provider.getOutFaultInterceptors().add(out); }
public void handleMessage(Message message) { if (message.getContent(XMLStreamReader.class) != null || !isHttpVerbSupported(message)) { return; } String ct = (String)message.get(Message.CONTENT_TYPE); if (ct != null && ct.indexOf("fastinfoset") != -1 && message.getContent(InputStream.class) != null && message.getContent(XMLStreamReader.class) == null) { message.setContent(XMLStreamReader.class, getParser(message.getContent(InputStream.class))); //add the StaxInEndingInterceptor which will close the reader message.getInterceptorChain().add(StaxInEndingInterceptor.INSTANCE); ct = ct.replace("fastinfoset", "xml"); if (ct.contains("application/xml")) { ct = ct.replace("application/xml", "text/xml"); } message.put(Message.CONTENT_TYPE, ct); message.getExchange().put(FIStaxOutInterceptor.FI_ENABLED, Boolean.TRUE); if (isRequestor(message)) { //record the fact that is worked so future requests will //automatically be FI enabled Endpoint ep = message.getExchange().getEndpoint(); ep.put(FIStaxOutInterceptor.FI_ENABLED, Boolean.TRUE); } } }
protected boolean isHttpVerbSupported(Message message) { if (isGET(message)) { return isRequestor(message) && MessageUtils.getContextualBoolean(message, FI_GET_SUPPORTED, false); } return true; } }
public FIStaxInInterceptor(String phase) { super(phase); addBefore(StaxInInterceptor.class.getName()); }
@Override protected void initializeProvider(InterceptorProvider provider, Bus bus) { FIStaxInInterceptor in = new FIStaxInInterceptor(); FIStaxOutInterceptor out = new FIStaxOutInterceptor(force); if (serializerAttributeValueMapMemoryLimit != null && serializerAttributeValueMapMemoryLimit.intValue() > 0) { out.setSerializerAttributeValueMapMemoryLimit(serializerAttributeValueMapMemoryLimit); } if (serializerMinAttributeValueSize != null && serializerMinAttributeValueSize.intValue() > 0) { out.setSerializerMinAttributeValueSize(serializerMinAttributeValueSize); } if (serializerMaxAttributeValueSize != null && serializerMaxAttributeValueSize.intValue() > 0) { out.setSerializerMaxAttributeValueSize(serializerMaxAttributeValueSize); } if (serializerCharacterContentChunkMapMemoryLimit != null && serializerCharacterContentChunkMapMemoryLimit.intValue() > 0) { out.setSerializerCharacterContentChunkMapMemoryLimit( serializerCharacterContentChunkMapMemoryLimit); } if (serializerMinCharacterContentChunkSize != null && serializerMinCharacterContentChunkSize.intValue() > 0) { out.setSerializerMinCharacterContentChunkSize(serializerMinCharacterContentChunkSize); } if (serializerMaxCharacterContentChunkSize != null && serializerMaxCharacterContentChunkSize.intValue() > 0) { out.setSerializerMaxCharacterContentChunkSize(serializerMaxCharacterContentChunkSize); } provider.getInInterceptors().add(in); provider.getInFaultInterceptors().add(in); provider.getOutInterceptors().add(out); provider.getOutFaultInterceptors().add(out); }
public void handleMessage(Message message) { if (message.getContent(XMLStreamReader.class) != null || !isHttpVerbSupported(message)) { return; } String ct = (String)message.get(Message.CONTENT_TYPE); if (ct != null && ct.indexOf("fastinfoset") != -1 && message.getContent(InputStream.class) != null && message.getContent(XMLStreamReader.class) == null) { message.setContent(XMLStreamReader.class, getParser(message.getContent(InputStream.class))); //add the StaxInEndingInterceptor which will close the reader message.getInterceptorChain().add(StaxInEndingInterceptor.INSTANCE); ct = ct.replace("fastinfoset", "xml"); if (ct.contains("application/xml")) { ct = ct.replace("application/xml", "text/xml"); } message.put(Message.CONTENT_TYPE, ct); message.getExchange().put(FIStaxOutInterceptor.FI_ENABLED, Boolean.TRUE); if (isRequestor(message)) { //record the fact that is worked so future requests will //automatically be FI enabled Endpoint ep = message.getExchange().getEndpoint(); ep.put(FIStaxOutInterceptor.FI_ENABLED, Boolean.TRUE); } } }
protected boolean isHttpVerbSupported(Message message) { if (isGET(message)) { if (isRequestor(message) && MessageUtils.isTrue(message.getContextualProperty(FI_GET_SUPPORTED))) { return true; } return false; } else { return true; } } }
public FIStaxInInterceptor(String phase) { super(phase); addBefore(StaxInInterceptor.class.getName()); }
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); // This enables FastInfoset as the communication protocol factory.getInInterceptors().add( new FIStaxInInterceptor() ); factory.getOutInterceptors().add( new FIStaxOutInterceptor() ); ... other code to set username, location, etc. goes here. client = (C360Server) factory.create();
protected boolean isHttpVerbSupported(Message message) { if (isGET(message)) { if (isRequestor(message) && MessageUtils.isTrue(message.getContextualProperty(FI_GET_SUPPORTED))) { return true; } return false; } else { return true; } } }
public FIStaxInInterceptor(String phase) { super(phase); addBefore(StaxInInterceptor.class.getName()); }
private void addFastInfosetSupport(InterceptorProvider provider, FastInfoset annotation) { if (annotation != null) { FIStaxInInterceptor in = new FIStaxInInterceptor(); FIStaxOutInterceptor out = new FIStaxOutInterceptor(annotation.force()); out.setSerializerAttributeValueMapMemoryLimit(annotation.serializerAttributeValueMapMemoryLimit()); out.setSerializerMinAttributeValueSize(annotation.serializerMinAttributeValueSize()); out.setSerializerMaxAttributeValueSize(annotation.serializerMaxAttributeValueSize()); out.setSerializerCharacterContentChunkMapMemoryLimit( annotation.serializerCharacterContentChunkMapMemoryLimit()); out.setSerializerMinCharacterContentChunkSize(annotation.serializerMinCharacterContentChunkSize()); out.setSerializerMaxCharacterContentChunkSize(annotation.serializerMaxCharacterContentChunkSize()); provider.getInInterceptors().add(in); provider.getInFaultInterceptors().add(in); provider.getOutInterceptors().add(out); provider.getOutFaultInterceptors().add(out); } }
private void addFastInfosetSupport(InterceptorProvider provider, FastInfoset annotation) { if (annotation != null) { FIStaxInInterceptor in = new FIStaxInInterceptor(); FIStaxOutInterceptor out = new FIStaxOutInterceptor(annotation.force()); out.setSerializerAttributeValueMapMemoryLimit(annotation.serializerAttributeValueMapMemoryLimit()); out.setSerializerMinAttributeValueSize(annotation.serializerMinAttributeValueSize()); out.setSerializerMaxAttributeValueSize(annotation.serializerMaxAttributeValueSize()); out.setSerializerCharacterContentChunkMapMemoryLimit( annotation.serializerCharacterContentChunkMapMemoryLimit()); out.setSerializerMinCharacterContentChunkSize(annotation.serializerMinCharacterContentChunkSize()); out.setSerializerMaxCharacterContentChunkSize(annotation.serializerMaxCharacterContentChunkSize()); provider.getInInterceptors().add(in); provider.getInFaultInterceptors().add(in); provider.getOutInterceptors().add(out); provider.getOutFaultInterceptors().add(out); } }
private void addFastInfosetSupport(InterceptorProvider provider, FastInfoset annotation) { if (annotation != null) { FIStaxInInterceptor in = new FIStaxInInterceptor(); FIStaxOutInterceptor out = new FIStaxOutInterceptor(annotation.force()); out.setSerializerAttributeValueMapMemoryLimit(annotation.serializerAttributeValueMapMemoryLimit()); out.setSerializerMinAttributeValueSize(annotation.serializerMinAttributeValueSize()); out.setSerializerMaxAttributeValueSize(annotation.serializerMaxAttributeValueSize()); out.setSerializerCharacterContentChunkMapMemoryLimit( annotation.serializerCharacterContentChunkMapMemoryLimit()); out.setSerializerMinCharacterContentChunkSize(annotation.serializerMinCharacterContentChunkSize()); out.setSerializerMaxCharacterContentChunkSize(annotation.serializerMaxCharacterContentChunkSize()); provider.getInInterceptors().add(in); provider.getInFaultInterceptors().add(in); provider.getOutInterceptors().add(out); provider.getOutFaultInterceptors().add(out); } }