com.sun.xml.internal.ws.api.pipe.Tube Java Examples

The following examples show how to use com.sun.xml.internal.ws.api.pipe.Tube. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Stub.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void close() {
    TubePool tp = (TubePool) tubes;
    if (tp != null) {
        // multi-thread safety of 'close' needs to be considered more carefully.
        // some calls might be pending while this method is invoked. Should we
        // block until they are complete, or should we abort them (but how?)
        Tube p = tp.takeMaster();
        p.preDestroy();
        tubes = null;
    }
    if (!managedObjectManagerClosed) {
        try {
            final ObjectName name = managedObjectManager.getObjectName(managedObjectManager.getRoot());
            // The name is null when the MOM is a NOOP.
            if (name != null) {
                monitoringLogger.log(Level.INFO, "Closing Metro monitoring root: {0}", name);
            }
            managedObjectManager.close();
        } catch (java.io.IOException e) {
            monitoringLogger.log(Level.WARNING, "Ignoring error when closing Managed Object Manager", e);
        }
        managedObjectManagerClosed = true;
    }
}
 
Example #2
Source File: Stub.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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));
}
 
Example #3
Source File: Stub.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void close() {
    TubePool tp = (TubePool) tubes;
    if (tp != null) {
        // multi-thread safety of 'close' needs to be considered more carefully.
        // some calls might be pending while this method is invoked. Should we
        // block until they are complete, or should we abort them (but how?)
        Tube p = tp.takeMaster();
        p.preDestroy();
        tubes = null;
    }
    if (!managedObjectManagerClosed) {
        try {
            final ObjectName name = managedObjectManager.getObjectName(managedObjectManager.getRoot());
            // The name is null when the MOM is a NOOP.
            if (name != null) {
                monitoringLogger.log(Level.INFO, "Closing Metro monitoring root: {0}", name);
            }
            managedObjectManager.close();
        } catch (java.io.IOException e) {
            monitoringLogger.log(Level.WARNING, "Ignoring error when closing Managed Object Manager", e);
        }
        managedObjectManagerClosed = true;
    }
}
 
Example #4
Source File: Stub.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void close() {
    TubePool tp = (TubePool) tubes;
    if (tp != null) {
        // multi-thread safety of 'close' needs to be considered more carefully.
        // some calls might be pending while this method is invoked. Should we
        // block until they are complete, or should we abort them (but how?)
        Tube p = tp.takeMaster();
        p.preDestroy();
        tubes = null;
    }
    if (!managedObjectManagerClosed) {
        try {
            final ObjectName name = managedObjectManager.getObjectName(managedObjectManager.getRoot());
            // The name is null when the MOM is a NOOP.
            if (name != null) {
                monitoringLogger.log(Level.INFO, "Closing Metro monitoring root: {0}", name);
            }
            managedObjectManager.close();
        } catch (java.io.IOException e) {
            monitoringLogger.log(Level.WARNING, "Ignoring error when closing Managed Object Manager", e);
        }
        managedObjectManagerClosed = true;
    }
}
 
Example #5
Source File: TubelineAssemblyContextImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
boolean setTubelineHead(Tube newHead) {
    if (newHead == head || newHead == adaptedHead) {
        return false;
    }

    head = newHead;
    tubes.add(head);
    adaptedHead = null;

    if (LOGGER.isLoggable(Level.FINER)) {
        LOGGER.finer(MessageFormat.format("Added '{0}' tube instance to the tubeline.", (newHead == null) ? null : newHead.getClass().getName()));
    }

    return true;
}
 
Example #6
Source File: TubelineAssemblyContextImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public <T> T getImplementation(Class<T> type) {
    for (Tube tube : tubes) {
        if (type.isInstance(tube)) {
            return type.cast(tube);
        }
    }
    return null;
}
 
Example #7
Source File: PipeAdapter.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public static Tube adapt(Pipe p) {
    if (p instanceof Tube) {
        return (Tube) p;
    } else {
        return new PipeAdapter(p);
    }
}
 
Example #8
Source File: MUTube.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
protected MUTube(WSBinding binding, Tube next) {
    super(next);
    // MUPipe should n't be used for bindings other than SOAP.
    if (!(binding instanceof SOAPBinding)) {
        throw new WebServiceException(
                "MUPipe should n't be used for bindings other than SOAP.");
    }
    this.binding = (SOAPBindingImpl) binding;
    this.soapVersion = binding.getSOAPVersion();
}
 
Example #9
Source File: WsaTube.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public WsaTube(WSDLPort wsdlPort, WSBinding binding, Tube next) {
    super(next);
    this.wsdlPort = wsdlPort;
    this.binding = binding;
    addKnownHeadersToBinding(binding);
    addressingVersion = binding.getAddressingVersion();
    soapVersion = binding.getSOAPVersion();
    helper = getTubeHelper();
    addressingRequired = AddressingVersion.isRequired(binding);
}
 
Example #10
Source File: PipeAdapter.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public static Tube adapt(Pipe p) {
    if (p instanceof Tube) {
        return (Tube) p;
    } else {
        return new PipeAdapter(p);
    }
}
 
Example #11
Source File: SEIStub.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Deprecated
public SEIStub(WSServiceDelegate owner, BindingImpl binding, SOAPSEIModel seiModel, Tube master, WSEndpointReference epr) {
    super(owner, master, binding, seiModel.getPort(), seiModel.getPort().getAddress(), epr);
    this.seiModel = seiModel;
    this.soapVersion = binding.getSOAPVersion();
    databinding = seiModel.getDatabinding();
    initMethodHandlers();
}
 
Example #12
Source File: TubelineAssemblyDecorator.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Tube decorateClient(Tube tube, ClientTubelineAssemblyContext context) {
    for (TubelineAssemblyDecorator decorator : decorators) {
        tube = decorator.decorateClient(tube, context);
    }
    return tube;
}
 
Example #13
Source File: TubelineAssemblyDecorator.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Tube decorateClientTail(
        Tube tube,
        ClientTubelineAssemblyContext context) {
    for (TubelineAssemblyDecorator decorator : decorators) {
        tube = decorator.decorateClientTail(tube, context);
    }
    return tube;
}
 
Example #14
Source File: WsaTube.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public WsaTube(WSDLPort wsdlPort, WSBinding binding, Tube next) {
    super(next);
    this.wsdlPort = wsdlPort;
    this.binding = binding;
    addKnownHeadersToBinding(binding);
    addressingVersion = binding.getAddressingVersion();
    soapVersion = binding.getSOAPVersion();
    helper = getTubeHelper();
    addressingRequired = AddressingVersion.isRequired(binding);
}
 
Example #15
Source File: DispatchImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Deprecated
public static Dispatch<Source> createSourceDispatch(QName port, Mode mode, WSServiceDelegate owner, Tube pipe, BindingImpl binding, WSEndpointReference epr) {
    if(isXMLHttp(binding))
        return new RESTSourceDispatch(port,mode,owner,pipe,binding,epr);
    else
        return new SOAPSourceDispatch(port,mode,owner,pipe,binding,epr);
}
 
Example #16
Source File: MUTube.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected MUTube(WSBinding binding, Tube next) {
    super(next);
    // MUPipe should n't be used for bindings other than SOAP.
    if (!(binding instanceof SOAPBinding)) {
        throw new WebServiceException(
                "MUPipe should n't be used for bindings other than SOAP.");
    }
    this.binding = (SOAPBindingImpl) binding;
    this.soapVersion = binding.getSOAPVersion();
}
 
Example #17
Source File: LoggingDumpTube.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public LoggingDumpTube(Level loggingLevel, Position position, Tube tubelineHead) {
    super(tubelineHead);

    this.position = position;
    this.loggingLevel = loggingLevel;

    this.tubeId = ID_GENERATOR.incrementAndGet();
}
 
Example #18
Source File: ServerSchemaValidationTube.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public ServerSchemaValidationTube(WSEndpoint endpoint, WSBinding binding,
        SEIModel seiModel, WSDLPort wsdlPort, Tube next) {
    super(binding, next);
    this.seiModel = seiModel;
    this.wsdlPort = wsdlPort;

    if (endpoint.getServiceDefinition() != null) {
        MetadataResolverImpl mdresolver = new MetadataResolverImpl(endpoint.getServiceDefinition());
        Source[] sources = getSchemaSources(endpoint.getServiceDefinition(), mdresolver);
        for(Source source : sources) {
            LOGGER.fine("Constructing service validation schema from = "+source.getSystemId());
            //printDOM((DOMSource)source);
        }
        if (sources.length != 0) {
            noValidation = false;
            sf.setResourceResolver(mdresolver);
            try {
                schema = sf.newSchema(sources);
            } catch(SAXException e) {
                throw new WebServiceException(e);
            }
            validator = schema.newValidator();
            return;
        }
    }
    noValidation = true;
    schema = null;
    validator = null;
}
 
Example #19
Source File: StandaloneTubeAssembler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@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);
}
 
Example #20
Source File: AbstractTubeImpl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
protected final NextAction doInvoke(Tube next, Packet packet) {
    NextAction na = new NextAction();
    na.invoke(next,packet);
    return na;
}
 
Example #21
Source File: HandlerTubeFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public Tube createTube(ServerTubelineAssemblyContext context) throws WebServiceException {
    return context.getWrappedContext().createHandlerTube(context.getTubelineHead());
}
 
Example #22
Source File: ServerMessageHandlerTube.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public ServerMessageHandlerTube(SEIModel seiModel, WSBinding binding, Tube next, HandlerTube cousinTube) {
    super(next, cousinTube, binding);
    this.seiModel = seiModel;
    setUpHandlersOnce();
}
 
Example #23
Source File: RESTSourceDispatch.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
@Deprecated
public RESTSourceDispatch(QName port, Mode mode, WSServiceDelegate owner, Tube pipe, BindingImpl binding, WSEndpointReference epr) {
    super(port, mode, owner, pipe, binding, epr);
    assert isXMLHttp(binding);
}
 
Example #24
Source File: PacketDispatch.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public PacketDispatch(WSPortInfo portInfo, Tube pipe, BindingImpl binding, WSEndpointReference epr, boolean allowFaultResponseMsg) {
    super(portInfo, Mode.MESSAGE, pipe, binding, epr, allowFaultResponseMsg);
    isDeliverThrowableInPacket = calculateIsDeliverThrowableInPacket(binding);
}
 
Example #25
Source File: Stub.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public Pool<Tube> getTubes() {
    return tubes;
}
 
Example #26
Source File: AbstractSchemaValidationTube.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public AbstractSchemaValidationTube(WSBinding binding, Tube next) {
    super(next);
    this.binding = binding;
    feature = binding.getFeature(SchemaValidationFeature.class);
    sf = allowExternalAccess(SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI), "file", false);
}
 
Example #27
Source File: BasicTransportTubeFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public Tube createTube(ServerTubelineAssemblyContext context) throws WebServiceException {
    return context.getTubelineHead();
}
 
Example #28
Source File: MessageDispatch.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
@Deprecated
public MessageDispatch(QName port, WSServiceDelegate service, Tube pipe, BindingImpl binding, WSEndpointReference epr) {
    super(port, Mode.MESSAGE, service, pipe, binding, epr);
}
 
Example #29
Source File: ValidationTubeFactory.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Tube createTube(ServerTubelineAssemblyContext context) throws WebServiceException {
    return context.getWrappedContext().createValidationTube(context.getTubelineHead());
}
 
Example #30
Source File: TubelineAssemblyDecorator.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public Tube decorateServer(Tube tube, ServerTubelineAssemblyContext context) {
    for (TubelineAssemblyDecorator decorator : decorators) {
        tube = decorator.decorateServer(tube, context);
    }
    return tube;
}