Java Code Examples for com.sun.istack.internal.NotNull

The following examples show how to use com.sun.istack.internal.NotNull. These examples are extracted from open source projects. 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
/**
 * Finds the primary WSDL document from the list of metadata documents. If
 * there are two metadata documents that qualify for primary, it throws an
 * exception. If there are two metadata documents that qualify for porttype,
 * it throws an exception.
 *
 * @return primay wsdl document, null if is not there in the docList
 *
 */
private static @Nullable SDDocumentImpl findPrimary(@NotNull List<SDDocumentImpl> docList) {
    SDDocumentImpl primaryDoc = null;
    boolean foundConcrete = false;
    boolean foundAbstract = false;
    for(SDDocumentImpl doc : docList) {
        if (doc instanceof SDDocument.WSDL) {
            SDDocument.WSDL wsdlDoc = (SDDocument.WSDL)doc;
            if (wsdlDoc.hasService()) {
                primaryDoc = doc;
                if (foundConcrete) {
                    throw new ServerRtException("duplicate.primary.wsdl", doc.getSystemId() );
                }
                foundConcrete = true;
            }
            if (wsdlDoc.hasPortType()) {
                if (foundAbstract) {
                    throw new ServerRtException("duplicate.abstract.wsdl", doc.getSystemId());
                }
                foundAbstract = true;
            }
        }
    }
    return primaryDoc;
}
 
Example 2
private RuntimeWSDLParser(@NotNull String sourceLocation, XMLEntityResolver resolver, boolean isClientSide, Container container, PolicyResolver policyResolver, WSDLParserExtension... extensions) {
    this.wsdlDoc = sourceLocation!=null ? new WSDLModelImpl(sourceLocation) : new WSDLModelImpl();
    this.resolver = resolver;
    this.policyResolver = policyResolver;
    this.extensions = new ArrayList<WSDLParserExtension>();
    this.context = new WSDLParserExtensionContextImpl(wsdlDoc, isClientSide, container, policyResolver);

    boolean isPolicyExtensionFound = false;
    for (WSDLParserExtension e : extensions) {
            if (e instanceof com.sun.xml.internal.ws.api.wsdl.parser.PolicyWSDLParserExtension)
                    isPolicyExtensionFound = true;
        register(e);
    }

    // register handlers for default extensions
    if (!isPolicyExtensionFound)
            register(new PolicyWSDLParserExtension());
    register(new MemberSubmissionAddressingWSDLParserExtension());
    register(new W3CAddressingWSDLParserExtension());
    register(new W3CAddressingMetadataWSDLParserExtension());

    this.extensionFacade =  new WSDLParserExtensionFacade(this.extensions.toArray(new WSDLParserExtension[0]));
}
 
Example 3
Source Project: TencentKona-8   Source File: HttpAdapter.java    License: GNU General Public License v2.0 6 votes vote down vote up
private Packet decodePacket(@NotNull WSHTTPConnection con, @NotNull Codec codec) throws IOException {
    String ct = con.getRequestHeader("Content-Type");
    InputStream in = con.getInput();
    Packet packet = new Packet();
    packet.soapAction = fixQuotesAroundSoapAction(con.getRequestHeader("SOAPAction"));
    packet.wasTransportSecure = con.isSecure();
    packet.acceptableMimeTypes = con.getRequestHeader("Accept");
    packet.addSatellite(con);
    addSatellites(packet);
    packet.isAdapterDeliversNonAnonymousResponse = true;
    packet.component = this;
    packet.transportBackChannel = new Oneway(con);
    packet.webServiceContextDelegate = con.getWebServiceContextDelegate();
    packet.setState(Packet.State.ServerRequest);
    if (dump || LOGGER.isLoggable(Level.FINER)) {
        ByteArrayBuffer buf = new ByteArrayBuffer();
        buf.write(in);
        in.close();
        dump(buf, "HTTP request", con.getRequestHeaders());
        in = buf.newInputStream();
    }
    codec.decode(in, ct, packet);
    return packet;
}
 
Example 4
Source Project: TencentKona-8   Source File: StAXSource.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a new {@link javax.xml.transform.Source} for the given
 * {@link XMLStreamReader}.
 *
 * The XMLStreamReader must be pointing at either a
 * {@link javax.xml.stream.XMLStreamConstants#START_DOCUMENT} or
 * {@link javax.xml.stream.XMLStreamConstants#START_ELEMENT} event.
 *
 * @param reader XMLStreamReader that will be exposed as a Source
 * @param eagerQuit if true, when the conversion is completed, leave the cursor to the last
 *                  event that was fired (such as end element)
 * @param inscope inscope Namespaces
 *                array of the even length of the form { prefix0, uri0, prefix1, uri1, ... }
 * @throws IllegalArgumentException iff the reader is null
 * @throws IllegalStateException iff the reader is not pointing at either a
 * START_DOCUMENT or START_ELEMENT event
 */
public StAXSource(XMLStreamReader reader, boolean eagerQuit, @NotNull String[] inscope) {
    if( reader == null )
        throw new IllegalArgumentException();
    this.staxReader = reader;

    int eventType = reader.getEventType();
    if (!(eventType == XMLStreamConstants.START_DOCUMENT)
        && !(eventType == XMLStreamConstants.START_ELEMENT)) {
        throw new IllegalStateException();
    }

    this.reader = new XMLStreamReaderToContentHandler(reader,repeater,eagerQuit,false,inscope);

    super.setXMLReader(pseudoParser);
    // pass a dummy InputSource. We don't care
    super.setInputSource(new InputSource());
}
 
Example 5
@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));
}
 
Example 6
/**
 * Creates {@link UsesJAXBContextFeature}.
 * This version allows you to create {@link JAXBRIContext} upfront and uses it.
 */
public UsesJAXBContextFeature(@Nullable final JAXBRIContext context) {
    this.factory = new JAXBContextFactory() {
        @NotNull
        public JAXBRIContext createJAXBContext(@NotNull SEIModel sei, @NotNull List<Class> classesToBind, @NotNull List<TypeReference> typeReferences) throws JAXBException {
            return context;
        }
    };
}
 
Example 7
/**
 * Creates a default {@link InstanceResolver} that serves the given class.
 */
public static <T> InstanceResolver<T> createDefault(@NotNull Class<T> clazz) {
    InstanceResolver<T> ir = createFromInstanceResolverAnnotation(clazz);
    if(ir==null)
        ir = new SingletonResolver<T>(createNewInstance(clazz));
    return ir;
}
 
Example 8
/**
 * Reads this EPR as {@link XMLStreamReader}.
 *
 * @param localName
 *      EPR uses a different root tag name depending on the context.
 *      The returned {@link XMLStreamReader} will use the given local name
 *      for the root element name.
 */
public XMLStreamReader read(final @NotNull String localName) throws XMLStreamException {
    return new StreamReaderBufferProcessor(infoset) {
        @Override
        protected void processElement(String prefix, String uri, String _localName, boolean inScope) {
            if (_depth == 0) {
                _localName = localName;
            }
            super.processElement(prefix, uri, _localName, isInscope(infoset,_depth));
        }
    };
}
 
Example 9
Source Project: TencentKona-8   Source File: Internalizer.java    License: GNU General Public License v2.0 5 votes vote down vote up
@NotNull
static String fixNull(@Nullable String s) {
    if (s == null) {
        return "";
    } else {
        return s;
    }
}
 
Example 10
public ByteArrayAttachment(@NotNull String contentId, byte[] data, int start, int len, String mimeType) {
    this.contentId = contentId;
    this.data = data;
    this.start = start;
    this.len = len;
    this.mimeType = mimeType;
}
 
Example 11
private static MetroConfig loadMetroConfig(@NotNull URL resourceUrl) {
    MetroConfig result = null;
    try {
        JAXBContext jaxbContext = createJAXBContext();
        Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
        XMLInputFactory factory = XmlUtil.newXMLInputFactory(true);
        final JAXBElement<MetroConfig> configElement = unmarshaller.unmarshal(factory.createXMLStreamReader(resourceUrl.openStream()), MetroConfig.class);
        result = configElement.getValue();
    } catch (Exception e) {
        LOGGER.warning(TubelineassemblyMessages.MASM_0010_ERROR_READING_CFG_FILE_FROM_LOCATION(resourceUrl.toString()), e);
    }
    return result;
}
 
Example 12
/**
 * Creates an EPR from individual components.
 *
 * <p>
 * This version takes various information about metadata, and creates an EPR that has
 * the necessary embedded WSDL.
 */
public WSEndpointReference(@NotNull AddressingVersion version,
                           @NotNull String address,
                           @Nullable QName service,
                           @Nullable QName port,
                           @Nullable QName portType,
                           @Nullable List<Element> metadata,
                           @Nullable String wsdlAddress,
                           @Nullable List<Element> referenceParameters) {
   this(version, address, service, port, portType, metadata, wsdlAddress, null, referenceParameters, null, null);
}
 
Example 13
/**
 * Creates a {@link Tube} that does the monitoring of the invocation for a
 * container
 */
public @NotNull Tube createMonitoringTube(@NotNull Tube next) {
    ServerPipelineHook hook = endpoint.getContainer().getSPI(ServerPipelineHook.class);
    if (hook != null) {
        ServerPipeAssemblerContext ctxt = new ServerPipeAssemblerContext(seiModel, wsdlModel, endpoint, terminal, isSynchronous);
        return PipeAdapter.adapt(hook.createMonitoringPipe(ctxt, PipeAdapter.adapt(next)));
    }
    return next;
}
 
Example 14
/**
 * Creates a {@link Dispatch} that can be used to talk to this EPR.
 *
 * <p>
 * All the normal WS-Addressing processing happens automatically,
 * such as setting the endpoint address to {@link #getAddress() the address},
 * and sending the reference parameters associated with this EPR as
 * headers, etc.
 */
public @NotNull Dispatch<Object> createDispatch(
    @NotNull Service jaxwsService,
    @NotNull JAXBContext context,
    @NotNull Service.Mode mode,
    WebServiceFeature... features) {

    // TODO: implement it in a better way
    return jaxwsService.createDispatch(toSpec(),context,mode,features);
}
 
Example 15
Source Project: TencentKona-8   Source File: WSEndpointImpl.java    License: GNU General Public License v2.0 4 votes vote down vote up
public @NotNull Codec createCodec() {
        return masterCodec.copy();
}
 
Example 16
public @NotNull String getLocalPart() {
    return localName;
}
 
Example 17
@Override
@Property(value = {MessageContext.HTTP_REQUEST_HEADERS, Packet.INBOUND_TRANSPORT_HEADERS})
public @NotNull Map<String,List<String>> getRequestHeaders() {
    return httpExchange.getRequestHeaders();
}
 
Example 18
private static @NotNull String getJavaReservedVarialbeName(@NotNull String name) {
    String reservedName = reservedWords.get(name);
    return reservedName == null ? name : reservedName;
}
 
Example 19
public @NotNull NextAction processResponse(@NotNull Packet response) {
    return doReturnWith(response);
}
 
Example 20
Source Project: TencentKona-8   Source File: Bridge.java    License: GNU General Public License v2.0 4 votes vote down vote up
public final void marshal(@NotNull BridgeContext context,T object, ContentHandler contentHandler) throws JAXBException {
    marshal( ((BridgeContextImpl)context).marshaller, object, contentHandler );
}
 
Example 21
/**
 *
 * @param wsepr EndpointReference from which portName will be extracted.
 *      If EndpointName ( port name) is null in EPR, then it will try to get if from WSDLModel using portType QName
 * @param portTypeName
 *          should be null in dispatch case
 *          should be non null in SEI case
 * @return
 *      port name from EPR after validating various metadat elements.
 *      Also if service instance does n't have wsdl,
 *      then it gets the WSDL metadata from EPR and builds wsdl model.
 */
private QName getPortNameFromEPR(@NotNull WSEndpointReference wsepr, @Nullable QName portTypeName) {
    QName portName;
    WSEndpointReference.Metadata metadata = wsepr.getMetaData();
    QName eprServiceName = metadata.getServiceName();
    QName eprPortName = metadata.getPortName();
    if ((eprServiceName != null ) && !eprServiceName.equals(serviceName)) {
        throw new WebServiceException("EndpointReference WSDL ServiceName differs from Service Instance WSDL Service QName.\n"
                + " The two Service QNames must match");
    }
    if (wsdlService == null) {
        Source eprWsdlSource = metadata.getWsdlSource();
        if (eprWsdlSource == null) {
            throw new WebServiceException(ProviderApiMessages.NULL_WSDL());
        }
        try {
            WSDLModel eprWsdlMdl = parseWSDL(new URL(wsepr.getAddress()), eprWsdlSource, null);
            wsdlService = eprWsdlMdl.getService(serviceName);
            if (wsdlService == null)
                throw new WebServiceException(ClientMessages.INVALID_SERVICE_NAME(serviceName,
                        buildNameList(eprWsdlMdl.getServices().keySet())));
        } catch (MalformedURLException e) {
            throw new WebServiceException(ClientMessages.INVALID_ADDRESS(wsepr.getAddress()));
        }
    }
    portName = eprPortName;

    if (portName == null && portTypeName != null) {
        //get the first port corresponding to the SEI
        WSDLPort port = wsdlService.getMatchingPort(portTypeName);
        if (port == null)
            throw new WebServiceException(ClientMessages.UNDEFINED_PORT_TYPE(portTypeName));
        portName = port.getName();
    }
    if (portName == null)
        throw new WebServiceException(ProviderApiMessages.NULL_PORTNAME());
    if (wsdlService.get(portName) == null)
        throw new WebServiceException(ClientMessages.INVALID_EPR_PORT_NAME(portName, buildWsdlPortNames()));

    return portName;

}
 
Example 22
public ByteArrayAttachment(@NotNull String contentId, byte[] data, String mimeType) {
    this(contentId, data, 0, data.length, mimeType);
}
 
Example 23
@NotNull
public JAXBRIContext createJAXBContext(@NotNull SEIModel sei, @NotNull List<Class> classesToBind, @NotNull List<TypeReference> typeReferences) throws JAXBException {
    return JAXBRIContext.newInstance(classesToBind.toArray(new Class[classesToBind.size()]),
            typeReferences, null, sei.getTargetNamespace(), false, null);
}
 
Example 24
Source Project: TencentKona-8   Source File: DispatchImpl.java    License: GNU General Public License v2.0 4 votes vote down vote up
public final @NotNull QName getPortName() {
    return portname;
}
 
Example 25
/**
 * Adds a feature to the list if it's not already added.
 */
public void add(@NotNull WebServiceFeature f) {
    if(addNoValidate(f) && isValidating)
        validate(f);
}
 
Example 26
@Override
public NextAction processException(@NotNull Throwable t) {
    return doThrow(t);
}
 
Example 27
public @NotNull Collection<EPRExtension> getEPRExtensions() throws XMLStreamException {
    if (rootEprExtensions == null) {
        parseEPRExtensions();
    }
    return rootEprExtensions.values();
}
 
Example 28
@Nullable
public String getAttribute(@NotNull String nsUri, @NotNull String localName) {
    return null;
}
 
Example 29
Source Project: TencentKona-8   Source File: BindingImpl.java    License: GNU General Public License v2.0 4 votes vote down vote up
public @Nullable <F extends WebServiceFeature> F getOperationFeature(@NotNull Class<F> featureType,
        @NotNull final QName operationName) {
    final WebServiceFeatureList operationFeatureList = this.operationFeatures.get(operationName);
    return FeatureListUtil.mergeFeature(featureType, operationFeatureList, features);
}
 
Example 30
public @NotNull NextAction processResponse(@NotNull Packet response) {
    return doReturnWith(response);
}