Java Code Examples for org.apache.cxf.common.util.StringUtils

The following examples show how to use org.apache.cxf.common.util.StringUtils. 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
Source Project: cxf   Source File: OldLoggingFactoryBeanListener.java    License: Apache License 2.0 6 votes vote down vote up
private LogEventSender createEventSender(String location) {
    if (StringUtils.isEmpty(location)) {
        return null;
    }
    if ("<stdout>".equals(location)) {
        return new PrintWriterEventSender(System.out);
    } else if ("<stderr>".equals(location)) {
        return new PrintWriterEventSender(System.err);                
    } else if (location.startsWith("file:")) {
        try {
            URI uri = new URI(location);
            File file = new File(uri);
            PrintWriter writer = new PrintWriter(new FileWriter(file, true), true);
            return new PrintWriterEventSender(writer);
        } catch (Exception ex) {
            //stick with default
        }
    }
    return null;
}
 
Example 2
Source Project: cxf   Source File: MAPAggregatorImpl.java    License: Apache License 2.0 6 votes vote down vote up
private String getActionFromFaultMessage(final OperationInfo operation, final String faultName) {
    if (operation.getFaults() != null) {
        for (FaultInfo faultInfo : operation.getFaults()) {
            if (isSameFault(faultInfo, faultName)) {
                if (faultInfo.getExtensionAttributes() != null) {
                    String faultAction = InternalContextUtils.getAction(faultInfo);
                    if (!StringUtils.isEmpty(faultAction)) {
                        return faultAction;
                    }
                }
                return addPath(addPath(addPath(getActionBaseUri(operation),
                                               operation.getName().getLocalPart()),
                                       "Fault"),
                               faultInfo.getFaultName().getLocalPart());
            }
        }
    }
    return addPath(addPath(addPath(getActionBaseUri(operation),
                                   operation.getName().getLocalPart()), "Fault"), faultName);
}
 
Example 3
Source Project: cxf   Source File: AbstractTokenService.java    License: Apache License 2.0 6 votes vote down vote up
protected Client getClientFromTLSCertificates(SecurityContext sc,
                                              TLSSessionInfo tlsSessionInfo,
                                              MultivaluedMap<String, String> params) {
    Client client = null;
    if (OAuthUtils.isMutualTls(sc, tlsSessionInfo)) {
        X509Certificate cert = OAuthUtils.getRootTLSCertificate(tlsSessionInfo);
        String subjectDn = OAuthUtils.getSubjectDnFromTLSCertificates(cert);
        if (!StringUtils.isEmpty(subjectDn)) {
            client = getClient(subjectDn, params);
            validateClientAuthenticationMethod(client, OAuthConstants.TOKEN_ENDPOINT_AUTH_TLS);
            // The certificates must be registered with the client and match TLS certificates
            // in case of the binding where Client's clientId is a subject distinguished name
            compareTlsCertificates(tlsSessionInfo, client.getApplicationCertificates());
            OAuthUtils.setCertificateThumbprintConfirmation(getMessageContext(), cert);
        }
    }
    return client;
}
 
Example 4
Source Project: cxf   Source File: WSDLToCorbaHelper.java    License: Apache License 2.0 6 votes vote down vote up
protected QName checkPrefix(QName schematypeName) {
    QName name = schematypeName;
    if ((name != null) && (name.getPrefix() == null || name.getPrefix().isEmpty())) {
        if (StringUtils.isEmpty(name.getNamespaceURI())) {
            return name;
        }
        String prefix = def.getPrefix(name.getNamespaceURI());
        if (prefix == null) {
            prefix = xmlSchemaList.getSchemaByTargetNamespace(name.getNamespaceURI())
                .getNamespaceContext().getPrefix(name.getNamespaceURI());
        }
        if (prefix != null) {
            return new QName(name.getNamespaceURI(),
                             name.getLocalPart(),
                             prefix);
        }
        return null;
    }

    return name;
}
 
Example 5
Source Project: cxf   Source File: Wrapper.java    License: Apache License 2.0 6 votes vote down vote up
private WrapperBeanClass merge(final WrapperBeanClass c1, final WrapperBeanClass c2) {
    if (c1.getElementName() == null) {
        c1.setElementName(c2.getElementName());
    }

    if (StringUtils.isEmpty(c1.getNamespace())) {
        c1.setNamespace(c2.getNamespace());
    }

    if (StringUtils.isEmpty(c1.getPackageName())) {
        c1.setPackageName(c2.getPackageName());
    } else {
        this.isSamePackage = c1.getPackageName().equals(c2.getPackageName());
    }


    if (StringUtils.isEmpty(c1.getName())) {
        c1.setName(c2.getName());
    }
    return c1;
}
 
Example 6
Source Project: cxf   Source File: OAuthUtils.java    License: Apache License 2.0 6 votes vote down vote up
public static boolean checkRequestURI(String servletPath, String uri) {
    boolean wildcard = uri.endsWith("*");
    String theURI = wildcard ? uri.substring(0, uri.length() - 1) : uri;
    try {
        URITemplate template = new URITemplate(theURI);
        MultivaluedMap<String, String> map = new MetadataMap<>();
        if (template.match(servletPath, map)) {
            String finalGroup = map.getFirst(URITemplate.FINAL_MATCH_GROUP);
            if (wildcard || StringUtils.isEmpty(finalGroup) || "/".equals(finalGroup)) {
                return true;
            }
        }
    } catch (Exception ex) {
        // ignore
    }
    return false;
}
 
Example 7
Source Project: cxf   Source File: HttpUtils.java    License: Apache License 2.0 6 votes vote down vote up
public static String getHeaderString(List<String> values) {
    if (values == null) {
        return null;
    }
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < values.size(); i++) {
        String value = values.get(i);
        if (StringUtils.isEmpty(value)) {
            continue;
        }
        sb.append(value);
        if (i + 1 < values.size()) {
            sb.append(',');
        }
    }
    return sb.toString();
}
 
Example 8
Source Project: cxf   Source File: AbstractBeanDefinitionParser.java    License: Apache License 2.0 6 votes vote down vote up
protected void addBusWiringAttribute(BeanDefinitionBuilder bean,
                                     BusWiringType type,
                                     String busName,
                                     ParserContext ctx) {
    LOG.fine("Adding " + WIRE_BUS_ATTRIBUTE + " attribute " + type + " to bean " + bean);
    bean.getRawBeanDefinition().setAttribute(WIRE_BUS_ATTRIBUTE, type);
    if (!StringUtils.isEmpty(busName)) {
        bean.getRawBeanDefinition().setAttribute(WIRE_BUS_NAME,
                busName.charAt(0) == '#' ? busName.substring(1) : busName);
    }

    if (ctx != null
        && !ctx.getRegistry().containsBeanDefinition(WIRE_BUS_HANDLER)) {
        BeanDefinitionBuilder b
            = BeanDefinitionBuilder.rootBeanDefinition(WIRE_BUS_HANDLER);
        ctx.getRegistry().registerBeanDefinition(WIRE_BUS_HANDLER, b.getBeanDefinition());
    }
}
 
Example 9
Source Project: cxf   Source File: CircuitBreakerTargetSelector.java    License: Apache License 2.0 6 votes vote down vote up
private synchronized CircuitBreaker getCircuitBreaker(final String alternateAddress) {
    CircuitBreaker circuitBreaker = null;

    if (!StringUtils.isEmpty(alternateAddress)) {
        for (Map.Entry<String, CircuitBreaker> entry: circuits.entrySet()) {
            if (alternateAddress.startsWith(entry.getKey())) {
                circuitBreaker = entry.getValue();
                break;
            }
        }

        if (circuitBreaker == null) {
            circuitBreaker = new ZestCircuitBreaker(threshold, timeout);
            circuits.put(alternateAddress, circuitBreaker);
        }
    }

    if (circuitBreaker == null) {
        circuitBreaker = NOOP_CIRCUIT_BREAKER;
    }

    return circuitBreaker;
}
 
Example 10
Source Project: cxf   Source File: JaxWsServiceConfiguration.java    License: Apache License 2.0 6 votes vote down vote up
public Boolean isWrapperPartQualified(MessagePartInfo mpi) {
    Annotation[] annotations = (Annotation[])mpi.getProperty("parameter.annotations");
    if (annotations != null) {
        for (Annotation an : annotations) {
            String tns = null;
            if (an instanceof WebParam) {
                tns = ((WebParam)an).targetNamespace();
            } else if (an instanceof WebResult) {
                tns = ((WebResult)an).targetNamespace();
            }
            if (tns != null && !StringUtils.isEmpty(tns)) {
                return Boolean.TRUE;
            }
        }
    }
    return null;
}
 
Example 11
Source Project: cxf   Source File: OSGIBusListener.java    License: Apache License 2.0 6 votes vote down vote up
public OSGIBusListener(Bus b, Object[] args) {
    bus = b;
    if (args != null && args.length > 0
        && args[0] instanceof BundleContext) {
        defaultContext = (BundleContext)args[0];
    }
    String extExcludes = (String)bus.getProperty(BUS_EXTENSION_BUNDLES_EXCLUDES);
    if (!StringUtils.isEmpty(extExcludes)) {
        try {
            extensionBundlesExcludesPattern = Pattern.compile(extExcludes);
        } catch (IllegalArgumentException e) {
            // ignore
        }
    }
    BusLifeCycleManager manager = bus.getExtension(BusLifeCycleManager.class);
    manager.registerLifeCycleListener(this);
    registerConfiguredBeanLocator();
    registerClientLifeCycleListeners();
    registerServerLifecycleListeners();
    registerBusFeatures();
    sendBusCreatedToBusCreationListeners();

}
 
Example 12
Source Project: cxf   Source File: PolicyEngineBPDefinitionParser.java    License: Apache License 2.0 6 votes vote down vote up
public Metadata parse(Element element, ParserContext context) {
    MutableBeanMetadata policyEngineConfig = context.createMetadata(MutableBeanMetadata.class);

    policyEngineConfig.setRuntimeClass(PolicyEngineConfig.class);

    String bus = element.getAttribute("bus");
    if (StringUtils.isEmpty(bus)) {
        bus = "cxf";
    }
    policyEngineConfig.addArgument(getBusRef(context, bus), Bus.class.getName(), 0);

    parseAttributes(element, context, policyEngineConfig);
    parseChildElements(element, context, policyEngineConfig);

    policyEngineConfig.setId(PolicyEngineConfig.class.getName() + context.generateId());

    return policyEngineConfig;
}
 
Example 13
Source Project: cxf   Source File: JaxWsServiceConfiguration.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public QName getRequestWrapperName(OperationInfo op, Method method) {
    Method m = getDeclaredMethod(method);
    RequestWrapper rw = m.getAnnotation(RequestWrapper.class);
    String nm = null;
    String lp = null;
    if (rw != null) {
        nm = rw.targetNamespace();
        lp = rw.localName();
    }
    WebMethod meth = m.getAnnotation(WebMethod.class);
    if (meth != null && StringUtils.isEmpty(lp)) {
        lp = meth.operationName();
    }
    if (StringUtils.isEmpty(nm)) {
        nm = op.getName().getNamespaceURI();
    }
    if (!StringUtils.isEmpty(nm) && !StringUtils.isEmpty(lp)) {
        return new QName(nm, lp);
    }
    return null;
}
 
Example 14
Source Project: cxf   Source File: OAuthRequestFilter.java    License: Apache License 2.0 6 votes vote down vote up
protected String validateAudiences(List<String> audiences) {
    if (StringUtils.isEmpty(audiences) && audience == null) {
        return null;
    }
    if (audience != null) {
        if (audiences.contains(audience)) {
            return audience;
        }
        AuthorizationUtils.throwAuthorizationFailure(supportedSchemes, realm);
    }
    if (!audienceIsEndpointAddress) {
        return null;
    }
    String requestPath = (String)PhaseInterceptorChain.getCurrentMessage().get(Message.REQUEST_URL);
    for (String s : audiences) {
        boolean matched = completeAudienceMatch ? requestPath.equals(s) : requestPath.startsWith(s);
        if (matched) {
            return s;
        }
    }
    AuthorizationUtils.throwAuthorizationFailure(supportedSchemes, realm);
    return null;
}
 
Example 15
Source Project: cxf   Source File: KerberosAuthenticationFilter.java    License: Apache License 2.0 6 votes vote down vote up
protected Subject loginAndGetSubject() throws LoginException {

        // The login without a callback can work if
        // - Kerberos keytabs are used with a principal name set in the JAAS config
        // - Kerberos is integrated into the OS logon process
        //   meaning that a process which runs this code has the
        //   user identity

        LoginContext lc = null;
        if (!StringUtils.isEmpty(loginContextName) || loginConfig != null) {
            lc = new LoginContext(loginContextName, null, callbackHandler, loginConfig);
        } else {
            LOG.fine("LoginContext can not be initialized");
            throw new LoginException();
        }
        lc.login();
        return lc.getSubject();
    }
 
Example 16
Source Project: steady   Source File: MemoryTokenStore.java    License: Apache License 2.0 5 votes vote down vote up
public void add(SecurityToken token) {
    if (token != null && !StringUtils.isEmpty(token.getId())) {
        CacheEntry cacheEntry = createCacheEntry(token);
        if (cacheEntry != null) {
            tokens.put(token.getId(), cacheEntry);
        }
    }
}
 
Example 17
Source Project: cxf   Source File: DynamicClientFactory.java    License: Apache License 2.0 5 votes vote down vote up
protected String findExternalResource(String nsURI, String localName, org.xml.sax.Attributes atts) {
    if (XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(nsURI)
        && ("import".equals(localName)
            || "include".equals(localName))) {
        String s = atts.getValue("schemaLocation");
        if (!StringUtils.isEmpty(s)) {
            s = mapSchemaLocation(s, locator.getSystemId(), catalog);
        }
        return s;
    }
    return null;
}
 
Example 18
Source Project: cxf   Source File: StaxUtils.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Reads a QName from the element text. Reader must be positioned at the
 * start tag.
 */
public static QName readQName(XMLStreamReader reader) throws XMLStreamException {
    String value = reader.getElementText();
    if (value == null) {
        return null;
    }
    value = value.trim();

    int index = value.indexOf(':');

    if (index == -1) {
        return new QName(value);
    }

    String prefix = value.substring(0, index);
    String localName = value.substring(index + 1);
    String ns = reader.getNamespaceURI(prefix);

    if (!StringUtils.isEmpty(prefix) && ns == null) {
        throw new RuntimeException("Invalid QName in mapping: " + value);
    }

    if (ns == null) {
        return new QName(localName);
    }

    return new QName(ns, localName, prefix);
}
 
Example 19
Source Project: cxf   Source File: AbstractJwsWriterProvider.java    License: Apache License 2.0 5 votes vote down vote up
protected void writeJws(JwsCompactProducer p, JwsSignatureProvider theSigProvider, OutputStream os)
    throws IOException {
    p.signWith(theSigProvider);
    JoseUtils.traceHeaders(p.getJwsHeaders());
    byte[] bytes = StringUtils.toBytesUTF8(p.getSignedEncodedJws());
    IOUtils.copy(new ByteArrayInputStream(bytes), os);
}
 
Example 20
Source Project: steady   Source File: EHCacheTokenStore.java    License: Apache License 2.0 5 votes vote down vote up
public void add(String identifier, SecurityToken token) {
    if (token != null && !StringUtils.isEmpty(identifier)) {
        int parsedTTL = getTTL(token);
        if (parsedTTL > 0) {
            cache.put(new Element(identifier, token, false, parsedTTL, parsedTTL));
        }
    }
}
 
Example 21
Source Project: cxf   Source File: ServerFactoryBeanDefinitionParser.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public String getId(Element elem, ParserContext context) {
    String id = super.getId(elem, context);
    if (StringUtils.isEmpty(id)) {
        id = cls.getName() + "--" + context.getDefaultActivation();
    }
    return id;
}
 
Example 22
Source Project: cxf   Source File: RequestPreprocessor.java    License: Apache License 2.0 5 votes vote down vote up
private void handleExtensionMappings(Message m, UriInfo uriInfo) {
    if (extensionMappings.isEmpty()) {
        return;
    }
    PathSegmentImpl ps = new PathSegmentImpl(uriInfo.getPath(false), false);
    String path = ps.getPath();
    if (PATHS_TO_SKIP.contains(path)) {
        return;
    }
    for (Map.Entry<?, ?> entry : extensionMappings.entrySet()) {
        String key = entry.getKey().toString();
        if (path.endsWith("." + key)) {
            updateAcceptTypeHeader(m, entry.getValue().toString());
            updatePath(m, path, key, ps.getMatrixString());
            if ("wadl".equals(key)) {
                // the path has been updated and Accept was not necessarily set to
                // WADL type (xml or json or html - other options)
                String query = (String)m.get(Message.QUERY_STRING);
                if (StringUtils.isEmpty(query)) {
                    query = "_wadl";
                } else if (!query.contains("_wadl")) {
                    query += "&_wadl";
                }
                m.put(Message.QUERY_STRING, query);
            }
            break;
        }
    }

}
 
Example 23
Source Project: steady   Source File: Header.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * @return Returns the name.
 */
public String getName() {
    if (StringUtils.isEmpty(name.getLocalPart())) {
        return null;
    }
    return name.getLocalPart();
}
 
Example 24
Source Project: cxf   Source File: JweJsonProducerTest.java    License: Apache License 2.0 5 votes vote down vote up
private String doTestSingleRecipient(String text,
                                     String expectedOutput,
                                     ContentAlgorithm contentEncryptionAlgo,
                                     final byte[] wrapperKeyBytes,
                                     final byte[] iv,
                                     final byte[] cek,
                                     boolean canBeFlat) throws Exception {
    JweHeaders headers = new JweHeaders(KeyAlgorithm.A128KW,
                                        contentEncryptionAlgo);
    JweEncryptionProvider jwe = null;
    if (wrapperKeyBytes == null) {
        headers.asMap().remove("alg");
        SecretKey cekKey = CryptoUtils.createSecretKeySpec(cek, "AES");
        jwe = JweUtils.getDirectKeyJweEncryption(cekKey, contentEncryptionAlgo);
    } else {
        SecretKey wrapperKey = CryptoUtils.createSecretKeySpec(wrapperKeyBytes, "AES");
        jwe = JweUtils.createJweEncryptionProvider(wrapperKey, headers);
    }
    JweJsonProducer p = new JweJsonProducer(headers, StringUtils.toBytesUTF8(text), canBeFlat) {
        protected JweEncryptionInput createEncryptionInput(JweHeaders jsonHeaders) {
            JweEncryptionInput input = super.createEncryptionInput(jsonHeaders);
            input.setCek(cek);
            input.setIv(iv);
            return input;
        }
    };
    String jweJson = p.encryptWith(jwe);
    assertEquals(expectedOutput, jweJson);
    return jweJson;
}
 
Example 25
Source Project: cxf   Source File: AttachmentUtil.java    License: Apache License 2.0 5 votes vote down vote up
public static Attachment createAttachment(InputStream stream, Map<String, List<String>> headers)
    throws IOException {

    String id = cleanContentId(getHeader(headers, "Content-ID"));

    AttachmentImpl att = new AttachmentImpl(id);

    final String ct = getHeader(headers, "Content-Type");
    String cd = getHeader(headers, "Content-Disposition");
    String fileName = getContentDispositionFileName(cd);

    String encoding = null;

    for (Map.Entry<String, List<String>> e : headers.entrySet()) {
        String name = e.getKey();
        if ("Content-Transfer-Encoding".equalsIgnoreCase(name)) {
            encoding = getHeader(headers, name);
            if ("binary".equalsIgnoreCase(encoding)) {
                att.setXOP(true);
            }
        }
        att.setHeader(name, getHeaderValue(e.getValue()));
    }
    if (encoding == null) {
        encoding = "binary";
    }
    InputStream ins = decode(stream, encoding);
    if (ins != stream) {
        headers.remove("Content-Transfer-Encoding");
    }
    DataSource source = new AttachmentDataSource(ct, ins);
    if (!StringUtils.isEmpty(fileName)) {
        ((AttachmentDataSource)source).setName(FileUtils.stripPath(fileName));
    }
    att.setDataHandler(new DataHandler(source));
    return att;
}
 
Example 26
Source Project: cxf   Source File: PluginLoader.java    License: Apache License 2.0 5 votes vote down vote up
protected Plugin getPlugin(URL url) throws IOException, JAXBException, FileNotFoundException {
    Plugin plugin = plugins.get(url.toString());
    if (plugin == null) {
        try (InputStream is = url.openStream()) {
            plugin = getPlugin(is);
        }
        if (plugin == null || StringUtils.isEmpty(plugin.getName())) {
            Message msg = new Message("PLUGIN_LOAD_FAIL", LOG, url);
            LOG.log(Level.SEVERE, msg.toString());
            throw new ToolException(msg);
        }
        plugins.put(url.toString(), plugin);
    }
    return plugin;
}
 
Example 27
Source Project: cxf   Source File: JavascriptGetInterceptor.java    License: Apache License 2.0 5 votes vote down vote up
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);
    URI uri = null;

    try {
        uri = URI.create(baseUri);
    } catch (IllegalArgumentException iae) {
        //invalid URI, ignore and continue
        return;
    }
    Map<String, String> map = UrlUtils.parseQueryString(query);
    if (isRecognizedQuery(map, uri, message.getExchange().getEndpoint().getEndpointInfo())) {
        try {
            Conduit c = message.getExchange().getDestination().getBackChannel(message);
            Message mout = new MessageImpl();
            mout.setExchange(message.getExchange());
            message.getExchange().setOutMessage(mout);
            mout.put(Message.CONTENT_TYPE, "application/javascript;charset=UTF-8");
            c.prepare(mout);
            OutputStream os = mout.getContent(OutputStream.class);
            writeResponse(uri, map, os, message.getExchange().getEndpoint());
        } catch (IOException ioe) {
            throw new Fault(ioe);
        }
    }
}
 
Example 28
Source Project: cxf   Source File: CXFNonSpringJaxrsServlet.java    License: Apache License 2.0 5 votes vote down vote up
protected String getParameterSplitChar(ServletConfig servletConfig) {
    String param = servletConfig.getInitParameter(PARAMETER_SPLIT_CHAR);
    if (!StringUtils.isEmpty(param) && SPACE_PARAMETER_SPLIT_CHAR.equals(param.trim())) {
        return " ";
    }
    return DEFAULT_PARAMETER_SPLIT_CHAR;
}
 
Example 29
Source Project: steady   Source File: MemoryTokenStore.java    License: Apache License 2.0 5 votes vote down vote up
public void add(String identifier, SecurityToken token) {
    if (token != null && !StringUtils.isEmpty(identifier)) {
        CacheEntry cacheEntry = createCacheEntry(token);
        if (cacheEntry != null) {
            tokens.put(identifier, cacheEntry);
        }
    }
}
 
Example 30
Source Project: cxf   Source File: BusDefinitionParser.java    License: Apache License 2.0 5 votes vote down vote up
protected void doParse(Element element, ParserContext ctx, BeanDefinitionBuilder bean) {
    String bus = element.getAttribute("bus");
    if (StringUtils.isEmpty(bus)) {
        bus = element.getAttribute("name");
        if (StringUtils.isEmpty(bus)) {
            element.setAttribute("bus", bus);
        }
    }
    element.removeAttribute("name");
    if (StringUtils.isEmpty(bus)) {
        bus = "cxf";
    }
    String id = element.getAttribute("id");
    if (!StringUtils.isEmpty(id)) {
        bean.addPropertyValue("id", id);
    }

    super.doParse(element, ctx, bean);

    if (ctx.getRegistry().containsBeanDefinition(bus)) {
        BeanDefinition def = ctx.getRegistry().getBeanDefinition(bus);
        copyProps(bean, def);
        bean.addConstructorArgValue(bus);
    } else if (!"cxf".equals(bus)) {
        bean.getRawBeanDefinition().setBeanClass(SpringBus.class);
        bean.setDestroyMethodName("shutdown");
        try {
            element.setUserData("ID", bus, null);
            bean.getRawBeanDefinition().getPropertyValues().removePropertyValue("bus");
        } catch (Throwable t) {
            //likely not DOM level 3, ignore
        }
    } else {
        addBusWiringAttribute(bean, BusWiringType.PROPERTY, bus, ctx);
        bean.getRawBeanDefinition().setAttribute(WIRE_BUS_CREATE,
                                                 resolveId(element, null, ctx));
        bean.addConstructorArgValue(bus);
    }
}