本文整理匯總了Java中org.apache.cxf.phase.AbstractPhaseInterceptor類的典型用法代碼示例。如果您正苦於以下問題:Java AbstractPhaseInterceptor類的具體用法?Java AbstractPhaseInterceptor怎麽用?Java AbstractPhaseInterceptor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
AbstractPhaseInterceptor類屬於org.apache.cxf.phase包,在下文中一共展示了AbstractPhaseInterceptor類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setPluginService
import org.apache.cxf.phase.AbstractPhaseInterceptor; //導入依賴的package包/類
@Inject
public void setPluginService(PluginService pluginService)
{
endpointTracker = new PluginTracker<Object>(pluginService, "com.tle.web.remoting.soap", "endpoint", "path").setBeanKey("bean");
interceptorTracker = new PluginTracker<AbstractPhaseInterceptor<? extends Message>>(pluginService, "com.tle.web.remoting.soap",
"interceptor", null);
endpointIntTracker = new PluginTracker<Object>(pluginService, "com.tle.web.remoting.soap", "endpoint-interface", null)
.setBeanKey("bean");
}
示例2: handleMessage
import org.apache.cxf.phase.AbstractPhaseInterceptor; //導入依賴的package包/類
public void handleMessage(Message message) throws Fault {
String method = (String)message.get(Message.HTTP_REQUEST_METHOD);
String query = (String)message.get(Message.QUERY_STRING);
if (!"GET".equals(method) || StringUtils.isEmpty(query)) {
return;
}
String baseUri = (String)message.get(Message.REQUEST_URL);
String ctx = (String)message.get(Message.PATH_INFO);
Map<String, String> map = UrlUtils.parseQueryString(query);
if (isRecognizedQuery(map, baseUri, ctx, message.getExchange().getEndpoint().getEndpointInfo())) {
Document doc = getDocument(message, baseUri, map, ctx);
Endpoint e = message.getExchange().get(Endpoint.class);
Message mout = new MessageImpl();
mout.setExchange(message.getExchange());
mout = e.getBinding().createMessage(mout);
mout.setInterceptorChain(OutgoingChainInterceptor.getOutInterceptorChain(message.getExchange()));
message.getExchange().setOutMessage(mout);
mout.put(DOCUMENT_HOLDER, doc);
Iterator<Interceptor<? extends Message>> iterator = mout.getInterceptorChain().iterator();
while (iterator.hasNext()) {
Interceptor<? extends Message> inInterceptor = iterator.next();
if (inInterceptor instanceof AbstractPhaseInterceptor) {
AbstractPhaseInterceptor<?> interceptor = (AbstractPhaseInterceptor<?>)inInterceptor;
if (interceptor.getPhase().equals(Phase.PREPARE_SEND)
|| interceptor.getPhase().equals(Phase.PRE_STREAM)) {
// just make sure we keep the right interceptors
continue;
}
}
mout.getInterceptorChain().remove(inInterceptor);
}
// notice this is being added after the purge above, don't swap the order!
mout.getInterceptorChain().add(RawMessageWSDLGetOutInterceptor.INSTANCE);
// skip the service executor and goto the end of the chain.
message.getInterceptorChain().doInterceptStartingAt(
message,
OutgoingChainInterceptor.class.getName());
}
}