public void setBus(Bus bus) { if (super.getBus() == null) { super.setBus(bus); } }
public void setBus(Bus bus) { if (super.getBus() == null) { super.setBus(bus); } }
public Bus getBus() { Bus bus = super.getBus(); return bus == null ? BusFactory.getThreadDefaultBus() : bus; }
public Bus getBus() { Bus bus = super.getBus(); return bus == null ? BusFactory.getThreadDefaultBus() : bus; }
/** {@inheritDoc}*/ public void handleEvent(Event ev, AbstractServiceFactoryBean factory, Object... args) { switch (ev) { case ENDPOINT_SELECTED: { Class<?> cls = (Class<?>)args[2]; Endpoint ep = (Endpoint)args[1]; Bus bus = factory.getBus(); // To avoid the NPE if (cls == null) { return; } addLoggingSupport(ep, bus, cls.getAnnotation(Logging.class)); break; } case SERVER_CREATED: { Class<?> cls = (Class<?>)args[2]; if (cls == null) { return; } Server server = (Server)args[0]; Bus bus = factory.getBus(); addLoggingSupport(server.getEndpoint(), bus, cls.getAnnotation(Logging.class)); break; } default: //do nothing } }
/** {@inheritDoc}*/ public void handleEvent(Event ev, AbstractServiceFactoryBean factory, Object... args) { switch (ev) { case ENDPOINT_SELECTED: { Class<?> cls = (Class<?>)args[2]; Endpoint ep = (Endpoint)args[1]; Bus bus = factory.getBus(); // To avoid the NPE if (cls == null) { return; } addLoggingSupport(ep, bus, cls.getAnnotation(Logging.class)); break; } case SERVER_CREATED: { Class<?> cls = (Class<?>)args[2]; if (cls == null) { return; } Server server = (Server)args[0]; Bus bus = factory.getBus(); addLoggingSupport(server.getEndpoint(), bus, cls.getAnnotation(Logging.class)); break; } default: //do nothing } }
/** {@inheritDoc}*/ @SuppressWarnings("deprecation") public void handleEvent(Event ev, AbstractServiceFactoryBean factory, Object... args) { switch (ev) { case ENDPOINT_SELECTED: { Class<?> cls = (Class<?>)args[2]; Endpoint ep = (Endpoint)args[1]; Bus bus = factory.getBus(); // To avoid the NPE if (cls == null) { return; } addLoggingSupport(ep, bus, cls.getAnnotation(org.apache.cxf.annotations.Logging.class)); break; } case SERVER_CREATED: { Class<?> cls = (Class<?>)args[2]; if (cls == null) { return; } Server server = (Server)args[0]; Bus bus = factory.getBus(); addLoggingSupport(server.getEndpoint(), bus, cls.getAnnotation(org.apache.cxf.annotations.Logging.class)); break; } default: //do nothing } }
/** {@inheritDoc}*/ @SuppressWarnings("deprecation") public void handleEvent(Event ev, AbstractServiceFactoryBean factory, Object... args) { switch (ev) { case ENDPOINT_SELECTED: { Class<?> cls = (Class<?>)args[2]; Endpoint ep = (Endpoint)args[1]; Bus bus = factory.getBus(); // To avoid the NPE if (cls == null) { return; } addLoggingSupport(ep, bus, cls.getAnnotation(org.apache.cxf.annotations.Logging.class)); break; } case SERVER_CREATED: { Class<?> cls = (Class<?>)args[2]; if (cls == null) { return; } Server server = (Server)args[0]; Bus bus = factory.getBus(); addLoggingSupport(server.getEndpoint(), bus, cls.getAnnotation(org.apache.cxf.annotations.Logging.class)); break; } default: //do nothing } }
/** {@inheritDoc}*/ public void handleEvent(Event ev, AbstractServiceFactoryBean factory, Object... args) { switch (ev) { case ENDPOINT_SELECTED: { Class<?> cls = (Class<?>)args[2]; Endpoint ep = (Endpoint)args[1]; Bus bus = factory.getBus(); // To avoid the NPE if (cls == null) { return; } addLoggingSupport(ep, bus, cls.getAnnotation(Logging.class)); break; } case SERVER_CREATED: { Class<?> cls = (Class<?>)args[2]; if (cls == null) { return; } Server server = (Server)args[0]; Bus bus = factory.getBus(); addLoggingSupport(server.getEndpoint(), bus, cls.getAnnotation(Logging.class)); break; } default: //do nothing } }
/** {@inheritDoc}*/ public void handleEvent(Event ev, AbstractServiceFactoryBean factory, Object... args) { switch (ev) { case ENDPOINT_SELECTED: { Class<?> cls = (Class<?>)args[2]; Endpoint ep = (Endpoint)args[1]; Bus bus = factory.getBus(); // To avoid the NPE if (cls == null) { return; } addLoggingSupport(ep, bus, cls.getAnnotation(Logging.class)); break; } case SERVER_CREATED: { Class<?> cls = (Class<?>)args[2]; if (cls == null) { return; } Server server = (Server)args[0]; Bus bus = factory.getBus(); addLoggingSupport(server.getEndpoint(), bus, cls.getAnnotation(Logging.class)); break; } default: //do nothing } }
@Override public void handleEvent(Event ev, AbstractServiceFactoryBean factory, Object... args) { if (ev.equals(Event.START_CREATE)) { // Remove original URIDomainExpressionBuilder to be replaced on custom one ExtensionManagerImpl orig = (ExtensionManagerImpl)factory.getBus().getExtension(ExtensionManager.class); List<String> names = new ArrayList<>(); names.add(org.apache.cxf.ws.policy.attachment.external.URIDomainExpressionBuilder.class.getName()); orig.removeBeansOfNames(names); } } }
private void setDataBinding(AbstractServiceFactoryBean factory, DataBinding annotation) { if (annotation != null && factory.getDataBinding(false) == null) { try { if (!StringUtils.isEmpty(annotation.ref())) { factory.setDataBinding(factory.getBus().getExtension(ResourceManager.class) .resolveResource(annotation.ref(), annotation.value())); } factory.setDataBinding(annotation.value().newInstance()); } catch (Exception e) { //REVISIT - log a warning } } }
private void fillDataBindingSchemas() { ResourceManager rr = getBus().getExtension(ResourceManager.class); List<DOMSource> schemas = new ArrayList<>(); for (String l : schemaLocations) { URL url = rr.resolveResource(l, URL.class); if (url == null) { URIResolver res; try { res = new URIResolver(l); } catch (IOException e) { throw new ServiceConstructionException(new Message("INVALID_SCHEMA_URL", LOG, l), e); } if (!res.isResolved()) { throw new ServiceConstructionException(new Message("INVALID_SCHEMA_URL", LOG, l)); } url = res.getURL(); } Document d; try { d = StaxUtils.read(url.openStream()); } catch (Exception e) { throw new ServiceConstructionException(new Message("ERROR_READING_SCHEMA", LOG, l), e); } schemas.add(new DOMSource(d, url.toString())); } ((AbstractDataBinding)getDataBinding()).setSchemas(schemas); }
private void fillDataBindingSchemas() { ResourceManager rr = getBus().getExtension(ResourceManager.class); List<DOMSource> schemas = new ArrayList<>(); for (String l : schemaLocations) { URL url = rr.resolveResource(l, URL.class); if (url == null) { URIResolver res; try { res = new URIResolver(l); } catch (IOException e) { throw new ServiceConstructionException(new Message("INVALID_SCHEMA_URL", LOG, l), e); } if (!res.isResolved()) { throw new ServiceConstructionException(new Message("INVALID_SCHEMA_URL", LOG, l)); } url = res.getURL(); } Document d; try { d = StaxUtils.read(url.openStream()); } catch (Exception e) { throw new ServiceConstructionException(new Message("ERROR_READING_SCHEMA", LOG, l), e); } schemas.add(new DOMSource(d, url.toString())); } ((AbstractDataBinding)getDataBinding()).setSchemas(schemas); }
private void setDataBinding(AbstractServiceFactoryBean factory, DataBinding annotation) { if (annotation != null && factory.getDataBinding(false) == null) { try { if (!StringUtils.isEmpty(annotation.ref())) { factory.setDataBinding(factory.getBus().getExtension(ResourceManager.class) .resolveResource(annotation.ref(), annotation.value())); } factory.setDataBinding(annotation.value().newInstance()); } catch (Exception e) { //REVISIT - log a warning } } }
private void setDataBinding(AbstractServiceFactoryBean factory, DataBinding annotation) { if (annotation != null && factory.getDataBinding(false) == null) { try { if (!StringUtils.isEmpty(annotation.ref())) { factory.setDataBinding(factory.getBus().getExtension(ResourceManager.class) .resolveResource(annotation.ref(), annotation.value())); } factory.setDataBinding(annotation.value().newInstance()); } catch (Exception e) { //REVISIT - log a warning } } }
private void fillDataBindingSchemas() { ResourceManager rr = getBus().getExtension(ResourceManager.class); List<DOMSource> schemas = new ArrayList<DOMSource>(); for (String l : schemaLocations) { URL url = rr.resolveResource(l, URL.class); if (url == null) { URIResolver res; try { res = new URIResolver(l); } catch (IOException e) { throw new ServiceConstructionException(new Message("INVALID_SCHEMA_URL", LOG, l), e); } if (!res.isResolved()) { throw new ServiceConstructionException(new Message("INVALID_SCHEMA_URL", LOG, l)); } url = res.getURL(); } Document d; try { d = StaxUtils.read(url.openStream()); } catch (Exception e) { throw new ServiceConstructionException(new Message("ERROR_READING_SCHEMA", LOG, l), e); } schemas.add(new DOMSource(d, url.toString())); } ((AbstractDataBinding)getDataBinding()).setSchemas(schemas); }
private void fillDataBindingSchemas() { ResourceManager rr = getBus().getExtension(ResourceManager.class); List<DOMSource> schemas = new ArrayList<DOMSource>(); for (String l : schemaLocations) { URL url = rr.resolveResource(l, URL.class); if (url == null) { URIResolver res; try { res = new URIResolver(l); } catch (IOException e) { throw new ServiceConstructionException(new Message("INVALID_SCHEMA_URL", LOG, l), e); } if (!res.isResolved()) { throw new ServiceConstructionException(new Message("INVALID_SCHEMA_URL", LOG, l)); } url = res.getURL(); } Document d; try { d = StaxUtils.read(url.openStream()); } catch (Exception e) { throw new ServiceConstructionException(new Message("ERROR_READING_SCHEMA", LOG, l), e); } schemas.add(new DOMSource(d, url.toString())); } ((AbstractDataBinding)getDataBinding()).setSchemas(schemas); }
private void setDataBinding(AbstractServiceFactoryBean factory, DataBinding annotation) { if (annotation != null && factory.getDataBinding(false) == null) { try { if (!StringUtils.isEmpty(annotation.ref())) { factory.setDataBinding(factory.getBus().getExtension(ResourceManager.class) .resolveResource(annotation.ref(), annotation.value())); } factory.setDataBinding(annotation.value().newInstance()); } catch (Exception e) { //REVISIT - log a warning } } }