@Override public @NotNull Tube createClient(@NotNull ClientTubeAssemblerContext context) { ClientPipeAssemblerContext ctxt = new ClientPipeAssemblerContext( context.getAddress(), context.getWsdlModel(), context.getService(), context.getBinding(), context.getContainer()); return PipeAdapter.adapt(assembler.createClient(ctxt)); }
public NextAction processRequest(@NotNull Packet request) { if(request.endpointAddress==address) // cache hit return transport.processRequest(request); // cache miss if(transport!=null) { // delete the current entry transport.preDestroy(); transport = null; address = null; } // otherwise find out what transport will process this. ClientTubeAssemblerContext newContext = new ClientTubeAssemblerContext( request.endpointAddress, context.getWsdlModel(), context.getBindingProvider(), context.getBinding(), context.getContainer(), context.getCodec().copy(), context.getSEIModel(), context.getSEI() ); address = request.endpointAddress; transport = TransportTubeFactory.create(classLoader, newContext); // successful return from the above method indicates a successful pipe creation assert transport!=null; return transport.processRequest(request); }
@NotNull public Tube createClient(ClientTubeAssemblerContext context) { Tube head = context.createTransportTube(); head = context.createSecurityTube(head); if (dump) { // for debugging inject a dump pipe. this is left in the production code, // as it would be very handy for a trouble-shooting at the production site. head = context.createDumpTube("client", System.out, head); } head = context.createWsaTube(head); head = context.createClientMUTube(head); head = context.createValidationTube(head); return context.createHandlerTube(head); }
protected Tube createHttpTransport(ClientTubeAssemblerContext context) { return new HttpTransportPipe(context.getCodec(), context.getBinding()); }
@Override public Tube doCreate(ClientTubeAssemblerContext context) { if (context.getAddress().getURI().getScheme().equalsIgnoreCase("jms")) { return wsJmsTransportFactory.createJmsTransportTube(context.getCodec(), context.getService().getServiceName()); } return null; }
/** * The endpoint address. Always non-null. This parameter is taken separately * from {@link com.sun.xml.ws.api.model.wsdl.WSDLPort} (even though there's {@link com.sun.xml.ws.api.model.wsdl.WSDLPort#getAddress()}) * because sometimes WSDL is not available. */ public @NotNull EndpointAddress getAddress() { return wrappedContext.getAddress(); }
public DeferredTransportPipe(ClassLoader classLoader, ClientTubeAssemblerContext context) { this.classLoader = classLoader; this.context = context; if (context.getBinding().getFeature(HttpConfigFeature.class) == null) { context.getBinding().getFeatures().mergeFeatures( new WebServiceFeature[] { new HttpConfigFeature() }, false); } //See if we can create the transport pipe from the available information. try { this.transport = TransportTubeFactory.create(classLoader, context); this.address = context.getAddress(); } catch(Exception e) { //No problem, transport will be initialized while processing the requests } }
/** * Gets the {@link Codec} that is set by {@link #setCodec} or the default codec * based on the binding. * * @return codec to be used for web service requests */ public @NotNull Codec getCodec() { return wrappedContext.getCodec(); }
/** * The pipeline is created for this {@link com.sun.xml.ws.api.WSService}. * Always non-null. (To be precise, the newly created pipeline * is owned by a proxy or a dispatch created from this {@link com.sun.xml.ws.api.WSService}.) */ public @NotNull WSService getService() { return wrappedContext.getService(); }
/** * Creates a {@link Pipe} that performs SOAP mustUnderstand processing. * This pipe should be before HandlerPipes. */ public Pipe createClientMUPipe(Pipe next) { return PipeAdapter.adapt(super.createClientMUTube(PipeAdapter.adapt(next))); }
/** * creates a {@link Pipe} that validates messages against schema */ public Pipe createValidationPipe(Pipe next) { return PipeAdapter.adapt(super.createValidationTube(PipeAdapter.adapt(next))); }
/** * Creates a {@link Pipe} that invokes protocol and logical handlers. */ public Pipe createHandlerPipe(Pipe next) { return PipeAdapter.adapt(super.createHandlerTube(PipeAdapter.adapt(next))); }
/** * Creates a transport pipe (for client), which becomes the terminal pipe. */ public Pipe createTransportPipe() { return PipeAdapter.adapt(super.createTransportTube()); }
/** * Creates a new pipeline for the given port name. */ private Tube createPipeline(WSPortInfo portInfo, WSBinding binding) { //Check all required WSDL extensions are understood checkAllWSDLExtensionsUnderstood(portInfo, binding); SEIModel seiModel = null; Class sei = null; if (portInfo instanceof SEIPortInfo) { SEIPortInfo sp = (SEIPortInfo) portInfo; seiModel = sp.model; sei = sp.sei; } BindingID bindingId = portInfo.getBindingId(); TubelineAssembler assembler = TubelineAssemblerFactory.create( Thread.currentThread().getContextClassLoader(), bindingId, owner.getContainer()); if (assembler == null) { throw new WebServiceException("Unable to process bindingID=" + bindingId); // TODO: i18n } return assembler.createClient( new ClientTubeAssemblerContext( portInfo.getEndpointAddress(), portInfo.getPort(), this, binding, owner.getContainer(), ((BindingImpl) binding).createCodec(), seiModel, sei)); }
/** * creates a {@link Pipe} that dumps messages that pass through. */ public Pipe createDumpPipe(String name, PrintStream out, Pipe next) { return PipeAdapter.adapt(super.createDumpTube(name, out, PipeAdapter.adapt(next))); }
/** * Creates a {@link Tube} that adds container specific security */ public @NotNull Pipe createSecurityPipe(@NotNull Pipe next) { return PipeAdapter.adapt(super.createSecurityTube(PipeAdapter.adapt(next))); }
/** * The endpoint address. Always non-null. This parameter is taken separately * from {@link com.sun.xml.ws.api.model.wsdl.WSDLPort} (even though there's {@link com.sun.xml.ws.api.model.wsdl.WSDLPort#getAddress()}) * because sometimes WSDL is not available. */ public @NotNull EndpointAddress getAddress() { return wrappedContext.getAddress(); }
protected Tube createHttpTransport(ClientTubeAssemblerContext context) { return new HttpTransportPipe(context.getCodec(), context.getBinding()); }
public DeferredTransportPipe(ClassLoader classLoader, ClientTubeAssemblerContext context) { this.classLoader = classLoader; this.context = context; if (context.getBinding().getFeature(HttpConfigFeature.class) == null) { context.getBinding().getFeatures().mergeFeatures( new WebServiceFeature[] { new HttpConfigFeature() }, false); } //See if we can create the transport pipe from the available information. try { this.transport = TransportTubeFactory.create(classLoader, context); this.address = context.getAddress(); } catch(Exception e) { //No problem, transport will be initialized while processing the requests } }
/** * Gets the {@link Codec} that is set by {@link #setCodec} or the default codec * based on the binding. * * @return codec to be used for web service requests */ public @NotNull Codec getCodec() { return wrappedContext.getCodec(); }